This is my implementation of 2D flocking I wrote for Kabuki Pinball. 
It's driven from a hash grid and can support up to 500 boids at a time with full state behaviour and collision.
The boids use separation, alignment, and cohesion to maintain the simulation. 
For the game the agents also needed to be able to chase the player, avoid walls and obstacles, and explode.
A weighted system was used to achieve the desired results. 
Main features
500 boids active at a single time
Boids seamlessly transition state and fly accordingly
Weighted system to easily author behaviours
Back to Top