Aquarium Flocking

This was a project for my class Interactive Media Development in the Fall of 2018. The assignment was to create a simulation of autonomous agents with flocking and path following behaviors. I used Unity's terrain tool and assets from Unity's asset store to build the environment. The fish in the scene implement flocking in three dimensions. They all seek the same random point in the scene, and when one of them reaches that point, they seek a newly generated point in the scene. The fish utilize separation, allignment, and cohesion to stay together as a dynamic flock without colliding with each other. They also use obstacle avoidance to avoid colliding with the rocks in the scene.

Download the build!

There is also a turtle in the scene that implements path following. It follows a looping path of preset coordinates marked by pink rocks in the scene

turtle camera

The player cycle through cameras that show an overhead of the scene, a camera that follows the average position of the flock, a camera that follows that turtle, as well as a camera that follows the front of the flock with a smooth camera script.

average camera

The player can toggle debug lines that show the average position of the flock, as well as their average direction. There are also debug lines for the turtle as well as the path the turtle follows.

top down camera full view camera