Jump to content
  • Advertisement
Sign in to follow this  
soarsky

A question about A* path-finding

This topic is 4842 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

hi, my path finding is based on A*. Now I can find the correct path and go through the passable tiles. But if some units stand in my way when I am moving. How can I do to bypass them? Who can give me some advices or pseudos.

Share this post


Link to post
Share on other sites
Advertisement
Assuming units fill tiles and make them inpassable, you can simply check the next 10 or so tiles in the path chain to see if they have become inpassable since path creation - then if they have you can simply repath. As long as this doesn't happen *too* often then you won't see too much of a performance penalty...

Share this post


Link to post
Share on other sites
If it does become a problem, you could try computing a path to the path node a certain distance towards the goal. It means likely suboptimal paths and might not even work ( in which case you could easily fallback to the full pathing ), but it would likely speed things up.

I'd try for steering behaviours first though, definatly.

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!