Miarmy Crowd Simulation Documentation (English)

Automatic Collision Avoidance

114 Auto Avoid Each Other (Go to Video Tutorials)


Introduction

As we mentioned before, if we want our agents to avoid each other, we usually need the "sphere" logic to achieve that (Detection Range Sphere)

But in some case we want to simplify this process, in below cases, we can ignore the slipping on the feet (or no feet):

  • Shot is very far (agent number also very high)
  • 3D space (like birds or flying animal)

After version 2.5, we provided the Auto Collision Avoid tool which can make our agents avoid each other automatically without any setup.
The smallest radius
Before talking about the auto avoid, there is a very important concept need firstly clarify. It is the smallest radius.
Each agent has a radius range, if other agents in this range, the agent will push out other agents a little bit, and this range called "smallest radius". That's the closest distance the agent can bear other agents.
The smallest radius can be calculated by:



Agent Smallest Radius = Agent Sphere Radius * Smallest Radius Ratio

  • The agent sphere range is a native range existed in each agent
  • The smallest radius ratio is a value located on each Agent Group Node, and the default value is 0.5

So by default the smallest radius of agent is the HALF of the sphere radius. The reason we setup the HALF of the sphere range as the default, because:

  • We want the sphere logic also worked in some cases so that we can blend auto avoid with the sphere logic, and make behavior better
  • Sphere range usually bigger than the agent body, so we need shrink it down a little bit.


Instructions

The only things we need to do are:

  • Make sure the sphere range and smallest radius setup correctly, for example the bird like this, you can select the agent and check the sphere range circle of it.


Select and see the sphere range


  • Open the auto avoid in the Miarmy Global and adjust the push speed



Open auto avoid and adjust the push speed


The Push Speed
The push speed means the percentage the current agent push other agents outside the smallest radius. Like the following 2 pictures shown, the first case is 1 (100% per frame), that is means push the other agent out directly from the smallest radius in a single frame.



Push speed is 1 (100% per frame)


The second case is 0.5 (50% per frame), that is means push the other agent out from the smallest radius 50% each frame and after 4~5 fames, the other agents will be pushed out, the whole process is smoothly.



Push speed is 0.5 (50% per frame)


Our default value is 0.3 (30%) and that is a smooth setup, if you want to use 1(100%) there might be some jitter in some cases.




Basefount Technology