4 - 8 - 16 Direction AStar Pathfinding #1331
Replies: 4 comments 6 replies
-
Hi @AlmasB, I'm currently working on the Pathfinding side of things. I want to point out that I'm considering the extension of CellState to allow more states that would better fit multiple scenarios (mostly) related to RTS games. In certain games, you'll see units able to float over water (only) and/or be able to walk. This means that the "AStarGrid" CellState system need to consider "acceptable states" to find a suitable path. I'd love to "improve" the Engine and let everyone profit from these changes. I can't make any promises, but I think that I should work directly into the FXGL AStar section of the Framework. Here are some items that I'll need to cover (required):
|
Beta Was this translation helpful? Give feedback.
-
@AlmasB , Now that I use the (not yet accepted) eight directions pathfinding, I realize that their are significant investment required on that field to allow RTS gaming pathfinding. I will need to end up with a highly performant and flexible pathfinding solution within the next 1-2 months. I'm currently heavily concerned about the capacity to have these changes integrated in the FXGL itself. I'll do the directional support change. Then, I'll evaluate where the pathfinding improvements will be pushed. |
Beta Was this translation helpful? Give feedback.
-
@DeathPhoenix22 please see below
This should probably have an extra
Sorry, I am not sure what a bi-directional search is in this context. Does this mean, given cells A and B, we do a search from A to B and B to A at the same time? Is this a performance-only change?
Could you clarify what these 16 directions are? In terms of the grid data structure, I can only visualise a cell having 4 directionally adjacent and 4 diagonally adjacent cells.
I am not worried about optimisation at this stage, so I'd prefer to avoid any code that explicitly focuses on optimisation. Once we design the API and then implement its functionality, we can start looking at ways to optimise as a separate PR, if required. |
Beta Was this translation helpful? Give feedback.
-
Hi @AlmasB , |
Beta Was this translation helpful? Give feedback.
-
Hi @AlmasB ,
I've looked at the AStar pathfinding implementation and noticed that it's 4 directions restricted.
I looked at a way to adjust the current implementation and faced that fact (it's happening a lot, I must admit) that most of the Framework is Final protected.
As I can't use OO inheritance to extend behaviors, I need to redo the Pathfinding in my project or modify the existing Pathfinding directly in the Framework.
Should I do it in the Framework or redo it in my project? :( ? I also can't use inheritance to create extended Grid systems (I would normally have 3 classes, one for each type -> 4, 8 & 16 direction Grids where I would use inheritance to extend the "getNeighbors" for example, but inheritance doesn't seem to be a choice in that Framework as almost everything is Final)
Thanks for the guidance !
Jean-René
Beta Was this translation helpful? Give feedback.
All reactions