C++ game framework [WIP]

This was originally a pair of projects. The first was for my Game Architecture class, and the second was for my Game Engines & Implementation class. However, they were extremely similar, so I’m currently in the process of combining them into one.

Framework for Game Architecture

The class for this framework was just aimed at building the systems needed to support a game, and was built on Allegro (and later transitioned to SDL). I built it with support for multiple programming styles and a focus on quality of life. For example, the logging system includes timestamps and color coded log levels for easier debugging.

The framework accomplishes two forms of resource streaming through RAII. Reference counting wrappers load assets such as texture sheets and sounds when needed, and can unload them as soon as all objects using that resource release it. Almost every referenceable asset is a descriptor file, which also specifies any other assets it may depend on, such as a sprite needing the texture sheet it is contained in. Allegro’s addons are also handled through RAII, initializing and cleaning up modules like sound and fonts.

The input system receives events from Allegro’s buffer and supports polling for key presses as well as pushing events using both functional hooks and inheritance-based listeners.

To field-test, I implemented a game in the style of Snake with colored console graphics, and a target practice game with full image graphics.

Both the powerups and the snake body segments are treated as their own Unit. Tilemap can be edited through image editing tools.
Dynamic resource loading and unloading is logged to the console. Audio takes a while to load, so it is set to always stay loaded.

Framework for Game Engines & Implementation

Components

Memory pooling

Call batching

Plugins & hot reloads

Serialization

Leave a Reply