Jump to content
  • Advertisement
Sign in to follow this  
zgintasz

Add more randomness to A* path?

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

Hey,

A* is great, it finds the closest path possible. But what could I do, to vary that path a little bit? E.g. don't always take the closest path possible, go 3rd or 4th closest path. Or just move little bit different path.

What do you guys suggest to make it look great?

Share this post


Link to post
Share on other sites
Advertisement
The first thing that comes to mind is adding some random noise to the costs. It's trivial to try and you get to modulate how random you want the results to look.

Share this post


Link to post
Share on other sites

I had the same idea. How big should that random be? Currently I see these cost values range from 2 to 80. What should I factor in random range?

Share this post


Link to post
Share on other sites

Plug in some numbers and find out?

Indeed. Cost perturbations should be positive, to avoid any possible risk of getting negative costs, but it's the only real constraint: noise amounts greater than the cost difference between the actual best move and the second best one have no effect (the best move remains the best), but that difference is often zero.

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!