SAD Engine

A custom game engine project developed for a 3D game with DirectX 12 with skeletal animations

Project summary

Team:

10 programmers, of whom 2 graphics programmers;

Role in team:

DirectX 12 programmer, Animation programmer, Graphics programmer

Development cycle:

8 weeks in the middle of 2nd year in BUAS;

Contributions:

Framework to automate and optimize many DirectX 12 processes

Model loading and rendering through GLTF files

Skeletal animations and blend shapes

Text and UI rendering

About the project

SAD Engine is a custom game engine project which was meant for a game concept that blended together a turn based tactical game such as XCOM with the controls of a third person game.

The development took place over the course 8 weeks, and the engine was praised for the graphics it had at the end of its development. However, despite that the project development was scrapped and the engine itself was unused because the gameplay framework was found very lacking, and unfit to bring forward to designers.

The development team consisted of 10 programmers, of whom 2 were graphics programmers. It is worth noting that close communication was kept with designers and artists to implement as many features as they would require from the engine.

The project was initially meant to be multi platform, with the goals being both Windows 10 and PS4. However, because this was during the first COVID-19 outbreaks in 2020, PS4 development was scrapped due to limited access to the required hardware because of the university closing.

My contribution

DirectX 12 framework

As one of the two graphics programmers on the team, I was responsible for all of the API programming and synchronization, which in our case was DirectX 12. Meanwhile, the other graphics programmer focused on the visuals, such as lighting and other effects.

Going through the implementation details of the DirectX 12 framework would be difficult, but in its final state the renderer used a deffered renderering pipeline which had support for volumetric lighting, omnidirectional shadowmapping, skeletal animations, morph targets and a highly customizable particle system. Sharing the codebase is also not possible, as it contains code related to PS4 development, which is under an NDA.

Short clip demonstrating most of the rendering pipeline's features

Short demonstration of the blend shapes rendering with a GLTF sample file

Skeletal animations and blend shapes

As mentioned above, the renderer was capable of rendering skeletal animations and blend shapes. The development of those was my responsibility, with the source files for the animations being GLTF. The animation process was done on the CPU for ease of implementation, but moving it to the GPU if it was discovered that animations are slowing down the game significantly was on the table as well.

Skeletal animations were a goal for the engine from the very start of the project's development, even despite feedback from teachers suggesting to drop them as a goal. The blend shapes, also known as morph targets, were only added as a goal halfway through the project's development cycle as a feature requested by the artists who were working on assets for the target game.

Text and UI rendering

I was also the graphics programmer responsible for the UI rendering within the engine. My tasks focused entirely on the graphical implementation for the UI, with the information for how the UI is supposed to look coming from an implementation by an engine and tools programmer on the team.

The text rendering utilized Sean Barrett's stb_truetype library to generate font bitmaps from truetype font files. Internally it iterated through the characters that need to be drawn before doing a single instanced draw call to render all of them.

For the implementation of the UI rendering I opted to allow for all aspects of the individual elements to be specified individually, including the UV coordinates used when sampling the UI texture and the color of the element. This allowed for the creation of UI which allows for reuse of existing assets, such as changing the colour of the UI based on whether it is showing information for the player character or for the enemy.

Demonstration of the functionality of the text rendering