Boids Flocking Screensaver
The Boids Flocking screensaver runs Craig Reynolds' real classic Boids algorithm live — separation, alignment and cohesion producing genuine emergent flocking behavior. It is free, runs in your browser, and ESC exits.
How the Boids Flocking screensaver works
Each boid follows three real, simple local rules every frame: steer away from nearby boids that are too close (separation), match nearby boids' average heading (alignment), and steer toward the local flock's center (cohesion).
No boid has any real global knowledge of the flock — every movement comes purely from these three real local rules applied to its nearest neighbors.
The real combination of these simple local rules is exactly what produces flocking, swirling and splitting behavior that looks far more complex than the rules themselves.
The simulation runs continuously, with the flock genuinely reorganizing itself in response to its own real internal dynamics.
Craig Reynolds and artificial life
Boids were created by the computer graphics researcher Craig Reynolds, whose paper "Flocks, Herds, and Schools: a Distributed Behavioral Model" appeared at SIGGRAPH in 1987. Reynolds wanted a way to animate flocks and schools without keyframing each creature, so he gave every simulated creature, a boid, a small set of local steering rules and let the group motion arise by itself.
The three rules are separation (avoid crowding local flockmates), alignment (steer toward their average heading) and cohesion (steer toward their average position). Each boid reacts only to flockmates inside a neighbourhood defined by a distance and an angle from its direction of flight, which can be read as limited perception. Weights on each rule decide the character of the flock, and many implementations add extras such as obstacle avoidance or a goal, and wrap around the screen edges.
The model is a classic example of emergence, where global patterns come from local interaction. Reynolds' page describes Batman Returns (1992) as the first film to use the boids model, for its bat swarms and penguin flocks. Boids are not a faithful model of how real birds decide, though empirical work on starlings (Ballerini and colleagues, 2008) found each bird interacts with a limited number of nearest neighbours, at most seven.
A worked example
A flock naturally splits into two real groups when it swirls around an obstacle from different sides, then genuinely re-merges once alignment and cohesion pull the two groups back together.
Settings & tips
- Accent recolours the boids and their trails.
- This is the real, classic Boids algorithm by Craig Reynolds (1986), not a decorative particle effect.
- The flock runs continuously with no fixed end state — it never "finishes."
Frequently asked questions
- Is this the real Boids algorithm?
- Yes — a real implementation of separation, alignment and cohesion, the three rules from the original Boids algorithm.
- Is there any central control?
- No — real Boids has no leader or central control; the flocking is a genuine emergent result of local rules alone.
- Is a key needed?
- No — it is a pure local computation.
- Is it free?
- Yes — free, no download, in your browser.
- Where were boids first used in film?
- Reynolds' page describes Batman Returns (1992) as the first film to use the boids model, for its bat swarms and penguin flocks.
- Why do flocks split and rejoin?
- Each boid reacts only to flockmates in its local neighbourhood, so a group stretched by an obstacle or turn can divide into subgroups that may later reconnect through cohesion.
- Does the model say how real birds fly?
- It reproduces the look of flocking. Studies of starlings support the idea that birds respond to a limited number of neighbours, but real birds also depend on factors such as vision, wind and predators.