# pathfinding algorithm

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

## 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 on other sites
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 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.

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 11
• 11
• 15
• 11
• 11
• ### Forum Statistics

• Total Topics
634149
• Total Posts
3015834
×

## Important Information

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!