Lightweight Local Avoidance Simulation

Example scene which demonstrates local avoidance without any pathfinding and minimal rendering.

This example scene demonstrates how to use local avoidance without any movement scripts, pathfinding, GameObjects, or any other overhead that is not strictly necessary for local avoidance. It is useful if you want to gauge the performance of the local avoidance system without any other systems interfering.

The scene contains the LightweightRVO component, which allows you to simulate between 10 and 30,000 agents in various configurations.

The agents can be configured with different goals:

  • Circle: Agents are spawned randomly in a circle and try to reach the opposite side of the circle.

  • Line: Agents are spawned in two parallel lines and try to reach the corresponding point on the other line. This goal works best with fewer agents.

  • Point: Agents are spawned randomly in a circle and try to reach the center of the circle.

  • Random streams: Agents are spawned randomly in a disc and try to reach another random point.

  • Crossing: Agents are spawned in a star pattern and try to reach the point on the opposite side of the center. This goal works best with fewer agents.

The LightweightRVO component uses the Entity Component System to create one entity for each agent. Then it uses two custom systems to move the agents and to render them into a single mesh. It also uses the already running RVOSystem to simulate the local avoidance. It works very much like the FollowerEntity component, but with a lot less complexity for movement and pathfinding.

See

Local Avoidance for more details about local avoidance