Red Engine

May 25, 2025

Goal

The goal of this project is to have a simple working environment to experiment around game engine development without the constraints of a real world project. That’s actually the reason the project has known multiple phases of development, doubt, restart etc.

Experimentations

Data structures

One of the first thing I have tried to do is building a simple library of containers like an Array, an HashMap. Learning to do it to understand how it work was the goal.

This is also a great way to test the performances of different hashes, probing methods etc.

ECS

One the big thing I tried to do is to apply the ECS architecture and develop my own. I achieved this with a simple architecture that allow to define component & systems the easiest way possible.

For example a system querying entities with the WriteComp1 (with read/write permission) & ReadComp (with readonly permission) declare itself like this :

using TestSystemTestQuery = Query<Writing<WriteComp1>, Reading<ReadComp>, Reading<SingletonTestComp>>;
struct TestSystem : public red::System<TestSystemTestQuery>
{
    virtual void Update() override
    {
        {
            auto singls = m_query.GetSingletonComponents();
            auto* singlComp = std::get<const SingletonTestComp*>(singls);

            REQUIRE(singlComp != NULL);
            REQUIRE(singlComp->value == 1);
        }

        {
            auto comps = m_query.GetEntitiesComponents();

            REQUIRE(comps.size() == WorldEntityCount);
        }
    }
};

This system also query a singleton component that is only instantiated one and only one time during the life time of the game. That is useful for data like renderer, resource managers and others.

The Query also provide introspection to build a multithreading system around the permission of the systems and an execution graph (dependency graph).