Hub

Boids Flocking

Birds 0
Lined up 0%

Tap = predator ยท drag = wall

How to play

  1. Watch: the birds start scattered. Within seconds they form flocks.
  2. Tap the sky to drop a predator. Drag to draw a wall.
  3. Turn on Show one bird's view, then play with the three rule sliders.
Do thisPhoneKeyboard
Drop a predatorTap the skyArrows, then Enter (on the sky)
Draw a wallDrag on the skyArrows, then W (on the sky)
Remove predators + wallsClearC
Show one bird's viewThe toggleV
Play / PausePauseP
Scatter the birdsScatterS

What's happening?

  • No bird is the leader, and none can see the whole flock. Each one only looks at birds inside its vision circle.
  • Separation: "too close! move away."
  • Alignment: "fly the same way as my neighbours."
  • Cohesion: "don't get left behind: head for the middle of my neighbours."
  • That's it. Nobody plans the flock. It emerges from lots of simple local rules, like real starlings, fish and ants.
  • The lined up number shows it: 0% means every bird flies its own way, 100% means all one way.

Try this: turn Cohesion down to 0. What happens to the flocks? Now put it back and turn Alignment to 0 instead. Which rule makes a flock a flock?