Jump to content
  • Advertisement
Sign in to follow this  
ProgrammingNerd

pathfinding algorithm

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

I am designing a path finding algorithm. I don't if it already exists, but I thought of it on my own. Here's my idea. I create a "pathmap" ie a list of vectors showing how to get from one node to another. Also i need a list of indexes to show what nodes are connected to other nodes. Then I could setup a recursive loop to find all possible ways to get from point a to point b. Then I could add all the vectors of the node to get from point a to point b and find the shortest path. Is this a good path finding algorithm? I haven't done much research on pathfinding, and am wondering if this is a fast method to implement in realtime. Thanks in advance, ProgrammingNerd

Share this post


Link to post
Share on other sites
Advertisement
all possible ways= bad, you will get loops in your paths and you will get an infinite number of possible paths, but such algorithms exist already, they solve this problem by marking points that where already visited and dont 'revisit' them... then there are different methods to go through the 'graph', one for example is (using a stack)/*cant remember the name*/ and it visits the closest points first, then the next closest to that etc... the fastest you can get (AFAIK) is A* (Astar) there you 'predict' which of the possible ways from the current point to the points it got a direct path to is the most probable to get to the resulting point (for example dotproduct of (target-start) with (nextpoint-point), both normalized will be close to 1 for a good candidate)...


i hope i explained A* correct...


T2k

Share this post


Link to post
Share on other sites
Thanks T2k, it would be more effecient to use A* than to get my way to work. Also, my way would use more memory than alot of machines would have. And there are resources out there.

Thanks for your help.

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!