A* Path-finding - with a twist!!!

Started by
9 comments, last by ServantOfGlaaki 21 years, 11 months ago
Grrr, the Game Dev server just ate my lengthy response and I don't have time to type it out again! Here it is in point form... sorry for the brevity...

Basically, your code looks like it will work. I think I deciphered your algorithm and it's basically what we talked about above.

If test1 or test2 are true, delete the superfluous border element immediately... it will cut down the size of the list for comparison.

Assuming your code works, you now need to build a connectivity map. Run throught he border list once. For each element, get the two polygons that are the neighbours of the border element. In each polygon (or another data structure) store a link to the other polygon. A pointer would be best, so that your connectivity map has a direct mapping into linked memory addresses in your PC. Otherwise just a list of polygon IDs. After passing through the border element list, each polygon should have as many links to other polygons as polygons that border it. This is the data structure you can use for pathfinding.

I hope this makes sense!

Cheers,

Timkin

[edited by - Timkin on May 21, 2002 9:19:16 PM]

This topic is closed to new replies.

Advertisement