Boids (short for “bird-oid objects”) is an algorithm created in 1986 by Craig Reynolds to simulate the natural behaviour of flocking animals, such as birds, fish, or even swarms of insects. Instead of programming each boid individually, the magic lies in simplicity: boids follow three basic rules that result in mesmerising, emergent behaviour when they interact with one another.
Separation – Boids avoid getting too close to their neighbours to prevent mid-air pileups. Think of it as their personal bubble.
Alignment – Boids steer themselves to match the general direction of their local group. Peer pressure at its finest.
Cohesion – Boids gravitate toward the centre of their nearby pals, ensuring they stay part of the squad.
These rules are surprisingly intuitive, and when combined, they create the illusion of intelligent group movement. What looks like a choreographed ballet is actually chaos beautifully controlled by a handful of simple rules.
Buttons
Restart Simulation
Resets the simulation, clearing all current boids and restarting with the current settings.
Reset Settings
Restores all sliders to their default values. Use this to revert any changes and return to the original configuration.
Export Settings
Saves the current configuration of slider values to a file for future use or sharing.
Import Settings
Loads a previously saved configuration from a file, allowing you to quickly apply specific settings.
Sliders
Number of Boids
Controls the total number of boids in the simulation. Increasing this creates a denser swarm, while decreasing it results in fewer, more individualistic movements.
Movement Accuracy
Determines how closely boids adhere to their intended movement paths. Higher values produce more precise movements, while lower values introduce greater deviation.
Boid Vision
Defines the range within which boids can detect and respond to their neighbours. Larger values expand their awareness, while smaller values limit it.
Alignment Force
Sets the strength of the tendency for boids to align their direction with their neighbours. Higher values lead to more coordinated group movement.
Alignment Bias
Adds a directional bias to the alignment behaviour, influencing the overall flock’s heading in a specific direction.
Cohesion Force
Controls the strength of the boids' tendency to move toward the centre of their local group. Higher values create tighter clusters.
Separation Force
Adjusts the repulsion between boids to prevent overcrowding. A higher value results in greater spacing between individuals.
Steering Force
Governs the agility of boids, affecting how quickly they can change direction. Higher values allow for sharper turns.
Min Speed
Sets the minimum speed for the boids, ensuring they always maintain a base level of movement.
Max Speed
Limits the maximum speed boids can achieve, affecting the overall pacing of the simulation.
Drag
Simulates environmental resistance, such as friction. Higher drag slows down the boids, while lower drag allows for faster motion.
Movement Randomness
Introduces variability in the movement of boids, resulting in less predictable and more erratic behaviour at higher values.
Use the sliders to adjust parameters and observe how they affect the behaviour of the boids.
Use the buttons to manage the simulation, reset settings, or save and load specific configurations.
Experiment with different combinations of settings to explore the range of behaviours the simulation can produce.