User Tag List

Page 3 of 5 FirstFirst 1 2 3 4 5 LastLast
Results 21 to 30 of 45

Thread: Pathfinding on Android

  1. #21
    Clicker Multimedia Fusion 2Android Export Module
    Corlen's Avatar
    Join Date
    Mar 2007
    Location
    Your House
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well my game IS like a Fire Emblem game, only one unit moves at a time. They are moving through units because the obstacle detection system isn't adding them for some reason when I try to test if all but one (the one that is moving at the time) have a flag that is off.

  2. #22
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,393
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    Excellent - I'll look forward to it then
    I think for games like this it would be good to use two separate arrays (or perhaps Z-indexes) to store obstacles - one containing fixed map obstacles (rivers, mountains, etc) and another for moveable obstacles (enemy units, etc). That ought to be more efficient, as you would very rarely (if ever) need to update the first array, and it would be very quick to just store the positions of moveable objects in the second array. The fixed movement range of units should allow for quite a few optimizations too.

  3. #23
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,393
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)

    Smile

    Here's the latest version of my pathfinding engine: http://sdrv.ms/YUNp1D

    PFeg.jpg

    This version is mainly meant for Advance Wars / Fire Emblem style games. It can handle tile costs between 1 and 99 (instead of just "obstacle" / "not an obstacle") making it possible for terrain to slow a unit without being impassable, and will also highlight all squares within the unit's movement range.
    As with previous versions, it doesn't require any extensions that aren't Android / iOS compatible.

  4. #24
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    happygreenfrog's Avatar
    Join Date
    May 2011
    Location
    I.L.T.D.O.I.R (I.L.T.D.O.I.R's Location: The Dimension Of Infinite Recursion)
    Posts
    4,307
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by MuddyMole View Post
    I'm not likely to spend a lot of time trying to optimize it for multiple units, because I'm not even convinced it would be that useful, outside of realtime-strategy games (which I doubt the Android exporter is really capable of) or tower-defense clones (and I really don't think the world needs yet another of those).
    I'd rather try and build something suited to an Advance Wars / Fire Emblem type of game - that's been on my to-do list for ages now.
    I think the Android exporter could handle a real-time strategy game, and there are ways to make a tower defense game unique enough to be good.
    Anyway, if you don't add multiple unit support, then your example will be pointless for me, as tower defense games and real-time strategy games are the two main reasons that I want to use pathfinding in the first place.

  5. #25
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,393
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by happygreenfrog View Post
    I think the Android exporter could handle a real-time strategy game, and there are ways to make a tower defense game unique enough to be good.
    You know what? There really aren't. GooglePlay already has over four hundred Tower Defense clones for Android, so there must be literally thousands of them if you include all the different versions for Flash, iOS, Windows, etc. The genre is completely and utterly played out.
    As for an RTS - if noone has been able to make a decent one even for Windows (and many have tried), then what hope is there for underpowered Android devices without the benefits of HWA, pathfinding extensions, etc? I'm not saying it's impossible, but I just don't see it happening...

    That's fine if my example is of no use to you - Crusher's excellent example ought to suit your needs. However, that does have its limitations, such as the lack of support for tile costs and the poor performance in certain situations - and that's where my example comes in.

  6. #26
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    happygreenfrog's Avatar
    Join Date
    May 2011
    Location
    I.L.T.D.O.I.R (I.L.T.D.O.I.R's Location: The Dimension Of Infinite Recursion)
    Posts
    4,307
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by MuddyMole View Post
    You know what? There really aren't. GooglePlay already has over four hundred Tower Defense clones for Android, so there must be literally thousands of them if you include all the different versions for Flash, iOS, Windows, etc. The genre is completely and utterly played out.
    As for an RTS - if noone has been able to make a decent one even for Windows (and many have tried), then what hope is there for underpowered Android devices without the benefits of HWA, pathfinding extensions, etc? I'm not saying it's impossible, but I just don't see it happening...

    That's fine if my example is of no use to you - Crusher's excellent example ought to suit your needs. However, that does have its limitations, such as the lack of support for tile costs and the poor performance in certain situations - and that's where my example comes in.
    You, sir, have to see this. No HWA, possibly Android-compatible (at least, I don't remember it requiring any objects that the Android runtime can't use (it has a bad object or two that might not be compatible with the Android runtime, though (you can build applications that have incompatible extensions, though. It just ignores the incompatible extensions))), and it runs okay (I haven't actually tested it on an Android device (or an Android emulator, or anything Android) yet, though). I made an HWA version (though I have yet to publicly share it), though, and it runs even better. Anyway, it is possible to make a good RTS (or at least a good RTS engine) using MMF2 that can run on Android.

  7. #27
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,393
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    Note the comments:
    "...your game really seems to be too slow I was managing 40fps with only the 3 main units on screen" Uprize
    "..my laptop must be really slow if you guys are getting 40 fps. I'm only getting maximum of 12" RickyRombo
    "The biggest downfall is that you have no pathfinding" Uprize
    "But it's too slow in my system it's unplayable for me. :/" byo

    And that's on Windows PCs - on an Android powered device it's going to be a slideshow.

  8. #28
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    happygreenfrog's Avatar
    Join Date
    May 2011
    Location
    I.L.T.D.O.I.R (I.L.T.D.O.I.R's Location: The Dimension Of Infinite Recursion)
    Posts
    4,307
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by MuddyMole View Post
    Note the comments:
    "...your game really seems to be too slow I was managing 40fps with only the 3 main units on screen" Uprize
    "..my laptop must be really slow if you guys are getting 40 fps. I'm only getting maximum of 12" RickyRombo
    "The biggest downfall is that you have no pathfinding" Uprize
    "But it's too slow in my system it's unplayable for me. :/" byo

    And that's on Windows PCs - on an Android powered device it's going to be a slideshow.
    You missed one:

    I had 24 units on screen and fps never dropped below 47.

    Also, I've optimized it before by making it use ForEach loops when possible, and it runs even faster with that optimization.

  9. #29
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,393
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    That's still not impressive.
    Bear in mind that it's not really an RTS example - it's an excellent fog-of-war example (I'm sure that's what's causing the performance issues), with map loading and unit selection (both of which are pretty trivial). However, there is no pathfinding or even local obstacle avoidance, which will slow your game. More importantly, there are no enemy units which is one of the things that really hurts performance, because instead of just performing a calculation once per unit, it will often be once per combination of units, meaning that the number of calculations required will increase exponentially. Plus you could potentially have a lot of graphical effects (projectiles, explosions, magic spells, etc) going on, without the benefit of hardware acceleration.
    And you want to do all that on mobile devices with nowhere near the power of a PC / laptop...

  10. #30
    Clickteam Clickteam
    Danny's Avatar
    Join Date
    Aug 2007
    Location
    United Kingdom
    Posts
    3,016
    Mentioned
    21 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by MuddyMole View Post
    Note the comments:
    "...your game really seems to be too slow I was managing 40fps with only the 3 main units on screen" Uprize
    "..my laptop must be really slow if you guys are getting 40 fps. I'm only getting maximum of 12" RickyRombo
    "The biggest downfall is that you have no pathfinding" Uprize
    "But it's too slow in my system it's unplayable for me. :/" byo

    And that's on Windows PCs - on an Android powered device it's going to be a slideshow.
    Not necessarily. Android is Hardware Accelerated using OpenGL. I have designed engines specifically for Android that run crud in standard runtime yet maintain a constant 60fps on Android.

Page 3 of 5 FirstFirst 1 2 3 4 5 LastLast

Similar Threads

  1. Setting up the Android SDK for the Android Export Module
    By Jeff in forum Android Export Module Version 2.0
    Replies: 3
    Last Post: 2nd October 2013, 04:08 PM
  2. Pathfinding extensions for Android?
    By Disthron in forum Android Export Module Version 2.0
    Replies: 1
    Last Post: 11th May 2013, 06:43 PM
  3. Need Android Class Name and Android Package Name to create my facebook ads
    By paobrasil in forum Android Export Module Version 2.0
    Replies: 8
    Last Post: 17th April 2013, 04:49 PM
  4. [Building Error] Android Dialogs & Android Lights
    By ProdigyX in forum Android Export Module Version 2.0
    Replies: 2
    Last Post: 20th March 2013, 10:05 AM
  5. [Bug?] Android Object/Android Menu Combo
    By scottige in forum Android Export Module Version 2.0
    Replies: 5
    Last Post: 9th December 2012, 12:16 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •