Making a game engine

in C++ using an Entity

Component System

This unit was all about using C++ to create a simple game engine designed to create 2D games. This game engine is not the typical kind of game engine you would think of, its not graphical like unity or unreal, however you could make it so. It’s more of a coding framework built to allow easier development without repetitive code.

The engine was built using an Entity Component System or ECS for short, the way this works is by creating a world that has associated entities within it that have components attached to those entities that hold data about said entity. It sounds complicated at first but this diagram should give an easier understanding of the concept.

Core holds all of the base information and a list of environments

Environments send data back to the core information and holds a list of entities

Entites send information back to the environment and holds a list of components

Components hold specific data and feed it back to the entity

This engine also makes use of a resource system allowing users to just access one class and one function from that to load many different types of resources. For example, when the user wants to load a texture they would do “Resources.Load(“texture”, pathtotexture). This can be adapted to load any number of resources over time, however currently there is just textures, models and audio setup.

If you would like to check out the full project it is on my github here.

This screenshot shows a simple platforming demo to show off how a game could be made using this engine.

If you would like to look at the demo itself you can download it from itch.io here.

Note* You will need to use the password “NSEngine” to access the itch page.

Previous
Previous

Ray Tracer

Next
Next

Dissertation