animal motion
Bird Flocking
Formation
Geese, ibises, pelicans fly in a V. No bird decides the shape. Each follower just wants the energy-saving sweet spot behind its nearest neighbor, offset a little to one side, where the leader's wingtip pushes air upward. Do that together and the V appears.
source notes
Model level and refs
- Boids steering rules follow Reynolds 1987. Separation, alignment, cohesion are faithful; all weights are tuned for visual legibility, not measured bird behavior.
- The slipstream sweet-spot is a simplified stand-in for the wingtip-vortex upwash. In real flocks the zone is 3D and depends on wing geometry; here it's a 2D offset behind the leader's heading.
- Energy savings from formation flight were measured empirically by Portugal et al. 2014 in northern bald ibises. Our drag-reduction multiplier is illustrative, not calibrated to those numbers.
- Birds are rendered as 2D chevrons on a wrapping canvas. No altitude, no bank angle, no flapping phase.
deeper dive
How a flock finds the V without a leader
A skein of geese draws a V across an autumn sky. Every kid who has seen this asks the same thing: who's in charge? The honest answer is no one. A flock has no route planner, no shape committee. Each bird knows only what its immediate neighbors are doing and where the air feels easiest to fly through. That second part, the feeling of the air, turns out to be enough.
When a bird flaps, its wingtips shed a pair of spiraling vortices. Behind and slightly outside each wingtip the air is pushed upward. A second bird that drops into that upwash zone gets a small lift for free. Over hours of migration, free lift adds up. A 2014 Nature paper measured northern bald ibises flying in formation and found they time their wingbeats to match the upwash of the leader. That timing is the clue: formation flight is not folklore, it's a live optimization running inside each bird.
The rule each bird is running
In this simulation every bird follows four rules. Three of them are the classic boids model from Craig Reynolds, 1987: stay out of your immediate neighbor's personal space (separation), point roughly the same way as the birds around you (alignment), and drift toward the local average position (cohesion). The fourth rule is the new one: find the upwash sweet spot. Each bird picks its nearest forward-flying neighbor, then steers toward the point that is a short distance back and offset to one side of that neighbor's heading. Half the birds prefer the left side, half the right, picked at spawn. That asymmetry is what lets a V emerge instead of a straight single-file line.
The payoff is encoded as a drag relief. When wind is high the whole flock feels a constant leftward push, which pulls every bird's forward speed down. But a bird sitting near a neighbor's upwash sweet spot gets up to 75 percent of that drag removed. Formation flight costs less speed, so the system rewards birds that find the shape and punishes stragglers.
Why this model is simpler than reality
A real wingtip vortex is a three-dimensional structure that decays and drifts in ways a 2D simulation cannot capture. The real sweet spot also moves with every wingbeat phase. Actual ibises shift their timing by a few tens of milliseconds to stay on the rising half of the vortex. None of that is in this model. The slipstream zone here is a single 2D target point with a radius. The drag relief is a scalar. The whole thing is a mechanism sketch, not a flight simulator.
That's the point. The goal isn't a faithful bird, it's the emergent shape. Strip the mechanism down until one rule is legible, then watch what the rule produces. Everything else is removed on purpose. The source notes above list the specific simplifications.
Where the same pattern shows up elsewhere
The underlying move, many selfish optimizers sharing an environment where one agent's choice makes the next agent's choice cheaper, is everywhere in systems where coordination looks planned. The ant colony simulation on this site runs on the same principle with a different substrate: pheromone trails instead of air currents, but the same feedback loop.
- Cycling pelotons. Each rider saves 25 to 30 percent of the power cost by drafting. The diamond and double-paceline shapes that emerge in a long breakaway are not taught; they fall out of everyone trying to sit in someone else's slipstream.
- Highway traffic. Trucks travelling long distances self-organize into rolling platoons. The trailing truck saves fuel, the leading truck rotates back when it wants relief. No dispatcher arranges the platoon.
- Packet routing. Network routers send traffic down paths that are currently cheap. A path that delivers fast attracts more packets, which reinforces its route tables, which attracts more packets still. The same feedback loop, different substrate.
- Formation dance and marching bands. Choreographed ones are imposed from outside. But crowd-sourced ones, a flash mob or a spontaneous stadium wave, run on the same local-neighbor logic as the birds above.
In all of these the shape is the fingerprint of a rule, not a plan. Change the rule and the shape changes with it.
Things to try
Push wind to zero and leave the slipstream weight high. The V loosens into a blob. Without an energy incentive, the formation was only a weak preference. Now push wind back up. Within a second or two the V sharpens. That gap is the whole biological argument condensed into one gesture: V-formation is a response to the cost of flying through air, not an aesthetic choice. Drop slipstream weight close to zero while keeping wind high. The flock stays together (cohesion is still on) but no longer arranges itself, and individual birds fight the wind alone. Finally, raise flock size past 80 and watch a second V start to form behind the first. The rule scales. Browse the full simulation library for other systems built on the same template: simple rules, many agents, shape as a fingerprint.