Jump to content
  • Advertisement
Sign in to follow this  
worldspawn

Astar recommendations?

This topic is 4061 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
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....)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!