Simple pathfinding...

BlitzMax Forums/BlitzMax Beginners Area/Simple pathfinding...

po(Posted 2006) [#1]
How is it done? I'm making a simple RTS and I need the selected unit to move to where you click. Would I create a type filled with connect-the-dots locations that the unit would follow till the end? How would I get the path to avoid obstacles such as bases?


Dreamora(Posted 2006) [#2]
Its mainly done by first learning BM. currently I would recommand that you first learn the language and then start working on path finding, because it will need an optimized structure (C++ code would cause some serious performance problems)


smilertoo(Posted 2006) [#3]
look for the blitz A* examples.


FlameDuck(Posted 2006) [#4]
Read about grid datastructures, and traversing them.


tonyg(Posted 2006) [#5]
A* for grid/node based or use Obstacle Avoidance from Steering Behaviours for more open spaces with less obstacles (and no 'blind alleys').If it's a small (1 screen) map use Djikstra's algo pre-game and populate an array.


po(Posted 2006) [#6]
Ok, thanks all.