Articles

Creating a Game Engine from scratch

One of my great interests in game programming was to develop my game engine. In this post I will share some insights that I am having while creating my own game engine. These are the early stages of my game engine but I had many details to share and lots of gained insights of this type of software as a whole.

A game engine is considered one of the most complex system to build in computer science field. Besides that, today game engines like Unity and Unreal saves you lots of time towards building systems to make a beautiful and fun game. You just need to work on the game logic and maybe tweak engine systems if your engine allows you to modifiy the source code. So why enter in this very time consuming and complex task anyway if the main objective will be to make a game in the end?

Reasons to develop your engine

1. Learn core concepts in game development (maybe Software development as well)

My first questions when starting my game engine from scratch was what types of systems a game engine is made up of?

Looking at Unreal, Unity I clearly could see that there are several subsystems but which one of them was really important when starting from zero. Maybe rendering is the one every one would pick to be the starting point and I admit that I thought the same way at the beginning. So after a few months after putting up a basic renderer system then I realized that more organization was demanding if the engine woud go scale bigger and bigger.

Leverages your knowledge in both engine modification skills or understanding the components (and issues) when using a 3rd party game engine like Unity or Unreal.

Develop abstract set of layers of core components functionalities that serves each other until you have more specific components suited to your application which are common to all game engines.

- Rendering: Produce a 2D image from a 3D scene involves processing a pipeline stages and be aware of its different steps is essential to any programmer understand under the hood how a game engine renders 3D images through a graphics API.

- 2D/3D Math: Visualize and implement math solutions in game programming is one of the most required skill to develop 2D and 3D games. Vectors, Matrices, Quaternions, Planes and all subjects that comes before these ones are the foundation knowledge needed for any game industry professional programmer.

2. Brush up C++ language skills

Writing a software that will contain the core set components that makes up a game is not an easy task. You need to write every component as game agnostic and reusable not worrying about specific implementation details. That alone requires you to build a good architecture employing design patterns and a readable code. And the best way to accomplish that is learn from the pros. Sincerely, don't make the mistake to go by yourself into an unknown territory. Get educated about the subject, learn from engines source code available, buy a book, watch youtube tutorials, whatever! You are going to learn a lot from them.

3. increase your software architecture skills

The great challenge of writing a game engine from scratch is not only leverage your knowledge in computer graphics algorithms implementation and all math that relies on it, but also how to create a complex application software. And that takes you to employ a lot of good software engineering skills such as coding styles, modularity, cohesion, design patterns (only mentioning a few of them) of your game system entities. But in the end, if it exists in game engine programming an end, you are going to become a great software engineer for sure and be employable for many game studios or potentially very attractive to game studio employers.

4. Broaden your opportunities in the game industry

Not only exists gameplay programming opportunities in the game industry. There are plenty of programming roles in game production projects and gameplay is one of them among many roles you can perform in a game studio. It is the main entry for many programmers.
Graphics programmers is also very popular because you are going to work with the rendering engine and techniques that render beautiful worlds is what developers are aiming for.
Physics engineers, audio programmers, AI, Profiling Tools, middleware developers, it is a vast amount of technologies that can be integrated in an engine, could be either first party or third party components.

More