PathFinding.js icon indicating copy to clipboard operation
PathFinding.js copied to clipboard

Nodes with weights

Open tqtran7 opened this issue 8 years ago • 4 comments

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...

tqtran7 avatar Jun 14 '16 00:06 tqtran7

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...

rohan-deshpande avatar Jun 15 '16 05:06 rohan-deshpande

Original fork https://github.com/paulrobello/PathFinding.js

There's a PR for it detailing the changes.

rohan-deshpande avatar Jun 15 '16 05:06 rohan-deshpande

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.

tqtran7 avatar Jun 15 '16 21:06 tqtran7

Best fork for this in 2018?

cedric-h avatar Jan 09 '18 15:01 cedric-h