Cardia Engine

An usable C++ game engine using python as its scripting language

With the aim of discovering a new aspect of the developer's profession, for which I am now in love, and to challenge myself, I decided in the summer of 2021 to embark on the design and realization of a game engine in C++.
Not wanting to make just another engine, I decided to integrate a language that was close to my heart: Python.

Starting blocks

And so began the development of my biggest project to date. Drawing inspiration from sources such as The Cherno series, and books such as Game Programming Pattern, I made the initial decision to render with OpenGL. As the API has a lot of resources available, it was easy to learn how to use it.

But as time went by, the architectural backwardness of OpenGL in recent years became more and more apparent, and the lack of control over the rendering pipeline it provided began to cause problems. So the decision was made to change the entire rendering API from OpenGL to Vulkan. The learning curve was much harder, but not impossible. Today, the engine is capable of rendering static scenes using techniques such as Physically Based Rendering.

Entities, entities everywhere

Always with this learning objective in mind, and with a desire to learn new ways of developing, I looked into Entity-Component-Systems, using the famous Entt library. By taking advantage of this way of organizing data, a world of advantages opened up for me. Favoring composition over inheritance has saved me from architectural knots on numerous occasions. The use of systems has also proved extremely useful in terms of rendering.

It's very easy to iterate through all the transforms and models of the entities present to display them. Multiple passes are child's play, consuming very few cycles thanks to the use of CPU cache. Thinking in terms of data instead of objects was a great help, and I think I'll direct much of the rest of the development with this in mind.

What about scripting ?

Next came the subject of scripting. Although I use C++ because of its ubiquity in the field and my desire to improve with this language, I could hardly choose to impose this language on potential users due to its complexity. So, in keeping with my love of Python, I decided to implement its use with the existing entity system

Although still very superficial, it is already possible to use this system in real cases, with certain features such as asynchronous function execution in the gameloop's context.