Flocking Rules

There are three basic rules for flocking behavior.

These rules are applied independently by each boid.
There is no overall, "flock-level" intelligence guiding them as a group.

Each boid is only aware of the other boids in its immediate vicinity, rather than all boids in the simulated world. The boid applies its rules based on the current positions and velocities of its neighbors.

The rules, in order of precedence, are:

The Separation and Cohesion rules will work together to bring boids into a group, without them all clumping up into the same spot.

The Alignment rule will cause the boids to move as a group.