Tuesday, September 22, 2009

Paths and Pathfinding

So next on the chopping block are paths and path finding... what a lot of fun that is :)

I went hunting around for path finding stuff and of course landed on A* since it's still touted as one of the best... however, according to the definitions for A* I won't be using A*.  Why?  Well, I have to account for both RPG style and Platformer style movement and the raw A* algorithm fails miserably with platformers because it doesn't take the movement limitations of the characters into account.  So, I've taken the basic A* algorithm and enhanced it to use the movement limitations of the character itself when locating a path..  So far so good.  I also added in some order specific stuff in the recursive search so that it will attempt to get their by the shortest path first and then start expanding out when that route fails...  in other words, it will first attempt movement in the + x direction when  the destination x is greater... not rocket science but add that to recursive behavior and it can get tricky.   Nuff for now...

No comments:

Post a Comment