Boids Swarm — Flocking & Emergent Behavior
Comprehensive notes, formulas, and practice questions for Boids Swarm — Flocking & Emergent Behavior.
Boids Swarm — Flocking & Emergent Behavior
Boids Swarm — Flocking & Emergent Behavior
Core Idea
Boids (Craig Reynolds, 1987) shows that realistic flocking behaviour — birds, fish, drones — emerges from just three local rules applied independently by every agent. No global controller, no leader, no shared map. Each boid only perceives neighbours within a fixed radius and acts accordingly.
Key Formula / Algorithm
For a boid with position and velocity , the three steering forces are:
Separation (avoid crowding, radius ):
Alignment (match neighbours' heading, radius ):
Cohesion (move toward group centre, radius ):
Net steering:
How It Works (Step by Step)
- For each boid, find all neighbours within the perception radius.
- Compute the three steering vectors independently.
- Blend them with tunable weights , , .
- Add the net steering force to the current velocity; clamp to a maximum speed.
- Update position: .
- Repeat for all boids every frame — emergent flocking appears instantly.
Real-World Application
Boids logic controls crowd simulation in films (Lord of the Rings battle scenes), drone light shows (Intel's 2000-drone displays), multi-robot search-and-rescue teams, and traffic flow simulation. The rules are so simple they run on microcontrollers in real robot swarms.
Quick Check
- If you set the separation weight but keep alignment and cohesion, what behaviour do you expect?
- Why is the Boids model called an example of emergence? Could a central controller produce the same result more simply?
Key Takeaways (TL;DR)
- Core Idea
- Key Formula / Algorithm
- How It Works (Step by Step)
- Real-World Application
Master this topic with Drishti OS
Get unlimited mock tests, AI-powered mentorship, and complete video courses when you join.
Start Free Practice