Brief update (June 25, 2016):
As of April, I have taken a job at Epic Games working on their MOBA, Paragon. It’s been more fun than I possible could have imagined, but it’s also been a ton of work. We have a subreddit where I made an announcement at the time, but I should have written it here too. Well, it’s here now at least.
I can’t really say what that means for HQ right now. As of this writing I’m barely two months into the job, and there’s a lot of work to do. My experience up to this point has been Unreal Engine 3, so I’m learning how to work with UE4, and also being held to a fantastically high standard of quality for the work I submit. I love it, and it’s making me much, much better at what I love to do.
So…. for now, HQ is on hiatus. I have done a lot of planning and research for the project, so I don’t want to say it’s abandoned by any means, but I just don’t have an estimate right now on when I can get back to it. I still believe that learning resources for game programming are weak overall, and I want to see them improve. So the core impulse for the project is still there. But I just can’t estimate what the future holds.
In the meantime, feel free to contact me if you have any questions. Also, if anyone reads this and feels like they can continue the project, I encourage you to do so. This is an open project, we’re all in this together, and if you feel you can contribute by going down this path, go for it. I could always pick up with Quake 2 or 3 when I get back to it…
Without further ado, let’s continue with the original content of this page.
On this Page
What is Handmade Quake?
Handmade Quake is a video series where I break down the source code for the software renderer version of the original Quake and put it back together, one internal system at a time. We start with a blank Visual Studio project, discuss the systems that the game needs to run properly, and then build it back up. The goals are
- To understand how a complete 3D game engine works. In a world where we are asked to use massive frameworks, virtual machines, and black box libraries to build our programs, Quake is as close to the metal as a game running on an operating system can get. It’s programmed in C, uses device-independent graphics to write into its own screen buffer, and was fine tuned with assembly language in its original form. Now we will not be getting into assembly language, but the C we will be writing is as fast and bare-bones as possible.
- To serve as a community of fellow low level game programmers. Handmade Quake was born of the idea behind the Handmade Manifesto, a declaration of intent to learn to write code closer to the hardware, and to appreciate how hardware works, rather than attempting to abstract it away under a layer of OOP or functional languages. This project is part of the HandmadeDev community, which was itself inspired by Casey Muratori’s Handmade Hero, where he builds an original 2D game from scratch.
- To remove the black box so many programmers feel around low level programming, and show them the benefits of understanding how low they can go with their software. There’s a real passion among many programmers for low-level programming. It’s like optimization – there’s something sexy about it that makes us all want to really understand it. Who hasn’t heard stories about the young gun single programmer who stayed up all night working on a piece of code that everyone felt was going as fast as it could, but then getting an extra 30% speed out of? There’s a mystique there… but there really doesn’t need to be. Yes, optimization is a hard challenge, but it’s also not very well understood, and many programmers think that because they don’t understand it, it’s impossibly hard to understand. That’s not the case. This project will get you familiar with C, and as you get familiar, you will begin to understand how many other languages build up on top of it. You’ll start to get a peek into that black box of close-to-the-metal development.
How Long Will This Project Take?
To be entirely honest, I don’t know. At my current pace, which is two videos a week, I could see it easily taking between two and three years to cover everything. I’m envisioning a series of Modules that would leave you understanding literally everything about a basic game engine. We’re not just filling in the code, after all. I’m discussing topics like timing, 3D rendering, file management, and these topics are built into their own prototype projects. Perhaps, as I settle into the loop of Research-Program-Record I will be able to speed it up – I sincerely hope I can. But I’m starting right at the beginning of 2016, and so I expect to have a complete beginners guide to 3D game engines somewhere between the end of 2017 and the end of 2018.
That sounds like a long time, but if I were to record daily, which I don’t have the time to do right now, I could make it early 2017. We’ll see what the future holds.
Do I need to understand C to follow along?
It helps, but C syntax is quite similar to Java and C++ and many other languages, so if you have developed in just about anything, I’m hoping you don’t have too much trouble. The two biggest concerns I’ve heard from people so far about C is that it’s not object-oriented, and there are pointers, which can be quite difficult for someone to get without going over the material over and over, many, many times.
I could write an entire article on this, but my basic belief is that object-oriented programming’s entire paradigm is an attempt to abstract away the hardware you run on, and pointers are a fundamental hardware feature. So it’s not really a surprise, if you’ve only ever worked in OOP languages, that pointers feel tricky. C is not object-oriented, which means you may need to rethink how you approach development in it. The C paradigm has a nice cozy spot for pointers, and dumping OOP is the perfect time to familiarize yourself with them. I even recorded an entire video on pointers, and I tried to make it as helpful and easy to approach as possible.
Table of Contents
Handmade Quake is going to be broken up into three major sections. Each section will have many modules. We will begin primarily with the single player mode, particularly in order to get to things like the renderer sooner. Multiplayer involves deeper discussions about UDP and player prediction, which will be great conversations to have, but can more easily be covered once the full renderer is in place.
NOTE: I’m still developing the full table. The first section on the Host Program is set pretty well, but plans may change after that. I’ll update this to reflect it.
- Host Program – Where we discuss the actual instance of Quake that runs on your machine. This includes, but is not limited to…
- Introduction – Parsing the Command Line and the Quake Standard Library
- The Game Loop and Timing the Game Instance
- The Game Window and the Device-Independent Screen Buffer
- More to come… including input and an intro to sound
- Client/Server Model
- The internal Client/server structure used in both single and multiplayer
- Command-based messaging
- Game updating
- In-depth Rendering
- 3D Graphics
- Drawing the world
- Texture mapping, filling the screen
- Multiplayer mode
- UDP Packet delivery
- Prediction for slow connections
- Data serializing
Youtube Channel: All videos will be updated here
My blog: Updates will not necessarily be related to Handmade Quake, but will be related to programming.
Patreon: Interested in supporting the project? I have a donation page set up through Patreon.