I'm curious if anyone has used it in any games, be it graphical or text.
Printable View
I'm curious if anyone has used it in any games, be it graphical or text.
A*? I dont recall which type this is. The best pathfinding i have used was some of the simplest. You take a snapshot of the map, and start lableing each block of the grid with a number based on how many steps it is away from the destination. so the destination would be 0, every square or hex or whatever around it would be 1, every one touching them would be 2... keep going until the location of the source is numbered. Then you know how many steps it will take to get wherever you want to go, as well as the shortest path to get there. Just have the source move to a number lower than whatever its own is. It never fails. Ever. Unless ur working in some insane number of dimensions =P. Good luck. I can furnish sample logic to do this if my explaination was unclear.
A* is a better algo than the one mentioned above (assuming you define a good heuristic) it will also find the shortest path but use much less memory than BFS.
I have used A* in my AI course on an assignment but you need the server the school provides for the environment to run it, i just wrote the Agent.