Flocking Modifier

Summary

This modifier attempts to emulate the flocking effect seen in bird flocks and fish shoals. It uses the rules for “boids” developed by Craig Reynolds. If you want to know more, search for “boids” on Google and you will find many references.

When using this modifier, it is strongly recommended that the emitter emits only a single pulse of particles or emits them over a short period – say 10-30 frames. If you use a continuous stream of particles, the existing particles will be influenced by the new ones being born and you will find that the flock becomes a swirling mass that doesn't really do anything.

Flock Helpers

Please also see the manual page for the Flock Helper, which adds extra functionality to the flocking system.

Interface

This modifier has the following tabs:

For the 'Groups Affected', 'Mapping', and 'Falloff' tabs, and for the buttons at the bottom of the interface, please see the 'Common interface elements' page.

Parameters

Object tab

Enabled

Uncheck this switch to disable the modifier.

Mode

Independent [default setting]

In this mode, the modifier will work in the same way as a standard Cinema 4D particle modifier: particles will be affected if they come into the field of effect of the modifier. X-Particle Actions have no effect on the modifier in this mode.

Action-Controlled

In this mode, the modifier will only act on a particle when told to do so by an Action. Until that point, the particle will not be affected, but once activated for a particular particle, the modifier will continue to influence it as long as it is in the field of effect of the modifier. The modifier's effect on a particle can be halted by means of another Action, if desired.

Add Flock Helper Object

Click this button to add a Flock Helper object to the scene as a child object of this modifier.

Note: as of X-Particles 4, this is the only way to add a Flock Helper to the scene. The object is not available from the X-Particles menus.

General Settings

Modifier Strength

This is an overall strength setting for the modifier; the lower the value, the less effect the modifier will have. Values above 100% are permitted.

Limit Speed

The tendency of the modifier is to increase particle speed in an attempt to keep the flock together. You can limit the maximum speed of the particles by checking this switch.

Max. Speed

The maximum allowed speed of the particles if 'Limit Speed' is checked.

Random Seed

You can change the seed used by the random number generator in the modifier by using this parameter.

Flock Cohesion

Cohesion Strength

This is a weighting factor which affects the flock’s tendency to stick together in a group. Increasing this will make the flock increasingly try to stick together in a small group. Lower values will allow the flock to spread out more loosely.

Flock Separation

Separation Strength

This setting controls the strength of the tendency to maintain distance from other flock members.

Separation Distance

This is the distance that individual particles will try to remain from each other. The smaller this is, the smaller and tighter the flock will become. If it is too small, you will get more of a vibration than a flocking effect; if too large, the particles will remain so far apart they don’t look like a flock.

Match Velocity

Match Velocity Strength

This is the tendency of the members of the flock to match the speed and direction of other members. The higher this value is, the more uniform the flock movement will become.

Chaotic Movement

These settings can be used to add some additional chaotic movement to the flock if it is too uniform.

Chaos Strength

The higher this value, the more chaotic the movement.

Scale, Frequency

These values alter the underlying turbulence which is applied to the movement. They have the same effect as in the Turbulence modifier.

Axis Smoothing

These settings can smooth the movement in terms of heading and pitch. The higher the value, the less variation is apparent in the movement.

Use

Check this switch to use axis smoothing.

Smooth Heading, Smooth Pitch

These settings govern the smoothing of the heading and pitch. They can be set independently of one another.

Note: if you turn both heading and pitch smoothing up to 100% you will abolish any direction change and the flocking behaviour will disappear.

Avoid Objects tab

In this tab you can set which (if any) scene objects will be avoided by the modifier.

Enable Avoidance

If this switch is checked, the objects in the 'Objects' list will be avoided by the particles. If unchecked, the particles will not avoid the objects.

Detection Distance

This is the distance in scene units at which the particle will detect that there is an object to be avoided. The shorter this distance, the closer the particle will get to the object before starting to turn to avoid the object. If you set this too low (e.g. less than the distance the particle will travel in one frame), the particle may fail to avoid the object altogether.

Object Shell

This applies a scaling factor to each object so as to create an 'invisible shell' around the object. This shell is what the particle will actually avoid. The default is 1, which sets the shell to be the same size as the object, meaning that the particles will only just avoid the object. Set to a higher number, the particle will avoid the object by a wider margin.

Avoidance Weight

The movement of the flock is a combination of various forces acting on its members (these are shown in the 'Object' tab). The requirement to avoid scene objects is another such force and is added to the overall particle direction after the various flock rules have been calculated. This parameter sets the weight which is given to the need to avoid the scene objects. The higher the value, the more 'wary' of scene objects the particles will become.

Objects

Drag the objects you want the particle to avoid into this list. You can add any kind of polygon object, or an object that would be a polygon object if it was made editable (e.g. object primitives, C4D generator objects, the Mograph cloner, etc.) but not objects without polygons (e.g. splines, lights, etc.).