← Iris

Flock 120
FPS 60
Flock size 120
Separation radius 30
Alignment strength 0.05
Cohesion strength 0.03
Predator speed 3.5
Predator attraction 0.04

Reynolds rules

In 1987, Craig Reynolds introduced three steering behaviors that produce realistic flocking from purely local interactions. Separation steers away from nearby neighbors to avoid crowding. Alignment steers toward the average heading of neighbors. Cohesion steers toward the average position of neighbors. No individual knows about the flock as a whole.

The predator changes everything

Adding a predator introduces a fourth force: flee. When the predator approaches, nearby boids steer away from it, overriding normal flocking behavior. This creates the dramatic flock splits seen in nature — the “wave of agitation” that propagates faster than the predator itself. The flock divides, the predator passes through, and cohesion pulls the groups back together.

Emergent splitting

The splitting and reforming of the flock is not programmed — it emerges from the interaction between flee (pushing boids apart) and cohesion (pulling them together). The balance between predator speed and flock response determines whether the predator can isolate individuals from the group — exactly the strategy real predators employ.