What about pathfinding , mobile and moving objects

0 favourites
  • 2 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • Heya everyone ,

    I'm making a game for someone , and it'll be a mobile game , I'll be using the pathfinder for this one , but I heard that the performance is really bad on mobile with pathfinding and I never knew if you could set the end of the path to a moving object (Ex. Player)

    What I'm asking for is , is there a way to make a dynamic pathfinder ( Ex. Phatoms that pathfinds to the player ) that doesn't destroy the user's experience ?

    My try at it :(

    You can play with my capx if you want ...

    Anyways , Thanks for reading ...

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • ut I heard that the performance is really bad on mobile

    It's always best to test it to see the actual performance as hearsay can be exaggerated.

    For moving objects you should take the manual into consideration:

    ou should also avoid pathfinding every tick, since this will cause extremely high CPU usage and also increase the amount of time it takes for other objects to determine their paths.

    https://www.scirra.com/manual/154/pathfinding

    You'll still end up having to calculate a new path periodically, but all you need to do is get it close enough to the player so it has a line of sight to the player. Then you can switch to a much less cpu intense behavior such as the bullet behavior, to close the gap.

    You could also try and do what gillis did and break the area up into boxes and make a list for every box of the best direction to get to any other box. It's a bear to setup as you'll basically be defining the path from every box to every other box, but once the game is running pathfinding will be very fast as it's just a simple lookup.

    http://www.scirra.com/forum/quadralant-pathfinding-optimization-solved_topic60379.html

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)