DEV Community

Cover image for 14 Years Building My Own Game Engine
Angelo Theodorou
Angelo Theodorou

Posted on

14 Years Building My Own Game Engine

For the past 14 years I've been building and maintaining my own 2D game engine, nCine. In June I gave a talk at /dev/games, a two-day game development conference in Rome, about my journey developing it.
What started as a side project slowly grew into a long-term companion through different stages of my career in the games industry.

What is the nCine? ⚙️

nCine is a cross-platform 2D framework for games, tools, and prototypes. It runs on Windows, Linux, macOS, Android, Raspberry Pi, and even the web through Emscripten. It's written in C++11 with Lua bindings, emphasizes performance and optimization, and is available under the MIT license on GitHub.

Above all, nCine has always been a learning opportunity, both for me and (hopefully) for its users.

Why Build Another Engine? 🤔

The first commit came from a mix of frustration and curiosity. At the time, I was working on GUI code for games and daydreaming about graphics programming. Writing my own engine was both an escape and an education.

The project gave me a chance to:

  • Dive deep into C++ templates, generic programming, custom allocators, and multithreading.
  • Explore rendering techniques and cross-platform development.
  • Build a codebase I could use for demos and experiments.

Over time, the motivation changed. These days, the excitement comes from seeing others pick it up, push its limits, and create with it. If someone builds something beautiful with nCine, that would mean more than any benchmark.

And yes, I also believe the world benefits from more custom engines. Too much consolidation risks stagnation. The history of game dev is no stranger to bespoke engines that did things no off-the-shelf solution would have achieved.

From Hobby to Career Companion

The first commit was in June 2011. At the time, I was in Italy, working at a small indie company. I started developing on Arch Linux, using CMake, GCC, and Qt Creator. Within a couple months, I had something running on Android too.

The engine followed me everywhere, from Italy to the UK, from the UK to Sweden, and finally to Spain.

At each stage, I rewrote or refactored parts of the code as my knowledge grew. The nCine has almost become a mirror of my own professional journey.

Technical Highlights 💡

A few features I'm particularly proud of:

  • Foundation: No use of STL, the nCine Template Library (nCTL) provides containers, iterators, algorithms, smart pointers. I also have my wrappers for threads, atomics, and filesystem.
  • Rendering: OpenGL 3.3 backend, automatic batching, custom user shaders and viewports for post-processing.
  • Audio: OpenAL-based sound system with WAV and Ogg streaming support, OpenAL EFX effects and filters.
  • Input: Full gamepad support across platforms, including Android via JNI integration. Multiple backend support: GLFW, SDL2, Qt5.
  • Performance: Custom allocators, SIMD experiments with SSE and NEON, multi-threaded job system.
  • Tooling: Integration with Dear ImGui, the Tracy frame profiler, and RenderDoc.
  • Ecosystem: From Pong clones to path tracers, from prototypes to artist tools, the engine became the base for a surprising range of side projects.

Lessons Learned 👨‍🏫

Looking back over 14 years, a few patterns emerge:

  • Rewrite with purpose. Don't be afraid to throw away code, but only when you know why the new version will be better. For example, I started with an OpenGL 1 fixed-pipeline because I wanted the simplest rendering to focus on other things first, later I rewrote it a couple times to support newer technology.
  • Side projects can outlast companies. nCine became a constant thread in my career, something I enjoyed no matter where I worked.
  • Tests and docs are future-proofing. Over 25,000 of the 120,000 code lines in nCine are dedicated to unit tests. Documentation (Doxygen and LDoc) isn't just for others, it's for my future self.
  • Community matters. Even a small user base can keep you motivated. Seeing others stress-test nCine pushed it further than I ever could alone.

What's Next 🚀

I'm finishing a multi-threaded job system and already exploring how to use it to speed things up. I will apply some data oriented design principles to rewrite core parts of the engine to be more cache-friendly, while probably also introduce some ECS foundations.
After that who knows, maybe I will start working on the Vulkan backend I've been thinking about for years.

Closing Thoughts

If I were starting today, I might choose different tools or even a different language. But I'm glad I stuck with nCine. It taught me more than I ever expected, gave me interview material, personal satisfaction, and a community of curious developers.

The slides from my /dev/games talk are online:

And the engine itself is open source here: https://ncine.github.io.

Top comments (0)