This is an example of a breadth first, flow-field pathfinding system.
It doesn't require any extensions, and therefore should theoretically be compatible with any and all exporters.
It is specifically designed to have a minimal impact on overall system performance, which it achieves by spreading the very computationally expensive pathfinding process across multiple frames (it does not update instantly). It is also adaptive, dynamically balancing pathfinding performance with system load, to ensure a stable framerate.
Because of this, it is particularly well suited to games with:
- very large maps.
- a very large number of objects searching for the target(s).
- multiple targets.
For example, a Tower Defense clone, or a game with a horde of zombies chasing the player.
It is NOT suitable for finding a path between just two points - for example, a point and click adventure game. It will work, but the A* algorithm would be much more efficient in this case.
Note that this example uses a cellSize of 5 x 5 pixels only in order to demonstrate performance on a large map (100 x 100 tiles). This value can and should be adjusted before use in a game (it's in one of the Pathfinding object's alterable values).