Flocking
Three steering rules with no leader produce the coherent motion of a flock.
Introduction
Each bird steers by three local urges: avoid crowding nearby flockmates, align with their average heading, and steer toward their average position. None of them sees the whole flock, yet smooth, leaderless flocking motion emerges across the entire group.
Background
Craig Reynolds introduced the Boids model in 1987 to generate lifelike flocks for computer graphics. Its three rules, separation, alignment, and cohesion, became the standard account of how collective motion arises without central control, and have been reused everywhere from films to swarm robotics.
How it works
- Each bird looks at the flockmates within its vision range.
- Separation: turn away from any that are too close.
- Alignment: turn toward the average heading of those neighbours.
- Cohesion: turn toward their average position.
- Combine the three turns, step forward, and repeat.
Parameters
population- How many birds share the world.
vision- How far each bird can sense flockmates. Wider vision binds the flock more tightly.
min_separation- The distance below which birds steer apart, preventing collisions and clumping.
max_align / cohere / separate_turn- Caps on how sharply each urge can turn a bird, which balances the three behaviours against each other.
Open this model in the editor →