PathFinding.js
PathFinding.js copied to clipboard
Nodes with weights
This is not really a bug, more like a wishlist. After looking at the source code, seems like your pathfinding algorithm only account for walkable or non-walkable nodes. It would be amazing to add weights to each node to account for different terrains like mud, swamp, rivers, etc...
There's forks that will do this, I forked someone else's fork for this, can't check his name right now but all props go to him https://github.com/rohan-deshpande/PathFinding.js
There's already an open issue for it somewhere...
Original fork https://github.com/paulrobello/PathFinding.js
There's a PR for it detailing the changes.
I already forked it with a slightly different solution. 0 is now reserved for walls (since there is no upper limit for cost), 1 for walkable areas, and 2+ for other terrain types. Nevertheless, thanks for pointing it out.
Best fork for this in 2018?