Thursday, May 22, 2014

AI Pathfinding for JavaScript Developers

Ash Blue, Game Developer at Clever Crow Games, gave a talk at the HTML developer conference this morning called "AI Pathfinding for JavaScript Developers". The AI he described is called "A*". He showed his implementation of the algorithm in JavaScript. It finds the best path by checking the tiles on the map between the start and end of the path and placing them into an "open" stack and a "closed" stack. The neighbors of tiles are checked starting with the start tile and first placed in the open stack. When a tile is found to be a longer path than others it is placed in the closed stack. You also track the parents of each tile so when you reach the end of the path you can recursively find the path through the parents.


You can view the video of Ash's talk on YouTube at https://www.youtube.com/watch?v=7kMbPU_6Me4.

The slides from the presentation are available on GitHub at http://ashblue.github.io/pathfinding-presentation.

No comments:

Post a Comment