Udders
Year:2015
A 2D action platformer prototype developed in a couple days by me and Callum Tweedie-Walker, meant as an experiment to build upon the Udders character, first developed in 3D for a Ludum Dare game jam. The prototype features a robust rigidbody character controller with two-way environment interaction, enabling physics-based platforming and puzzles, a full-body skeletal animation, and a thematically-accurate milk simulation.
Udders mechanics showcase.\

Character Controller

Inspired by the desktop and console remakes of Rayman by Ubisoft, Udders doesn't have thighs or calves, only feet. The goal was to create a fluid, responsive, dynamic character, during both combat and platforming, in the like of Rayman. This required lots of detail in the animation, and robustness of controls.

Locomotion and skeletal animation

The locomotion is based on a Rigidbody2D component, but with all default physical forces disabled. Instead, the velocity is manually calculated and applied using Rigidbody2D.MovePosition, allowing for collision detection. The remaining interactions, such as collisions with other rigidbodies or objects used for platforming such as the spring, are stored and layered on top of player input.

Video of multi-purpose platforming gun showcase.\
Multi-purpose gun for platforming.

As the prototype was developed when the 2D tools of Unity have only started to be released, the skeletal rig is loaded and handled using the Puppet2D AssetStore package. The character consists of several overlaid elements, with either a static sprite or a sprite-sheet, linked together by bones. All animation playback is controlled manually through code; the speed and direction of the feet, position of the ears based on vertical velocity, and inverse kinematics for gun control.

2D skeletal locomotion video.\
2D skeletal locomotion video.\
2D Platforming and bone-based animation.

Effects

Udders is a space-faring cow, but still sticks to his guns, so all of his effects are milk-based. He uses either a regular whole-fat milk or charged-up plasma milk for his guns.

Milk simulation

The milk effects use an alpha-based metaballs approach, which can be rendered with high performance in 2D. Each type of milk is rendered on its own layer using a separate camera to and stored as a RenderTexture. This allows for many different systems to be used, like a particle system, rigidbodies, skeletal rigs of milk-monsters, ..., in combination with one another, allowing for complex effects. The colour information from each rendered layer has a gradient shader applied, mapping between two colour gradients.

The examples below use many circles, each with a radial gradient, going from fully opaque in the middle, to fully transparent at the edges, mapped to white if above a certain alpha-cutoff threshold.

Milk effect from particle system video.\
Milk effect from rigidbodies video.\
Milk simulation for Udders' effects using 2D alpha-based metaballs. The raw output of the shader applied to rigidbodies is on the left, and output from a particle system super-imposed on gameplay is on the right.

The gun shots' particles are also alpha-based, but mapped instead to a complicated gradient, which goes from white to blue, then sharply changes to a light blue and fades out, resulting in the appearance of semi-discrete glowing blobs.

Flair

In the spirit of the Rayman games, the character animations has lots of details. The face has several bones, which react to gameplay, without affecting it, like faking physics of checks and hair by scaling of bones. The facial expression can also be changed in the same fashion, by swapping and morphing sprites.

Dynamic character facial expressions video.\
The character's facial expression can change based on action and context.