Boids (Flocking) Screensaver
Boids is a free, in-browser flocking screensaver where dozens of arrow-shaped agents steer themselves into lifelike murmurations. Each boid follows just three local rules — cohesion, alignment and separation — yet the flock moves as one. There is nothing to download, and you press ESC to exit.
How the Boids (Flocking) screensaver works
Every boid is a point with a velocity, drawn as a small arrowhead that points the way it is heading. On each frame a boid scans the others and only reacts to neighbors inside a fixed radius of about 56 pixels, so flocking is always a local decision rather than a global one.
From those neighbors it computes three steering urges. Cohesion pulls it toward the average position of the group, alignment nudges its velocity toward the group's average heading, and separation pushes it away from any neighbor that gets too close, weighted by how close it is.
The three urges are scaled by your slider values and added to the boid's velocity. The speed is then clamped to a maximum so no boid runs away, and the position advances by that velocity. Boids that cross an edge wrap around to the opposite side, giving an endless toroidal sky.
No single boid is a leader. The swirling, splitting and reforming murmurations you see are emergent — they arise purely from many agents each obeying the same three simple rules at once.
A worked example
At the defaults — Boids 90 with Cohesion 5, Alignment 5 and Separation 5, Speed 4 — ninety arrowheads cruise at a capped pace and form loose, drifting bands. Because all three forces are balanced, the flock stays cohesive without collapsing into a clump. Turn off Motion trails (the default) for crisp arrows, or enable it to leave fading streaks behind each bird.
Settings & tips
- Raise Separation toward 10 to spread the flock into airy, well-spaced formations; lower it to watch boids crowd together.
- Push Alignment up for tight, synchronized streams, or drop Cohesion to let the flock scatter into independent wanderers.
- Turn on Motion trails for comet-like tails, and use the Color and Background swatches to set the palette.
Frequently asked questions
- What is a boids flocking simulation?
- Boids is a model where simple agents follow cohesion, alignment and separation rules to produce lifelike flocking. It was devised by Craig Reynolds in 1986 to mimic bird and fish movement.
- Is the boids screensaver free to use?
- Yes. It runs free in your browser with no download, plugin or sign-up required.
- What do cohesion, alignment and separation do?
- Cohesion pulls each boid toward its neighbors, alignment matches their heading, and separation keeps them from colliding. Balancing the three produces natural murmurations.
- How do I exit the boids screensaver?
- Press the ESC key at any time to return to the page. Any key press or mouse movement also exits.
- How many boids can I show at once?
- The Boids slider ranges from 20 up to 200 agents, so you can keep the flock small and readable or fill the screen with a dense swarm.