Watch a starling murmuration and it looks choreographed — thousands of birds folding and swirling like one animal. There is no leader, no plan, no signal. Every bird follows three tiny rules about its neighbors — and the flock emerges. That's the whole trick, and you can build it in an afternoon.
press play — 90 seconds ↓Plays like the video — one caption at a time, the picture animating under it — and it pauses when it's your turn. Skip around with the dots or arrow keys. The full lab comes after.
Craig Reynolds figured this out in 1986 and called his birds boids. Each boid looks at the neighbors it can see, feels three separate urges, and blends them. "Blend" here means exactly what it meant in chapter 02 — a weighted sum. Weighted averages, all the way down:
In every demo below, the green boid is "you", the yellow circle is how far you can see, and the white triangles are the neighbors inside it. Each rule turns those neighbors into one force vector — nothing more.
Every frame, every boid finds its neighbors, computes the three forces, blends them with your weights, and moves. That's it — the schooling, the splitting, the swirling are not programmed anywhere. Click any boid to x-ray it: its perception circle, its neighbors, and its three live force vectors (red = separation, violet = alignment, yellow = cohesion).
The video's underwater shots are this exact sim — the same three rules, running in a 3D volume. One fish is highlighted green with its perception bubble. Orbit through the school like a diver.
Click any moment on the right — it takes you straight there (in place when this site is served over http, on YouTube when opened as a local file).