Flock

 
Flock Behavior (beFlock) applies basic flock navigation forces to entities. Its parameters defines boids characteristics and a link to the Flock Locator.
Flock behavior in the behavior editor

For more information on flock in Golaem Crowd, see Flock Locator

To use a Flock Behavior, a Flock Locator is mandatory. A Flock Behavior uses the Flock Locator attached to its related CrowdField.

To define a goal for the flock, see Steer.

Even without Steer Behavior, each boid will move in its current direction, and according to its neighbors (some flocking forces are applied). 

Additionally, boids going outside of the Flock Locator radius will tend to come back inside this radius.

CREATION

  • Behavior Editor / Behavior Library: 
  • Golaem Menu: Crowd Behaviors / Behaviors / CrowdBeFlock Node
  • MEL command: glmCrowdBeFlockCmd;

CONFIGURATION

A Flock Behavior defines the following specific attributes. For common attributes see Behavior Common Attributes.

Flock Behavior Attributes

attributes of a Flock Behavior

A boid is an entity, as produced by population tool. It is called boid here to comply with usual flock algorithms wording .

Each boid has 3 main charateristics : mass, max speed and max force. 

Each of this parameters can be randomized between a lower and an upper bound, or set via a per particle attribute (See ppAttributes Handling).

Boid Mass Min

Boid minimum mass if randomized (if no PPName)

Boid Mass Max

Boid minimum mass if randomized (if no PPName)

Boid Mass PPName

If the boid mass is randomized, let empty. Else this field holds the name of the per particle attribute used as mass.

Boid Max Force Min

Boid maximum force lower bound if randomized (if no PPName)

Boid Max Force Max

Boid maximum force higher bound if randomized (if no PPName)

Boid Max Force PPName

If the boid maximum force is randomized, let empty. Else this field holds the name of the per particle attribute used as maximum force.

Boid Max Speed Min

Boid maximum speed lower bound if randomized (if no PPName)

Boid Max Speed Max

Boid maximum speed higher bound if randomized (if no PPName)

Boid Max Speed PPName

If the boid maximum speed is randomized, let empty. Else this field holds the name of the per particle attribute used as maximum speed.

Weights Attributes

The weight attributes determine the global look of a flock (swarming, flock, etc). 

Steering Flocking Ratio

If 0, the boid will only use its steering value, ignoring flocking behavior with other boids.

If 1, the boid will form a flock but will ignore the steering force of any beSteer.

Any value between those 2 values will blend the two forces, default to 0.8 (a little of steering, mainly flocking).

Separation Weight Weight given to the separation force from the neighbour boids. Higher values lead to a bigger flocking volume
Alignment Weight Weight given to the alignment force : with high values, the boids will tend to align strongly in a single flow. With low values, the flock will behave more as a bees swarm, going in all directions.
Cohesion Weight Weight given to the cohesion force : with low values, you will have numerous small boid groups. With high values, the boids will behave more as a "single packed" entity.

Advanced Attributes

A few options on the orientation management of the flock

Time To Align Up

This value forces the entity to come back to a vertical up in a given time, when the boid does not have any force keeping it turned. This avoids birds flying straight, on their back, because they rolled at some point.

Bank Amount Gives the bank (roll) response speed to turns : a higher value gives a faster bank, boids will then tend to roll easily. Lower values prevent them from rolling easily.
Maximum Y/Up Angle This prevent a boid to reach a up direction having a greater angle with (positive) vertical direction. By default 180 degrees will allow any orientation, but one may restrain it to "believable orientations" for some usage, such as non-acrobatic planes .

Stopping Duration Attributes

The Starting / Stopping Duration value determines the time (in seconds) during which the flock goes from fully active to inactive. This time can be used to transition smoothly between two behaviors.

Stopping Duration Mode

This attribute allows a choice of two modes :

  • Random: Randomly set the Stopping Duration value between the specified "Stopping Duration Min" and "Stopping Duration Max" bounds (this attribute is influenced by the random seed of the Crowd Manager)
  • Per-Particle Attribute: Use the "Stopping Duration Name" attribute to get the name of the float per-particle field of the relative particle system.

The Stopping Duration value is in seconds.

Stopping Duration Min See Random option of the Stopping Duration Mode above
Available only when the Stopping Duration Mode is set to "Random"
Stopping Duration Max See Random option of the Stopping Duration Mode above
Available only when the Stopping Duration Mode is set to "Random"
Starting / Stopping Durationpp Name Name of the float per-particle field of the relative particle system, containing the Stopping Duration Mode value which will be used (for more explanation about how to use ppAttributes, see ppAttributes Handling)
Stopping Duration value is set to 0 if the ppAttribute name is empty or invalid
Available only when the Stopping Duration Mode is set to "Per-Particle Attribute"