Jump to content
  • Advertisement
Sign in to follow this  
Trainwreck

Path Following

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

Can somebody point me in the right direction to something that will teach me how to do the following? I want to have an NPC in my game follow a certain path (which I will have to program into the game) to a certain location. It isn't a best-path analysis or anything like that. Basically I want to know how to draw the path, and how to make him follow it to the location.

Share this post


Link to post
Share on other sites
Advertisement
Well, generally what you want to is specify several path nodes. The NPC should ideally use these path nodes, and work out how to get between himself.

The problem is simple if the path nodes always have direct line of sight to each other without obstacles -- simply have the NPC walk from one to the next, maybe rounding off the corners so it doesn't look strange.

If the NPC must actually navigate, you'll need to use a path finding algorithm. A* is a particularly popular one that you can google for lots and lots of tutorials.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Yes, I was thinking of giving him a specific path, so path nodes will work wonders. Thank you so much.

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!