2 ms·
You could use pretty much any pathfinding algorithm (A* for example) even if you don't have a grid based graph. In the implementation, you would just need to m
by nacs 11y ago
You could use pretty much any pathfinding algorithm (A* for example) even if you don't have a grid based graph.
In the implementation, you would just need to modify how the algorithm transverses each valid walkable/unwalkable node (how to go from waypoint to waypoint) and possibly how much extra cost each node has (water/mountainous terrain could have increased cost for example) instead of letting it go the usual up/down/left/right and possibly diagonals for grids.
If the waypoint based approach isn't ideal for you, then you should look up "navigation mesh" [1] pathing which is a bit trickier to implement but works well when you have a bunch of large empty/walkable areas.
[1]: https://en.wikipedia.org/wiki/Navigation_mesh https://en.wikipedia.org/wiki/Navigation_mesh