REF · CLASSIC MODEL

The Boids ModelFLOCKS FROM THREE LOCAL RULES

Craig Reynolds, 1986 — three rules that look only at neighbours, and a whole flock's motion comes out

Cited in: Topic 13 Self-Organization

01The Question It Poses

A flock of starlings turns with absurd precision; a school of sardines under attack moves like a sheet of cloth being shaken. The two easy explanations are: there is a leader, or they somehow sense each other. High-speed film killed the first one long ago — a turn can start from any side of the flock, and within the same minute the same flock starts turns in different places.

What Craig Reynolds was actually trying to solve in 1986 was an animation problem: how do you put a flock in a film without drawing every bird in every frame. He wasn't after an explanation, he wanted a minimal set of rules that produced the footage. The rules ended up answering the biology question on the side — this kind of coordination needs no global information at all.

02The Rules

  1. Each individual is a boid, with a position and a velocity. It can only "see" neighbours in a small region around it.
  2. Separation: if a neighbour is too close, push away from it.
  3. Alignment: steer your velocity toward the average of your neighbours' velocities.
  4. Cohesion: drift toward the average of your neighbours' positions (their centroid).
  5. Each rule gets a weight; the weighted sum is this frame's acceleration. Add a maximum speed and a maximum turn rate.
  6. That's all. No global variables, no leader, and no boid that knows what the flock looks like.

Rule 1 deserves a second look: "who counts as a neighbour" is itself a modelling choice, not a neutral implementation detail. Reynolds used "within radius r and not in the blind zone behind me", which is a metric neighbourhood. Section 4 shows that real birds may not use that one.

A boid knows two things: who counts as a neighbour, and where each rule wants it to gorgreen = counted · outside the radius or in the blind zone = not countedblindSeparationAlignmentCohesionweighted sum of the three= this frame's accelerationThree weights — change them and the flock's shape changesThere is no 'flock' object in the code — each boid just does this one addition per frame
The entire world of one boid: a few neighbours, three competing demands, weighted into this frame's acceleration.

03What You See When It Runs

Scatter boids at random and within seconds they gather into a flock. Hit an obstacle and the flock splits around it, then closes up on the far side — there are no "split" and "close" instructions in the code; they are consequences of the three rules.

What's more worth watching is the turning: one boid moves first, its neighbours adjust, and it passes to the next ring out. A turn sweeps across the flock like a wave, and much faster than "every bird watches the leader and reacts" would allow, because it is a relay rather than a broadcast.

Treat the three weights as knobs and the same code gives three completely different macroscopic shapes: heavy separation and the flock is as loose as a gas; heavy cohesion and it balls up; heavy alignment and it stretches into a tidy migrating band. The macroscopic shape is a function of the parameters, not a specified goal.

Same rules, only the ratio of the three weights changes① separation heavyloose, like a gas② cohesion heavyballs up③ alignment heavystretches into a migrating bandThe macro shape is a function of parameters — no code describes 'gas', 'ball' or 'band'
The same rules, only the ratio of the three weights changed. No line of code describes "gas", "ball" or "band".

04What It Explains

The most important thing it establishes is negative: it removes "must have a leader, must have global perception" from the list of necessary conditions. Before boids, collective coordination was assumed to require something centralized. After boids, what needs explaining is the opposite — if centralization isn't necessary, why do some groups have leaders anyway?

The positive uses are straightforward and mostly in engineering: drone formations, crowd-evacuation simulation, group animation in games and film (the bat swarms in Batman Returns in 1992 were among the first large-scale uses).

It also yields something measurable. If individuals only watch their neighbours, information should propagate through the flock as a wave, and that wave's speed can be measured. Attanasi et al. measured exactly such turning waves in starling flocks in 2014, and found they decay remarkably slowly — which is what "only watch your neighbours" predicts, and not what "everyone reacts independently" predicts.

What It Cannot Explain

Further Reading