Game Development Community

AStar

by Morrock · in Technical Issues · 03/04/2008 (7:41 pm) · 2 replies

Hi, I'm having trouble implementing A* into code. Does anyone know any A* tutorials/guides that cover why and how certain aspects are developed into the programming language. I know the whole theory of it by heart. It's just writing from theory into code that stops me with this. I've looked at example code that's already been written by other people but just ending up wondering "why?" The only problem is turning it from theory into C++ , so can anyone show me some guides that will help me with this?

#1
03/05/2008 (5:18 pm)
I used this resource - http://www.garagegames.com/blogs/11127/14049 and it worked perfectly. I now have my bots using A* to pathfind around a map with 400x400 nodes. I will try 2000x2000 later and do some benchmarks to see how it holds up.

One hiccup I have encountered is making a good way to trace the generated paths using polygons or lines. There's just no clean way I can think of.

Depending on the speed and how smooth the paths are I might leave it like it is, or try to figure out path smoothing or a quadtree approach. Good luck and let us know how it goes for you.
#2
03/05/2008 (5:47 pm)
On tutorials itself, I think this is the best, by far: A* Pathfinding for Beginners