◀ prevnext ▶

Why I make my own Game Engine

Other · May 30th, 2024

The real treasure was the friends we made along the way.

Every cheesy ass children's TV show

Since I can remember, I was fascinated by video games and how they work. I want to make my own. A few years back, it was only natural for me to get sucked into the game dev rabbit hole. I did what the internet told me. I participated in game jams, engaged in subreddits, watched other people talk about game design on YouTube. But over time, my views drastically changed. So much so, that I started to write my own game engine, something that no one recommends. But with how my views changed, this is the only path that I want to take.

Many beginners are not aware that making a game is a huge endeavor. How difficult can it be to draw a triangle on the screen? The community is aware of this issue. To counteract, their advice is tailored to keep the expectations low and the workload manageable. This directly leads to many corners being cut.

For example, People recommend to build your game with preexisting, all-purpose game engines. Don't focus on project or code architecture and just get things running. Don't reinvent the wheel, use the first library or asset you can find that does what you want. Fail fast, i.e. don't learn upfront, don't try to understand how things work and only investigate when things fail. Burn yourself out in game jams, to gain experience. And the best of all: Don't work on what you want. Work on smaller things that neither you, nor anyone else cares about.

I presented these a bit mean spirited, but I can't help but feel that this advice is harmful. First, it generates terrible code, that is neither maintainable nor performant. You'll struggle a lot to get things running and you will bite your teeth out when you hit awful bugs. Second, you will learn slower, as per this advice you are not actually trying to understand what you are doing. And third, it does not make you happy, because you will be spending more time on focusing on finishing a project, instead of enjoying the process itself.

Let's play devil's advocate. Assume the worst-case position for my argument, that I've constructed a strawman. Assume I misrepresented what everyone is saying. And assume I did not address the actual advice, which still floats around in the community. In this case I want to ask the question: Why is there so much failure in this community? Every day in different parts of the web, people share their post mortems, about how they are burnt out, how much work all of this is, how it is not fun or that their end product was not as successful as they anticipated. At one point, one should stop and ask themselves: Surely, the failure rate would be much smaller, if this advice actually works, right? However, if there is a reason why people fail, why then is the advice not tailored to this reason?

The answer is, as I've lined out, that the advice is essentially harmful in itself. I don't assume bad faith. People are not evil, and I think what they are trying to say is well meant. But because of how communication on the internet works, well meant advice got distorted. It morphed into unhelpful buzzwords and short, snappy phrases, which misguide the beginner.

For example, take the advice to not work on what you want, but on many small things. Most big successes are from people who already have years of experience. Usually, they worked a long time in the field already, or boast a portfolio of smaller projects. The wrong way to connect the dots is to assume more games equal more success. The reality is however, that people did not gather all this experience to have one single success, but rather because it is their passion. The huge work they put into it is because they can and want to. When they do eventually have a breakaway game, usually it's because of that exact experience, which allowed them to put all their strengths into one unfathomable good product.

Or take for example the advice to not reinvent the wheel. People recommend this, because programming is a wide and deep field. You can pick a single subject and spend your entire life only studying this one thing. So, when you are doing a project, and you need a solution for something you don't fully understand, you can build on top of existing knowledge. You can save a lot of time and energy, by using other people's work. But this advice gets distorted to never try to build things on your own. It leads to people not wanting to do stuff, and them assuming everything is solved nowadays. In the worst case, people really don't understand what they are doing, and they burn out on the fact that there might not be a solution to their problem.

Knowledge is like a drawer. Whenever you learn something, you put something into it. When you forget, you don't really lose anything. Forgetting is more like losing the note on one of its doors, such that it's difficult to tell what's behind it. However, a circumstance or event can trigger you to look into it, allowing you to access the knowledge. It goes without saying, the more knowledge you have, the larger your drawer becomes. Over time, you will burn stuff inside it. Mostly details, for example mathematical formulas or syntax of a programming language. But that's not necessarily a bad thing. You may forget details, but you retain the concepts. Making room for different knowledge allows you to use the space more efficiently. You can always look up details later.

Students often ask, why should we study, when everything can be looked up? The simple and unsatisfying answer is that you don't know what you don't know. It can feel like a real waste of time, when you don't see how a given knowledge can be useful. But putting more stuff into your drawer is always useful, because you look inside it every single day. It affects how you think. Let me ask you this: How exactly are you looking up a mathematical formula, when you are not even aware of its existence? How exactly are you solving a problem, when you can't even pinpoint what the exact problem is? Sure, you can ask people online for help, or one of the hot new text generators. But when your problem is too niche, even they will struggle to help you.

And this is why I take great dismay with "don't reinvent the wheel". I am not reinventing anything. I am learning how things work. I look up what other people have done and then give my own spin on it. I am putting things into my drawer, growing it in the process. When you lose yourself in the mindset to never solve problems and always use preexisting solutions, you will struggle. Period. A related issue is what the community calls "tutorial hell". People who are in tutorial hell follow too many tutorials too closely, never deviating from them. People in this situation really struggle to get the ball rolling on their own, because they miss the concepts to do so.

So, what about me then? I am talking out of my ass and I have yet to say a single thing about my game engine. Well, after 2 years of work my engine is far from being in a presentable state. It looks primitive. And what it can do is easily achieved by a few clicks with every other engine on the market. At this point, I am imagining that this whole project will take an even greater portion of my life. But God damn, it's the single coolest thing I've ever worked on, by a long shot. I take great pride in saying "yeah, I did that", and I can't do that for the things I've done in Unity. I understand and have full control over my code. I actually do own my code, which isn't given in today's copyright hellscape. Literally the only downside to writing your own thing is the huge amount of time and effort required to do so. But I am planning big (maybe too big), so I am going to spent a lot of time and work on this anyway. By writing my own game engine, I am just front loading this work, experiencing it now instead of later.

Of course, I have this one great amazing innovative never seen before best of all time game in my head. I hope it will succeed, like everyone else does for theirs. But it's not my primary incentive anymore. I am having fun. And I amassed so much underlying knowledge and experience, that I feel I can work on anything now. I don't think I could've said that 2 years ago. Ultimately, you'll only learn by going out of your comfort zone. And by doing something as difficult as this, I am practically always outside my comfort zone.

I am not really trying to convince you of writing your own game engine. What I am trying to say is exactly the cheesy quote at the very top of this post: The real fun is the things you learn along the way, not the end product. You should enjoy what you are doing, using the end product as a justification to do so. And in my case, this is writing a game engine. For you, the end product may not be some giant undertaking, but at least it should be something you care about. And you have to learn. Always learn. At least try to understand why your copied solution works the way it does.

If you understand what you are doing, and have fun doing it, then you will have a much better time. You will regret nothing.

Random Post: Crisis

Other · Apr 10th, 2022

Random Post: Crisis


Other · Apr 10th, 2022

Previous Post: I found a Bug in my JobSystem
More Other related Posts