Hi Aron,
I’m making a level with many destructible obstacles (walls), arranged on a tile grid. Our AI programmer is using AStar’s Grid Graph for pathfinding. We currently have to compromise on a grid size that is small enough to recognize doorways/openings, but not too small because it affects performance. The end result is not ideal.
We want to place walls on tile edges, keeping the grid-to-tile ratio 1:1. An “unwalkable” tile is blocked in all four cardinal directions. A wall blocks any given tile in one cardinal direction.
Our map editor draws walls on the seams between map tiles. Each tile keeps track of which sides are blocked by a wall with an array (e.g. tile.isBlockedNESW[true, true, false, false]
). When a wall is destroyed, the tile updates which sides are blocked.
We want to connect this to AStar’s Pathfinding. In theory, we would check a neighbor tile’s isBlockedNESW
array (instead of the tile itself) to determine if the AI’s path can travel in a given direction.
As you are the creator of this awesome AStar asset, I would love to get your perspective:
- Is what we’re trying to do completely crazy?
- If not, how could we get AStar working with our project?
- Do you have any other input?
Much appreciated,
- Marcus