On this page
Have you ever watched a flock of starlings sweep across the evening sky, banking and diving as a single fluid organism? It looks as if they are following a conductor, or as if each bird has memorised a detailed script. But they are not.
In 1986, a computer scientist named Craig Reynolds developed the Boids algorithm, proving that complex, lifelike flocking emerges from just three simple local rules. He created simulated bird-like objects called "boids", and his 1987 paper on the topic changed how biologists and computer animators understand collective motion. Before Reynolds, animating a flock meant manually plotting the path of every single bird. By programming a few basic constraints, he showed that a flock does not need a leader; it only requires individuals to pay attention to their immediate neighbours.
What are the three simple rules?
Reynolds programmed each boid to obey three distinct steering forces, calculating its next move based purely on the boids visible in its immediate vicinity:
Separation: Steer to avoid crowding local flockmates. If a neighbour gets too close—crossing into a designated personal space—the boid turns away. This force prevents the flock from collapsing in on itself and crashing.
Alignment: Steer towards the average heading of local flockmates. The boid constantly updates its velocity to match the speed and direction of its neighbours. This allows the flock to travel forward as a unified group, smoothly turning in parallel.
Cohesion: Steer to move toward the average position of local flockmates. This acts as the "social pull". Every boid tries to move towards the centre of mass of its local group, ensuring the birds do not wander off alone.
When all three rules operate at once, the boids flock perfectly. They can split around an obstacle and rejoin seamlessly, providing a classic example of emergent behaviour—where simple local interactions produce incredibly complex global patterns. The algorithm was so successful that it was famously used to animate the bat swarms and armies of penguins in the 1992 film *Batman Returns* using the original model.
What happens when you switch a rule off?
To truly understand an emergent system, you have to break it. The magic of the algorithm comes from the tension between the forces: cohesion pulls them in, separation pushes them out, and alignment keeps them moving. When you switch off one of the three rules in a boids simulation, the flock instantly loses its lifelike quality and collapses into predictable, unnatural motion.
Without separation, you get a singularity
If boids obey alignment and cohesion but ignore separation, they lose their sense of personal space. Because they are all trying to reach the exact centre of the group, and nothing stops them from overlapping, they will eventually collapse into a single, highly dense point. They stack on top of one another, appearing as one very bright bird tracing a path across the screen.
Without alignment, you get a static swarm
If you switch off alignment, the boids will try to stay close to each other due to cohesion and avoid collisions through separation. However, they will not agree on which way to go. The flock turns into a chaotic swarming ball, much like a cloud of gnats or a school of startled fish. The individuals mill around rapidly in a tight circle, but the group as a whole does not travel anywhere.
Without cohesion, the flock dissolves
If boids steer to avoid collisions and match headings, but do not try to stay near the centre of mass, the flock fragments. A slight turn or random deviation by one bird is no longer corrected by a social pull. The boids slowly drift away from the main group. You might see small lines of birds flying parallel to each other for a while, but eventually, the sky is full of isolated individuals that never unite.
Why does this matter for learning?
The boids algorithm is not just a trick for movie special effects; it is a profound lesson in how animal behaviour and complex systems work. Biologists now use similar models to study how schools of fish evade predators and how ants build bridges, proving that you do not need central planning to create highly effective order.
However, emergent behaviour is notoriously hard to grasp just by reading a list of rules. The human brain struggles to predict how interacting forces will balance out in real time. If you want to see how these forces interact and exactly how bird flocks move with three simple rules, you can adjust the algorithmic sliders yourself in the Fermi Simulation Lab. Dropping the alignment slider to zero and watching the flock instantly turn into a chaotic swarm makes the physics stick in a way that text alone cannot.



