Boids Boids Boids: Animation Capstone 3
My largest role in the Animation Capstone was fish wrangler. As our film was entirely underwater, there were a lot of fish to wrangle.
Throughout the film, we needed fish both to fill background space and to interact directly with our octopus main character. After looking through just about every video of schooling fish that we could find, the director wanted them to look like a single cohesive character but still have the shimmering quality that comes from many fish moving individually.
This presented an interesting set of constraints: there were far too many fish to hand animate them individually, they needed to be able to be tightly controlled as a group, but they also needed individual movement to look lifelike.
Fortunately, Maya includes a system for creating boid simulations, which is exactly the solution I was looking for. Boids scaled well; a school of 1000 fish was just as easy as 10 and only crashed Maya slightly more often. With the settings tweaked right, the fish moved dynamically and interestingly.
I had been working on my own boid implementation in Unity before the Capstone started, so I already had some familiarity with the underlying mechanics. If you’re not familiar with boids, it’s a method for simulating flocking movements. Wikipedia has a pretty good summary, and the original paper is fairly approachable.
Maya’s implementation provided a variety of ways to control the overall movement of the flock of boids, and the major problem left to solve was which one to use. I tried a variety of different approaches, including some outlandish ones like building an invisible tube to try to shepherd the fish to where I wanted them to be. The runner up was using Maya’s force fields to apply an outside force on all the fish. This had a few perks. It applied a force evenly instead of being localized around a single point, which looked more natural. It was also easy to add water currents and turbulence, as those are literally fields of force.
In practice though, using force fields proved to have a number of problems. Firstly, it was a separate system from the boid simulation driving the rest of the fish movement. This led to the small scale motions often looking like they were fighting against the larger movement coming from the force fields, rather than being part of the same overall motion. I think this could have been fixed if I had much tighter control of the execution order of everything affecting each fish’s velocity and orientation, but Maya doesn’t provide that easily. The other problem with force fields was control: tweaking the magnitude of one field even a little would result in the fish having drastically different speed and being in a drastically different place by the end of a shot. This made iterating on any aspect of the simulation much more time consuming than it needed to be.
The solution that I ultimately chose was to use the attractor feature. This added an additional vector to the boid simulation calculations that would push the boids towards a point which could be animated through the scene. This was very easy to control and tweak. It also produced very natural motion, since it functioned directly alongside the rest of the boid algorithm. All that was left was to actually animate the attractor object into the shots and let the boids do their thing.