I have defined the map for a tile based game as a 2D array in js. I would like to use this array as the main input to a pathfinding library.
I’ve looked through all of the asset store tools for pathfinding, and they all seem to work on the premise that you give them a pre-made world and they will ‘search’ for traversable spaces, and calculate paths on that. This seems to be the case even for libraries which use a grid search, in that they want to calculate their own grids based on the terrain height maps rather than simply taking an existing grid. These options will not work for me, as the contents of my map array will change continuously over the course of the game. Paths which were available when the game started may not be available after a change in the map.
I did find a raw js algorithm which seems close to what I want, API wise, here:
However I’m not really sure how to adapt that to work for Unity.
For now I have written something for this myself, but I would prefer to use something that was a bit more sturdy and optimized than my little ‘based on wikipedia’ unityscript implementation.
Can anyone give me any recommendations? They don’t have to be free, but preferably not be massive or all-encompassing AI libraries which happen to contain a bit of pathfinding.
Thanks a lot!! that was super useful!
– LunaTrapI'm at a loss for words how useful and simple that code is;
– Moper