Boids Flocking Simulator
Simulate Reynolds boids with adjustable separation, alignment and cohesion, and measure the flocking order parameter against the random baseline to see whether a flock actually formed.
Last reviewed by the Radiatus Cloud team
Need this done properly for your business?
Radiatus delivers secure cloud, DevOps & compliance engineering.
Three local rules, no leader, no plan
Craig Reynolds showed in 1986 that convincing flocking needs only three rules applied by each individual to the neighbours it can see: steer away from those too close, steer towards the average heading of the group, and steer towards the group centre. No bird knows where the flock is going and none is in charge. The global behaviour that emerges is not written anywhere in the rules, which is why boids became the standard illustration of emergence and still drives crowd and creature animation in film.
The order parameter tells you whether it worked
Watching the screen is a poor way to judge flocking, because the eye finds patterns in noise. The honest measure is the order parameter used in the Vicsek model: average every individual heading as a unit vector and take the length of the result. It runs from zero for completely disordered motion to one for a perfectly aligned flock. Crucially, randomly oriented individuals do not score zero, they score about 0.886 divided by the square root of the population, so this tool reports that baseline alongside the measurement.
Each rule does something you can switch off
Turn alignment to zero and the order parameter stays at the random baseline no matter how long you run: the group may still clump together, but it never agrees on a direction. Turn cohesion off and the flock disperses while staying aligned. Turn separation off and everything collapses to a point. Running each rule alone is the fastest way to understand which behaviour belongs to which term.
Related tools
- Data Collection Analysis — Analyze app description to infer data collection.
- Dark Pattern Detector — Scan UX text for manipulative patterns.
- AI Risk Disclosure — Generate disclosure text for AI features.
- Maturity Radar — Generate a radar chart of security maturity.
Frequently Asked Questions
What are the three boids rules?
Separation steers away from neighbours that are too close, alignment steers towards the average heading of nearby boids, and cohesion steers towards their average position. Each boid uses only what it can see nearby.
How can I tell if a flock really formed?
By the order parameter: average every heading as a unit vector and take the length. One means perfect alignment, and randomly oriented boids score about 0.886 over the square root of the population, which is the baseline to beat.
Why do random boids not score zero?
Because a sum of N random unit vectors is a random walk whose typical length grows like the square root of N, so dividing by N leaves about 0.886 over root N rather than zero. With 150 boids the baseline is roughly 0.07.
What happens if I turn off one rule?
Without alignment the order parameter stays at the random baseline even though the boids may clump. Without cohesion the flock disperses while staying aligned. Without separation everything collapses onto a single point.
Why is the world wrapped at the edges?
Periodic boundaries let the flock travel indefinitely without walls steering it, which is what makes the order parameter meaningful. A boxed simulation measures the box as much as the flocking.
Privacy & Security
Everything runs in your browser; nothing is uploaded.
How to Use
Set the rule weights and run the simulation.
Disclaimer: This tool is provided "as is" without warranty of any kind. Results are for educational and utility purposes.