Three Rules, Infinite Complexity
In 1986, Craig Reynolds demonstrated that the mesmerizing dynamics of bird flocks could emerge from just three local rules applied to each individual agent. Separation steers boids away from close neighbors to avoid collisions. Alignment adjusts heading to match nearby flock-mates. Cohesion pulls boids toward the local center of mass. No bird needs to know the flock's global shape or direction — the collective pattern self-organizes from purely local interactions.
Emergent Phenomena
Watch the simulation and you will see behaviors no individual rule produces alone: the flock executes sweeping coordinated turns, splits smoothly around obstacles and re-merges, forms elongated streams in narrow passages, and maintains stable density despite constant motion. These emergent phenomena arise from the nonlinear interaction of the three forces. Small parameter changes can trigger phase transitions between ordered flocking and disordered swarming.
The Perception Radius
Each boid only interacts with neighbors within its perception radius — typically 3–7 body lengths in real birds. This local interaction range determines flock structure. Small radii produce many small sub-flocks; large radii produce a single cohesive mega-flock. Research on starling murmurations shows they interact with a fixed number of nearest neighbors (6–7) rather than all birds within a distance, which produces scale-free correlations across the entire flock.
From Pixels to Robots
Reynolds' boid model was first used commercially in the 1992 film Batman Returns to animate swarms of bats and armies of penguins. Today, the same principles guide drone swarm coordination, autonomous vehicle platoons, and warehouse robot fleets. The key insight is that decentralized control is inherently robust: if one agent fails, the group adapts seamlessly. This simulation lets you experience firsthand how adjusting local rules reshapes global collective behavior.