Hey, does anybody know of any example of 8 directions pathfinding? All I seem to find in the internet is 4 directions examples.
Hey, does anybody know of any example of 8 directions pathfinding? All I seem to find in the internet is 4 directions examples.
If your game is for windows you could try pathfinding object, this object has a 8-dir mode.
Agreed. If you're only targeting Windows, an extension is the way to go - it's much easier than "rolling your own", and will run faster too.
Failing that...
Is there a specific example you're interested in?
Do you have a specific use-case in mind?
The choice of pathfinding algorithm is mainly between A* and breadth-first flow-field / distance-map. Which of those you should use depends on:
- number of objects (starting points)
- number of targets (destinations)
- map size
Do you need "weighted" movement costs? (these can be use with either algorithm, but add complexity and reduce performance, so if you don't need them, don't use them!)
It ought to be pretty straight-forward to add the extra directions to an example that uses 4-directions.