Most optimal pathfinding update speed?

0 favourites
  • 3 posts
From the Asset Store
Fantasy Game includes more than 600 sound effects inspired by hit computer games like World of Warcraft and Diablo.
  • Any tips for optimizing pathfinding events so you're not draining the CPU?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I've been using an Every X seconds Event while my characters chase another character. This allows the Find path and Move along path Actions to do their thing and not hamper the other, since it takes a short time to calculate the path.

    I've also set up actions to enable/disable the Pathfinding behavior...I'm not entirely sure if this works well, or at all, but it might be worth testing.

    I've also been advised to employ the Trigger Once Event to prevent successive calls on the Find path Event from triggering too soon, cancelling out Move along path because it's still calculating. You might want to try that.

    I'm also personally curious about how long a single call on Find path takes on average to calculate. I know it's dependent upon the distance and number of obstacles, etc, but what's a good mean time?

  • Your guess is as good as mine.

    From my testing, pathfinding is more or less inconsistent due to CPU issues. I can tell because when my enemy ships are pathfinding, a yellow afterburner sprite appears behind their engines. When they are moving due to bullet behavior (the default behavior I gave them), this sprite does not appear.

    I am currently having them 'pathfind' every 1 second, but I'm not sure that is optimal. I'm thinking of removing pathfinding altogether and giving them a set AI behavior, in particular the rotate-move-rotate-fire behavior I am trying to set up that I didn't get many responses on.

    I am starting to think that pathfinding by itself is not really a good behavior to use, but instead to be integrated as a small part of an object's behavior for solving the problem of how to get from position A to position B.

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