Pathfinding in Space game

BlitzMax Forums/BlitzMax Beginners Area/Pathfinding in Space game

Hello I have written a nice little versus space game - a bit like Space War - but viewed side on. There are some platforms and dynamic objects and my enemy spaceship needs to pathfind round them to get to the player.

I am going to extend the game later on - so it is essential I have a proper pathfinding routine. (platforms will be destroyed or have holes in them)

What I would like is a routine which could come up with 5 different routes and then I would randomly choose one. I would want one of these routes to be the fastest/shortest route and the others to be quite varied and going in different directions so the enemy has some variety in tracking the player.

I have managed to convert my game area and dynamic objects into a grid array.

Can someone point me in a direction of a pathfinding routine, that can find routes like I require - ie not just the shortest route. Thank you very much

What kind of pathfinding exactly? There's many that will and will not match your needs, it would be nice to filter that.

A search for A* pathfinding will bring up tons of information.

A* is useful if you know the position of an object on the grid. If you don't know where it is, which I assume since it's about dynamic objects I'd say use Dijkstra's algorithm.

Read Programming Game AI by Example by Mat Buckland. He has that topic covered.

Thank you :)

I have both the start and end positions on the grid - I don't think I need to worry too much about dynamic objects in my particular case.

I want to get more paths than just the shortest one though.

Then you need Dijkstra's.

Ok Thank you - I will look it up :)