Boid Simulation

This project constructs and manages a flock of "boids", an artificial life program, developed by Craig Reynolds in 1986. In the case of my simulation, the boids are modeled as fish, with the flock being a school of fish. The flock travels towards a large red "goal" fish that is controlled by the user.

As described in Reynolds' "Flocks, herds and schools: A distributed behavioral model." (SIGGRAPH '87: Proceedings of the 14th annual conference on Computer graphics and interactive techniques) the flock has 4 major forces applied to it to maintain its flock like behavior (technically the fourth, goal-seeking or simply "seeking" came from a later paper in 1999). These forces are cohesion, alignment, separation, and goal-seeking. Cohesion keeps the members of the flock together, while separation prevents them from colliding into one another. Alignment has each boid maintain a "flock velocity," so even if different boids have different velocities, the flock will have one general velocity. Goal seeking forces guide the entire flock towards (or in some cases away from) some goal. A boid's orientation matches that of its velocity, and banking effects are added.

These images show flock behavior when the goal is stationary as well as some banking behavior as they follow the goal.

 
 

This video shows the simulation in motion. Note that not all boids are the same size or have the same field of view, and that boids of a specific color do not necessarily share any of the same properties.

 

These images demonstrate how the boids handle obstacle avoidance. The boids avoid the large black spheres while maintaining pursuit of the goal and a general flocking pattern.

 

This video shows boid obstacle avoidance in motion.