Components of a Game Engine

In 2013, I decided to develop a Game Engine from scratch. Why did I decide to do so, I still do not know. However, what I do know, is that I wanted to do something beyond my intellectual abilities.

When I started, I knew nothing about game engines, OpenGL, Computer Graphics. My C++ skills were limited, and I remember having problems grasping Linear Algebra during college.

Developing a Game Engine demanded that I wake up earlier than most people (5:00 am), so I could squeeze in about two hours of coding before heading to work. It forced me to code until the late hours of the night (approx 7:00 pm-1:00 am). And it made me say goodbye to my weekends. Weekends that I spent coding in my room or at Starbucks instead of enjoying life.

Then on July 21, 2016, around 2:00 am, I did it!!! I finally finished the basic framework of the game engine. It took three years, about 1,095 days, approximately 15,330 hours of work.

Throughout this journey, my math, coding, and engineering skills improved tenfold. However, it would be worth little if I didn't share what I've learned with you. Thus, I decided to share all my knowledge on this blog. As of today, I have written over 175 articles on this blog.

I have decided to compile my best articles into an ebook. In this ebook, Components of a Game Engine I share all that I know about game engine development. I talk about computer graphics concepts, such as the rendering pipeline, shaders, lighting. I also share concepts on computational geometry and its use in collision detection. Furthermore, I explain several algorithms used in game engines.

Components of a Game Engine will not make you a guru on game engines. But it will give you a solid understanding of the mechanics and elements of a game engine. The materials in the ebook are freely available on my site. However, if you want to have all these articles in an organized manner, I recommend you to get a copy of the ebook.

I would appreciate if you support this site by buying my new ebook Components of a Game Engine.

Thanks

It has been two years since I started writing

Two years ago, on 12/25/2014, I wrote my first blog post. And after 170+ posts I'm still here, writing.

My first year was depressing. I hardly got any visitors. I remember that on average I was getting about 5-10 visitors a day. Like anyone, I wanted my traffic to increase, but I didn't take any marketing actions on it. I avoided using catchy headlines, nor did I use popular keywords.

I didn't have a strategy. I simply started writing and sharing what I was learning. My only requirement to write a post was "Will this post help someone?"

After a year or so, my blog traffic started to increase. I remembered being so happy when I started getting 40-50 visitors a day. By this time I had written over 100 articles, but I had never received a comment on any of my posts. The day that I received a comment I was kind of excited.

It makes me happy to see that after two years of writing and sharing my knowledge, my blog is getting more traffic. On average about 1,600 visits a month. To some of you these numbers may be insignificant, but keep in mind that when I started, I was getting about ten visitors a day.

So why did I start writing?

Three and a half years ago I was developing a game engine in obscurity. I was learning a lot from this project, and I wanted a way to express myself and let people know about my project.

I am not a social media person. And the thought of posting a picture of me working on the game engine either on Twitter or Instagram didn't go well with my personality.

Around this time, I was reading the book Show your work. Which stated the following points among others:

  • You don't have to be a genius
  • Think process, not product
  • Teach what you know

These three points encouraged me to show off my game engine. I realized that I didn't have to be a genius on game engine development to start writing about it. It made me understand that you can inspire others by showing the process of a project. And it made me realize that the whole point of social media is to educate and inform others, not to share what you ate this morning.

So I started writing about Computer Graphics, Programming and Game Engine Development.

These two years have not been easy. Many times I wanted to quit writing and shut down this blog. But I am so tired of quitting that I force myself to keep writing.

So if you want to start a blog, go for it. Don't be afraid to share your knowledge, even if you are not an expert in your field. I was not an expert when I started but I have written plenty of articles on Game Engine Development, C++ and OpenGL.

If your project is not ready to be shared, don't wait. Share it anyways. Write about the process. Someone out there will be interested in what you are doing. I began sharing the process of the game engine when the engine was a piece of nothingness.

Below is a timeline of the game engine process.

And finally teach what you know. Writing NOT Coding helped me become fluent in game engine development. If you can't teach it, then you don't understand it.

Thanks for reading.

On this Mac, I developed a Game Engine

Two weeks ago, my Mac stopped working. I took it to the Apple store so they can diagnose the problem and unfortunately, the hard drive was no longer usable.

I lost all of my data and ended up buying a new Mac. Yes, I could have bought a new hard drive, but I've had this Mac for over six years, and it was time to get a new one.

My Mac with a blinking question mark after a reboot

My Mac with a blinking question mark after a reboot

When the Apple technicians told me that my Mac was no longer usable, I got sad. Not because I lost my data, but because I've had built a relationship with my laptop.

No, I am not weird. Let me explain.

Developing a Game Engine is hard. It takes a lot of dedication, persistence, and motivation. It took me over three years to develop a game engine. I had worked on it before heading to work, during lunch, after work and during the weekends. I can say that I worked over 15,330 hours on it.

Game Engine Development is not that hard technically-wise. It is hard psychologically-wise. You can spend three or four months of work only to implement a simple feature. You can spend two to three months trying to implement an algorithm and fail. I spent almost a whole year trying to get the Collision Detection System to work.

To be honest, I wanted to give up every single day of development. I was mentally tired. The enthusiasm that I had when I started development was gone. There was no desire in my heart to finish the game engine. I was spiritually tired.

And throughout all this time, my Mac was with me. It witness all the hours I put on it. It witnesses me dancing when I successfully implemented the first beta version of the engine:

 
 

It heard me swear in Spanish when the engine would crash. It saw me stared at it for hours pondering the idea of giving up. And it saw me when I screamed and jumped when I implemented the basic framework of the engine (Beta version v0.0.2):

 
 

It saw the game engine first demo:

 
 

The night before it died, I was preparing a demo to showcase version v0.0.3 of the engine. It was going to showcase the final piece of the engine framework. But my Mac never saw this demo working:

 
 

The next morning when I tried to turn on the computer, a folder with a blinking question mark showed up on my screen. I tried rebooting the computer, but it was useless.

I got sad when I realized my Mac was no longer usable. It may sound weird; I agree with you. But I am not sad because it no longer works. I am sad because, through this Mac, I learned to persist.

Thanks for reading.

Which language should I use to develop a game engine?

It depends on the type of games you want the game engine to support.

For example, the game engine I'm developing is designed to work on iOS mobile devices. Therefore, I had two choices for a programming language: Objective-C or C++. I opted for C++ for educational reasons.

Since my game engine supports mobile games, I had only two options for a rendering API: OpenGL ES 2.x or OpenGL ES 3.x.

I started development using OpenGL ES 2.x. Once OpenGL ES 3.x became available, I made the necessary changes to the engine to support OpenGL ES 3.x.

The game engine is also capable of rendering 3D characters modeled in Blender 3D, a Modeling Software used by game artists. Therefore, I used Python to develop a Digital Asset Exporter, a tool which retrieves character data in Blender. The Blender API is written in Python.

If I had designed the game engine to work on Android devices, then I would have used Java. If I wanted to use Cheetah 3D instead of Blender 3D, I would have developed the Digital Asset Exporter in Javascript. If I wanted to support PC games, then I could have used OpenGL 4.x (or even the new OpenGL generation, Vulkan).

So, before deciding if you want to develop your game engine in C++, Objective-C or Java, ask yourself what type of game engine you want to develop? Do you want it to support mobile games? PC games? What character modeling tools do you want it to interface? etc.

Remember, people don't care what language you used to develop an app. What they care is what the app can and can't do.

Hope this helps

Keep your APIs simple short and clean

Keep your APIs simple so that anyone can use it.

Keep your APIs short so that anyone can remember it.

Keep your APIs clean so that anyone can understand it (without reading the full documentation).

Hope this is helpful