Flocking Bird Simulation

GitHub Link

C#

Unity

I Developed a Unity simulation using the Boids algorithm to model realistic flocking behavior. Implemented rules for separation, alignment, and cohesion to control agent movement. Tuned parameters for smooth, lifelike group dynamics. Gained experience with vector math, Unity physics, and real-time rendering.

Separation

Each boid trys to not to fly into another boid. If it gets too close to another boid it will steer away from it.

Cohesion

Each boid want to fly towards the other boids. This is what bunches up the boids into flocks. This is done by calculating the centre of mass of all the other boids in the boids view area then steering towards this point.

Alignment

So that the boids fly around in a flock we introduce the alignment parameter. This steers the boid in the direction that matches the average velocity of the surrounding boids.

Demo