Every bird follows three rules, looking only at the birds near it: don't crowd, fly the way they fly, drift toward the middle. Nobody leads and nobody knows the shape of the flock, yet the flock appears.
Move your pointer over the sky and you become a hawk: the flock splits around you and closes up behind. Switch it to food and they gather. Then take the rules apart one at a time. Turn alignment to zero and the flock becomes a buzzing cloud of gnats. Turn cohesion to zero and they drift apart into loners. Narrow the field of view and long, wavy lines form, each bird following the one in front. The orange bird shows what one boid can see: the slice of sky in its view, and a line to every neighbour it is listening to.
In 1986 Craig Reynolds, a computer graphics researcher, wondered how flocks of birds manage to move as one with no leader. His answer, published at SIGGRAPH in 1987 as Flocks, Herds, and Schools, was that each bird needs only three local rules. He called his simulated birds "boids", short for bird-oid objects. They went to the movies: the swarming bats and marching penguins of Batman Returns (1992) were boids, and in 1998 Reynolds received an Academy Award for his work on them. Real starlings turn out to work much the same way: studies of murmurations found each bird keeps track of about seven of its nearest neighbours.