-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Walkable tile will break routing if not on startup grid but added later. #14
Comments
I don't see how this is a problem with easystar. The collision grid and the acceptable tiles are independent variables, and so it shouldn't matter in what order you change them. Perhaps this was a problem specifiy to phaser_plugin_pathfinding? |
This seems like an issue with the expectations around state. Maybe @PiNotEqual3 expects that easystar will track his changes to his collisionGrid without explicitly having to call Maybe it makes sense to deep copy the grid passed into |
I would suggest keeping easystar out of any state stuff, and require to call setGrid if you want to load a new grid (like a new level). For dynamic changes (like doors, bridges, etc) the avoid/stopAvoiding mechanism should suffice. Maybe it would help if this is documented a bit more clearly, with a unlockable door example. |
If you setup a grid were all tiles are 1 like [1,1,1,1,....], set tiles [1,2] as walkable and change the map during the game by setting one tile to 2 it will break the path finding. At first it will try to move around but if you keep recalculating the path it can't decide on one path and get stucked.
I am using the Phaser Plugin, I added a fix there: appsbu-de/phaser_plugin_pathfinding#1
Maybe you like to add it to your setAcceptableTiles(), too.
The text was updated successfully, but these errors were encountered: