So, you want to make a game engine | lisyarus blog
So, you want to make a game engine
2023 Sep 15
Unity's recent controversy sparked a heated debate on game engines. Some said that everyone should immediately switch to a new engine, while others replied that switching engines can take months if not years. Some said that the best way is to roll your own game engine, to what others noted that this isn't a simple task. And, you know, everyone is right here: there's no single answer, everything depends on a specific case. But maybe writing your own engine isn't as hard as it sounds? Why would one do that anyway? What does it even mean to make a game engine?
I've never actually worked with any game engine except my own pet engine, which I've been slowly expanding for 3 years by now (it's about 100k LOC already) and successfully used it for over a dozen jam games and one releaased commercial game. However, I've seen people use other engines; I've seen people complain about other engines; I've seen people talk about their own engines; I've studied the source code of other (open-source) engines. So, I believe I have a few things to say on the matter, though, admittedly, my experience might be somewhat biased or unconventional.
Contents
Part 1: The difficult questions
Why make your own game engine?
Let's start with the elephant in the room. This has been discussed over and over, but it doesn't hurt to discuss it one more time. Here are a few reasons why you would ever make a game engine of your own:
You'd release yourself from the burden of questionable corporate decisions, which, as recent events show, is a big deal
A custom game engine is free (neglecting the development cost, of course, – nothing is really free)
You can optimize the engine to your own needs (or the needs of a specific project), in terms of performance, iteration time (everyone loves waiting for shaders to recompile or lightmaps to bake), engine architecture (you'd probably use a ECS instead of a conventional scene graph for a game with millions of flying objects), and many other things
You have full control over how everything works internally and what technology is used
You can use your favourite programming language (though there probably are some game engines for every language on the planet)
You can have much smaller distribution sizes (my engine takes less than 2Mb, of which almost all space is taken by SDL2.dll)
You can open-source your engine and see it being used by others (but beware that maintaining FOSS projects is basically a hell)
You can even sell your engine, if it is of suitable quality (but beware that marketing your work is basically a hell)
You won't be frustrated due to some stupid developers not implementing the feature you need
Random people on the internet will think you're cool as heck because you're making your own engine
It is a lot of fun , I promise
You will learn a freaking lot of stuff on the way, which will make you better understand other engines and, as a consequence, will help you make games in the future even if you throw your own engine to the dustbin
For me personally, the last two points are the most important. First of all, learning is fun, and if you don't think so, you better begin: if you want to make games, you'll have to learn a lot anyway, so better start enjoying the process!
Secondly, I just love coding. I love implementing algorithms, I love designing libraries & systems, I love digging the low-level stuff. Removing this would make game developement miserable for me.
I'd also want to elaborate on the "won't be frustrated" point, as this was somewhat of an eye-opening discovery for me. I've seen people complain about the engines all the time: this stuff is broken, this stuff breaks this other stuff, this new stuff doesn't support this old stuff, and this stuff was requested a decade ago and still isn't implemented. Of course, there are always reasons for why things are the way they are; if you've ever worked in a big enough corporation, you probably can relate. However, it is always easier to blame others than to blame yourself. Those stupid developers didn't fix this thing! Why didn't you fix it, if you needed it? Well, it's not your engine, right? – it's theirs. But it is your frustration.
But now it is, now you're making your own engine. Suddenly, there is no frustration: you know exactly why the engine lacks a certain feature that you now need. You didn't implement it, simple as that. Why didn't you? Well, obviously you were busy with other things! You're making a whole game engine alone or in a small team, it is understandable that the engine lacks support some stuff. It is expected, even. You'll implement the feature when it's really needed. Of course you will. Just, probably, not right now. There are other things.
My point is, it is harder to blame yourself for your own work than it is to blame others for their work.
Why not make your own game engine?
Anyway,...