prettymuchbryce / easystarjs

An asynchronous A* pathfinding API written in Javascript.
MIT License
1.9k stars 165 forks source link

Tactical RPG use #94

Open ryanmunger opened 3 years ago

ryanmunger commented 3 years ago

Would you recommend using this for a tactical rpg where:

1.) The amount of tiles player can move to are restricted by the amount of moves they have left.

2.) If player uses moves, it is reflected in amount of moveable tiles left.

3.) If player is adjacent to a wall and it takes 7 moves to go around directly to the other side, but player only has 6 moves left, the tile directly on the other side would not show as walkable.

My assumption is - a lot of this would be custom code outside of this library. I just wasn’t sure if this library could be compatible or make implementation any easier regarding these requirements.

Thank you for any insight!

TeeTeeHaa commented 3 years ago

Disclaimer: I am using EasyStar.js since a couple of weeks only. EasyStar.js helps you if you have a start point and an end point and want to calculate whether the end point is reachable from the start point and if so what the shortest path is. You have a start point and want to calculate a list of all end points being reachable from the start point within a certain amount of steps. I guess you do not need EasyStar.js but another library or own code which uses a "fill algorithm" to create a "walking cost" (amount of steps) map. I assume EasyStar.js calculates such a "walking cost" map internally but I do not know whether it is accessible. In addition this map might not be complete because EasyStar.js might abort its calculations if it thinks it has found the shortest path already.