A few questions/issues: hugging walls, getting caught on corners, stalling

I am using a layered grid graph with some robot drones that fly around and am running into a few issues with my implementation.
Settings: Layered Grid Graph, erosion iterations 1, agents using Seeker class with AIPath, Funnel modifier, and RVO Controller.
I listed a few questions/issues I’ve run into below:

  1. As you can see in the picture, the bots seem to hug the walls when going down the hallway. Is there anything besides increasing erosion that would make them tend to not stay on the nodes at the walls? The reason I prefer not to use erosion higher than 1 is because I use the “stay inside graph” option, and when there are a lot of enemies they should fill the hallway.

  2. the bots always seem to get caught on a corner. it seems to only happen to one of them and the rest kind of bounce off of that one and make it around: https://imgur.com/a/3pAPJDq

  3. The bots go straight to the wall and then make their way to the entrance, instead of going in a straight line to the entrance, as you can see here:


    I am using the funnel modifier and not sure why they are doing this, any help would be appreciated here. I can’t seem to figure out what settings are causing this.

  4. Sometimes the bots spawn and don’t move. I check the pathfinding scripts and they are running but the end point is always the current position and it doesn’t seem to calculate where the end point is ( I checked to make sure the destination target was being set). If I pause the game and restart, rescan, or even change focus of the window like when I hit the windows key and the start menu pops up, then they start moving. Any idea what might be the root cause of this?

After posting I thought of a few things to look into and for

Is this due to the fact that layered grid graph only considers 4 neighbors? is there any way around this behavior? The player can add walls at runtime to modify where the bots go, I assumed because of the runtime modifications grid graph would be the best solution, and need layers since they can build whatever structure they desire, but the 4 connections may cause some issues with realistic behaviors. Do you think layered grid graph is the best solution?

  1. I looked and saw that there are some OnDrawGizmos calls to FindComponents, which I assume is what is changing the behavior when leaving and re-entering the screen. I will see if calling this a bit later will solve.
  1. See Navigation costs - Get units to walk along roads like humans
  2. Looks like you have a too high ‘pick next waypoint distance’ set on your agent.
  3. You can try using the RaycastModifier together with graph raycasting enabled and physics raycasting disabled (see https://arongranberg.com/astar/docs/modifiers.html).
    This is partially due to the layered grid graph only supporting 4 neighbours though. In the current beta it supports 8 neighbours (see https://www.arongranberg.com/astar/download).
  4. I’m not sure what could cause that. Are you getting any path failed messages? Are you adding any components to the agent dynamically?
  1. Okay, that’s what I was afraid of. I will see how it works with my implementation, although I am expecting that when the bot density starts to go up it will appear that they are trying to pack into the middle during their travel down the hallway instead of uniformly so I may need to brainstorm a solution on top of that as well.
  2. Thank you. I will try a lower value. Currently it is at 2.
  3. I will download the beta as I see you mention that the raycast modifier is more expensive than funnel + grid graph. so far the grid graphs have been very efficient so I’m assuming the 8 neighbors isn’t too bad.
  4. It seems to happen when I respawn a bot from an object pool. I put GetComponent().FindComponents(); in the reset function and it seems to fix the issue.

Thanks for your help.