Final Project: Agent Based Animation

Ben Mitchell, Zach Pezzementi

We chose to implement agent-based animation for our final project. They were relatively easy to incorporate into our existing graphics system as one of the set of TimeWarps that can be associated with an animation. The agent takes a reference to the current setup of the world (the GraphicWorkspace), chooses how to accelerate based on this setup, and returns a transform to the location where that acceleration would place the object at the next timestep. Two processes decide how the agent will accelerate: goal seeking and object avoidance. The agent keeps track of its current state in terms of 3d position and velocity. It also has a goal state of another 3d position and velocity, and when possible it will accelerate to match that state. Whenever the agent's path intersects with the current position of an obstacle, the agent temporarily stops seeking its goal and starts avoiding obstacles. The agent then accelerates away from the obstacle, and, depending on the speed at which the agent is travelling, maybe slows down as well. All velocities and accelerations are clipped to specified maximum magnitudes (maintaining direction) to make motions look physically plausible (impulse drive only).

Here, a small borg cube starts to the right with no velocity and a goal set to the left also with no velocity. But there's a larger borg ship in the way. What's a cube to do?!

Avoidance Demo

Next, a borg cube has its goal set on the other side of an asteroid field, so it navigates through the field as the camera follows it. Several enterprises have their goals set to the borg ship though. Conflict! The nerdiest of our readers may recognize this as an attempt to reenact the battle at Wolf 359. We have added phasers fire to one version, but that code is not complete, so the Federation ships have exceedingly poor aim.

version1 version2 phasers version
The Battle at Wolf 359