Astar recommendations?

Started by
2 comments, last by Fisco 16 years, 9 months ago
Sorry if this isn't the right forum for this question but I picked what I thought worked best. I'm currently setting up an isometric tile based game and am in the process of figuring out how to implement A* into it. I was aiming for having various obstacles on the screen but preprogrammed "nav points" that are the only nodes used in pathfinding, rather than every single tile. You double click on an area and the program will calculate the best path around obstacles using only the nav point nodes. Does anyone have any recommendations, links, or code that would be the best way to approach this? Most information I can find is pretty much the same and it's not what I need.
Advertisement
Why is it not what you need? Sounds like you have the setup (go from point a to point b, using this node graph, avoiding these obstacles), and you have the docs describing the algorithm...
You might be able to do something that I thought about when playing with some A Star code that a guy had online a few years ago. He had a speed test for his code that generated a bunch of random paths between random start/end points on a particular map (like 500) and I noticed (since he had a visual of the paths as they were generated) that many of the random paths when thru the same points frequently. Somehow you could analyze and extract good points which had a high frequency of being reused to select your set of Nav points (a Monty Carlo method....)

Another method moght be randomly picking points and growing rectangles that have clear edges (stoping that edges growth when it hits an obstacle) and then using the centers of the resulting rectangles as you Nav points. You would have to do several cysle to fill in missed parts of the map (or another pattern using lines and/or growing diamonds/diagonal rectangles....)
--------------------------------------------[size="1"]Ratings are Opinion, not Fact
I would say you need to create a destination nav point on the place you clicked. But would probably do away with nav points all together, and use the tiles.

Astar with straight line heuristic should be plenty fast, at least fast enough to beat the user before he clicks anywhere else.

This topic is closed to new replies.

Advertisement