Hello,
I’ve been trying out A* Pathfinding for a tower defence i’m working on, and I’ve stumbled upon a few issues I need help with.
Here’s an example of what kind of tower placement I’d like to have :
In order to do this, I use the pathfinding grid to find nodes where I can spawn new towers. My towers are 2 times bigger than the grid cells, and I want it to be possible to have a 1-cell wide path between two towers.
I setup the Erosion parameter with 1 iteration, so when I spawn a tower on a specific node, all the nodes that are directly connected to it become unwalkable. But then the enemy units can’t pass between 2 towers separated by only one cell, because there aren’t any walkable nodes left.
I tried to disable Erosion and manually set nodes to unwalkable when I place a tower on it. But in that case, enemy units actually find walkable nodes between towers, and remain stuck trying to pass (they’re blocked by the geometry).
Ideally, I’d like to be able to use the same grid for pathfinding and for placing towers, but right now I can’t seem to find a way to make it work.
Do you have any ideas or suggestions ? Am I missing something ?