[Pure ECS] Local avoidance teleporting / movement jitter with 1000+ agents

  • A* version: 5.2.5
  • Unity version: 2022.3.22f1

I’m having a lot of agents teleporting small distances when there are around 1000-2000 agents. When I turn off local avoidance everything is smooth. I’m using pure entity system conversion of the FollowerEntity + Recast Graph. (I found and tweaked an authoring set up from this forum). Also might be important to note but this project is multiplayer and is using Netcode for Entities. I don’t really know where to begin with trying to solve this. I’ve spent days sifting through the source code and I’m just getting nowhere. Any guidance on what I could try and where I should be looking would be really appreciated.

When local avoidance is on (agentHorizon = 0.01 maxNeighbours = 10)

When local avoidance is off

This may be because maxNeighbors is too low, since they’re all so close together. This has a performance hit of course, but give it a try and see if that’s actually the cause? Aron’s example on the docs page has 1000 and 30,000 units in the two examples he posted. I’m not sure what the settings were, but this shows it’s at least somehow feasible. Give that a try and let us know how it helps or if it doesn’t, performance aside for now :slight_smile: