RTS game issues

Hello I have recently started using the A* Pathfinding as our pathfinding solution.
We are using the grid shape and our map size is 1000X1000 units (might get to 1500X1500 in the future).
Because our game is an RTS with base building we need the grid to be dynamic (placing objects will remove parts from the grid and some towers will have stairs and be walkable) and support up to 300 units
(monsters and soldiers) at any time.

I have a few questions:

  1. is there a better grid shape (maybe more than one) to meet our needs?
  2. In our game we place buildings on the grid and we use the api to cut the grid so units wont be able to go through the buildings, from time to time we get this result:

    For some reason squares are going up and stays there as a walkable part (all the building are using boxcolliders).
    Is there a way to fix that problem? some paths are getting calculated through the squares and we get this result:

    Thank you in advance :slight_smile:
1 Like

Update: increasing the Erosion iterations did the trick and made the bug disappear :slight_smile:


Another solution which I would recommend more is that you only add the house as an obstacle, don’t include it in the height testing mask. That will make all nodes end up on the ground instead of on top of the building’s roof. It should be a lot more robust and you wouldn’t need to change the erosion radius.