top of page

Animation Systems Programming

C++, Game Environment Framework (GEF), GitHub

The aim of this project was to create an application that demonstrates the implementation of multiple current animation techniques. The application has been developed using C++ in Visual Studio 2017, while also making use of the Game Environment Framework (GEF). The connection between GEF and the computers hardware allows the rendering of 2D sprites and 3D skinned mesh's and the ability to recieve inputs from the user. 

2D Animation System - Overview

The system implemented for 2D Animations was developed to deal with both the loading and playback of Frame-Based and Skeletal Animations. Any game object which inherits from the base 2D Gameobject class will be able to initialise the 2D Animator Component. 

2D Animation Component

The 2D Animator contains functions that allow the user to load and cycle through different animations. The system that was developed reads data from PNG's and JSON files, both of which store animation data. 

​

When the application is running the animator's update function takes in multiple variables to change the animation. These variables include actor name, animation-name and delta-time. If the names differ from what currently is the case in the animator, then the variables responsible for the updating of the animation are rest and initialised to work with the new animation. If there are no changes the frame index is updated.

​

The animation data is stored across two atlases: Texture and Armature, which are both created on initialisation. The primary function of these Atlases is to read, store and return the animation data. An unordered map was used to store both sets of data due to its constant time complexity. When filling the atlases the 'FillAtlas' function can determine if the animation is Frame-Based or Skeletal and load the appropriate data for each. 

3D Animation System - Overview

The system implemented for 3D Animations was developed in order to have the ability to switch and blend between different animations, while also making use of procedural animation techniques such as Ragdoll Physics. A similar approach to the 2D Gameobject base was taken when designing the 3D GameObject class, in which multiple components such as mesh/skinned mesh, 3D animator and ragdoll can be initialised by a derived class. The base class also contain multiple virtual functions for Initialisation, Updating and Input Handling.

​

​

​

3D Animation Component

In order to keep the animator update function clean it was decided that any outputted pose would be calculated through a blend tree, due to this each animator stores a vector of Blend Trees which are created on Initialisation. On start-up there are four key stages that need to be completed: load mesh, load animation data, create animation nodes, connect animation nodes to form blend tree.

​

The update function for the animator takes in variables such as delta-time and a vector of parameters that will be used by nodes in the active belnd tree.

3D Animation System - Parameters

Parameters were created as a method of passing variables of multiple different types in a vector or a map. The base class Parameter holds multiple virtual functions that can be overridden by a child object. These parameters became the default way of storing variables in 3D Gameobjects. Each 3D GameObject held generic variables such as speed, jump and ragdoll, each of which is updated in the GenericParamUpdate function. Characters may have more specialised variables that need to be passed into the blend tree, which can be initialised or updated in virtual functions that the character can override.

3D Animation System - BlendTree

The blend tree class holds information such as the bind pose and ragdoll for the character. Each blend tree is composed of at least one animation node and an output node (root node). The output node is responsible for returning the final outputted pose from the animator which the game object will use. On initialisation, the blend nodes are linked together in a pre-determined order to build the tree.

3D Animation System - BlendNodes

All Blend Nodes inherit from a base class BaseBlendNode. This parent class hold variables such as the outputted pose from the node, along with vectors of input nodes and variables that are needed to allow the node to operate. The parent class also holds two update functions. The first being a virtual function, which any child node can override. This is where the main calculations for each node are held, resulting in the function being purely virtual, as each node must have one for the tree to compute. The second is used in the traversal of the tree, ensuring that the lowest nodes in the tree are updated first to ensure the animation is formed correctly.

The above image shows the multiple blend nodes that were developed. Specific ones of interest include the Linear Blend and 2D Blend Node, both of which have scaled version. The scaled version alter the playback speed of the animations to allow for smooth transitions. 

bottom of page