

The main drawback of path recalculation is that a lot of path information is thrown away.

Recalculating paths #Īs time passes we expect the game world to change. If however obstacles can cause the path to change significantly, consider using the pathfinder for obstacle avoidance. The pathfinder will find the desired path, and then while following it, move around obstacles.

If the typical obstacle can be routed around, use a separate obstacle avoidance algorithm (steering) along with your pathfinder. A pathfinding algorithm will compute a path around stationary obstacles, but what if the obstacles move? By the time a unit reaches a particular point, an obstacle may no longer be there, or a new obstacle may be there.
