Flocking System

Flocking Behavior


General

Flocking system allows agents mimic the orientation of a group of nearby agents and achieve the flocking behavior, this can be highly frequently used in animals simulation like birds, fishes or sheep.


Instructions

We can enable the flocking behavior directly in 

Output > Direct Logic > start flocking behavior priority 1

And usually (if we're working are 3d creatures like fishes or birds) we need to enable:

Output > Direct Logic > I'm 3d creature


Orientation

Your creature will detect the near agents using its sphere range.

It will automatically calculate the average orientations of all agents in its sphere and rotate to that orientation.

sphere range detection

Convergence

Also, they will try to gether together if the agents 

And the converge speed can be controlled by the output language:

Output > Direct Logic > set flocking cohesion speed:?? priority 1

(Range: 0.0 - 1.0)

auto convergent (notice the 2 selected fishes turn into group)

Repel

We are not providing the logic for repel the agent, we can directly use the auto avoid with sphere range Automatic Collision Avoidance.

So for changing the distance of avoid, we can change the sphere range and smallest radius ratio on Agent group node.

auto avoid by sphere range