# How to Write Your Own C++ Game Engine

DevFeed: [How to Write Your Own C++ Game Engine](<https://devfeed.tech/articles/how-to-write-your-own-c-game-engine-21012.md>)

Original publisher: [Read original article](<https://preshing.com/20171218/how-to-write-your-own-cpp-game-engine>)

Author: Jeff Preshing

Published: 2017-12-18T12:54:00Z

Content type: article

Language: en

Sources: [Jeff Preshing](<https://devfeed.tech/sources/jeff-preshing.md>)

Topics: [Game engine](<https://devfeed.tech/topics/game-engine.md>), [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [Game Development](<https://devfeed.tech/topics/game-development.md>), [Development](<https://devfeed.tech/topics/development.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Mobile](<https://devfeed.tech/topics/mobile.md>)

Tags: [3d](<https://devfeed.tech/tags/3d.md>), [building](<https://devfeed.tech/tags/building.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [code](<https://devfeed.tech/tags/code.md>), [complexity](<https://devfeed.tech/tags/complexity.md>), [console](<https://devfeed.tech/tags/console.md>), [game-development](<https://devfeed.tech/tags/game-development.md>), [games](<https://devfeed.tech/tags/games.md>), [hardware](<https://devfeed.tech/tags/hardware.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [iphone](<https://devfeed.tech/tags/iphone.md>), [pc](<https://devfeed.tech/tags/pc.md>), [serialization](<https://devfeed.tech/tags/serialization.md>)

## AI overview

A practical article about writing a custom C++ game engine, based on the author's work on the mobile game Hop Out. It focuses on managing engine complexity through iteration, careful decisions about unification, and attention to serialization.

## Source excerpt

Lately I've been writing a game engine in C++. I'm using it to make a little mobile game called Hop Out. Here's a clip captured from my iPhone 6. (Unmute for sound!) Hop Out is the kind of game I want to play: Retro arcade gameplay with a 3D cartoon look. The goal is to change the color of every pad, like in Q*Bert. Hop Out is still in development, but the engine powering it is starting to become quite mature, so I thought I'd share a few tips about engine development here. Why would you want to write a game engine? There are many possible reasons: You're a tinkerer. You love building systems from the ground up and seeing them come to life. You want to learn more about game development. I spent 14 years in the game industry and I'm still figuring it out. I wasn't even sure I could write an engine from scratch, since it's vastly different from the daily responsibilities of a programming job at a big studio. I wanted to find out. You like control. It's satisfying to organize the code exactly the way you want, knowing where everything is at all times. You feel inspired by classic game engines like AGI (1984), id Tech 1 (1993), Build (1995), and industry giants like Unity and Unreal. You believe that we, the game industry, should try to demystify the engine development process. It's not like we've mastered the art of making games. Far from it! The more we examine this process, the greater our chances of improving upon it. The gaming platforms of 2017 - mobile, console and PC - are very powerful and, in many ways, quite similar to one another. Game engine development is not so much about struggling with weak and exotic hardware, as it was in the past. In my opinion, it's more about struggling with complexity of your own making. It's easy to create a monster! That's why the advice in this post centers around keeping things manageable. I've organized it into three sections: Use an iterative approach Think twice before unifying things too much Be aware that serialization is