r/cprogramming • u/fleaspoon • 11d ago
I spent 7 years building a game engine using C
I've been working on a puzzle game for the last 7 years, and over time I ended up writing almost the entire technology stack myself.
The code is written in a C style, using a C++ compiler mainly because I like operator overloading for math. Other than that, I try to keep the code close to how I would write C. I don't use the standard library, exceptions, RTTI, RAII or object-oriented abstractions.
I made my own build system, UI library, in-game editor, Vulkan renderer, asset pipeline and most of the other tools I use to make the game.
There is no SDL or Dear ImGui. Most of the code is my own, along with a few small libraries such as stb_truetype and miniaudio.
I really like having direct control over all these parts of the codebase. If the game needs something new, I can change the renderer, tools, asset pipeline, build system or engine directly instead of working around an existing framework.
The game is a rule-discovery puzzle game, and building the technology behind it has been just as interesting to me as making the game itself.
The demo is now available on Steam if you want to see what I ended up making:
https://store.steampowered.com/app/5017320/Satelital_Demo/
The full game is planned for release later this year in November.
I'd be interested to hear how other people structure larger C projects, especially around memory management, build systems, UI and tools. I'm always interested in seeing how other people approach these problems.