I make almost all of my games in C++ on engines I wrote myself. Why bother, when Unity, Godot and Unreal exist? Short answer: general purpose engines kept getting in the way of the small, very specific games I wanted to make, and building my own turned out to fit how I work. Long answer below, including the parts that hurt.
Where I started: Unity
I started on Unity, like a lot of people. It was a good place to start: it’s open, well known, beginner friendly, and there’s a tutorial for nearly everything.
But it’s a general purpose engine, and over time that became the problem. Even on a good laptop, loading times were rough (to be fair, I knew a lot less about optimization back then). I always felt like I was fighting the built in presets to get what I wanted, especially with canvases. I had to redo more than one project because I forgot to set the canvas scale properly at the start.
And then there were the menus. Menus inside menus, and 90% of them were for things I didn’t need, because they exist for every kind of game Unity supports, not for mine. Eventually I realized I wanted something simpler and more specific. So I started researching how to build my own.
What “my own engine” actually means
I don’t write a brand new engine for every game. What I have is closer to a toolbox that grows. I carry pieces from game to game and keep iterating on them.
The best example is the raycaster in Tōryanse. It started life as a super simple proof of concept for a horror game that got shelved ages ago. Since then it has picked up features I never even considered at the time:
- Actual elevation, instead of a perfectly flat world
- Sprites with multiple viewing angles, instead of billboarding everything toward the camera
- Some real optimization
I still pull bits and pieces of it into new projects, add a feature, and carry it forward again. Here’s roughly what the current set of games runs on:
| Game | Built with |
|---|---|
| Tōryanse | C++, SDL2, OpenGL raycaster |
| In the Shadows of the Past | C++, SDL2, WebGL2 ink renderer |
| Please Don’t Play | C++, SDL2, Emscripten |
| Dice & Destiny | C++17, SDL2 |
| Nectar Days | C++, SDL2 |
| StaticHex | C++, raylib |
By a rough count, that’s somewhere around 100,000 lines of C++ and shaders across my projects. Everything above those libraries is code I chose to write.
What it costs: the loss of “easy errors”
The thing that hurts the most is something I call losing “easy errors.”
An easy error is one you can paste into Google and land on an old tutorial or a Stack Overflow post where someone hit the exact same thing in 2016. With a big engine, most of your errors are easy errors, because thousands of people use the same code you do.
That still works for generic problems, like a compiler message or an SDL quirk. But now about 90% of my issues come from my own custom code. So if I don’t understand a bug, nobody does. There’s no thread to find. It’s just me and the debugger.
The other real cost is working with other people, which I’ll come back to below.
What I get back
The flip side is that I control everything, and a few things are only easy because it’s my own code.
Shaders that know about my game
Adding a custom shader is simple, and I can control it finely. More importantly, I can give it access to any game data I want it to react to. In a big engine, that usually means going through a material system someone else designed. Here, I just pass it in.
Headless testing
This is the big one. Because the game logic doesn’t depend on a window or an editor, I can run it headless: no graphics, no input, just the simulation. That means I can write programs that play my levels for me, to check that they’re actually possible and to get a feel for how hard they are.
Here’s a tiny piece of Tōryanse’s gameplay tests. These two helpers move the player and advance time in the real game session, with no window anywhere:
void tick(int count = 1, bool bow = false) {
for (int i = 0; i < count; ++i)
session.update(world, camera, .05, bow, false, false);
}
void move(float x, float y, float yaw = 0) {
camera.x = x;
camera.y = y;
camera.yaw = yaw;
tick();
}
Tests then walk the player through scenes, trigger events and check that the story reaches the right state. Tōryanse has around 5,400 lines of these.
Here’s why this matters so much to me: I’m not very good at playing games. If I tuned every game to my own skill level, they’d all be too easy (≧▽≦). For Please Don’t Play, the goal was a game I could barely, barely finish myself. Which made playtesting an absolute nightmare. Being able to simulate plays takes a lot of that guesswork away.
Bugs that turn into ideas
This one is harder to measure. Because everything is mine, when something breaks in a weird way, I can see exactly why, and sometimes the weird thing is better than what I planned. I love adapting on the fly, and a surprising number of my favorite ideas started as bugs.
Should you do this?
Honestly, it’s a mixed bag, and I think the decision is entirely situational.
It’s an admittedly awful choice if you want to work in a team. Nobody can really do anything until the engine reaches at least a basic working form, and every change risks breaking something another part of the game depends on. Careful planning helps, but it’s still risky, and it can cause a lot of friction and wasted time.
On the other hand, it fits solo developers really well, especially if you:
- Love rapid exploration and trying weird ideas
- Change direction a lot in the middle of a project
- Want unique systems that a general engine would make you fight for
If that sounds like you, building your own engine might feel less like a burden and more like a superpower. If you need to ship with a team on a deadline, a big engine is probably the better tool, and there’s no shame in that.
What’s next
More of the same, honestly. I’ll keep joining jams that look interesting, building what I want to build, updating my older games when I have time, and adding new techniques to the toolbox. I’m also working on some long term projects, which are secrets for now.
If you want to see where the raycaster ended up, Tōryanse is playable right here in your browser.