Download the app

Scan. It's in your pocket.

QR Code — Dygest

Open the Camera app and point it at the code. Free to try.

Game Engine Black Book

Game Engine Black Book

How Doom's engine changed gaming

Listen to the podcast excerpt:
0:00 --:--

Description

In December 1993, a small studio in Mesquite, Texas, uploaded a shareware file to a University of Wisconsin server, and the network reportedly buckled under the demand. The game was Doom. The studio was id Software — barely more than half a dozen people. What they had shipped ran on the ordinary office computers of the day, a 386 or 486 with a few megabytes of memory, and it moved through corridors and rooms at a speed nobody quite believed was possible on that hardware. Fabien Sanglard's Game Engine Black Book takes that machine apart, line by line, to explain how.

Sanglard is a programmer who spent years reverse-engineering and documenting the code id released to the public. His book is not a nostalgia trip through a beloved game. It is an autopsy of the software underneath it — the memory manager, the rendering pipeline, the networking, the tricks that let a modest processor draw a convincing three-dimensional world thirty-five times a second. He reconstructs the constraints the id programmers faced and shows, in code and diagrams, the specific decisions they made to beat them.

The engine that resulted, later called id Tech 1, did something rarer than power a hit game. It became a thing in itself — copied, licensed, studied, and eventually released as open source. Doom the game had its moment; the engine kept working long after. Sanglard's book is really about that second life, and about what it takes to build software so tight it survives the deadline it was born under.

The question we’re asking : How did a handful of programmers make a fast three-dimensional world run on the plain office hardware of 1993 — and why did the engine underneath outlast the game?What we’ll see : How the constraints of early-nineties machines shaped one of the most consequential pieces of code in gaming, and what happened to it afterward.

Table of contents

01

Chapter 1 — A team, a deadline, and a 386

The hardware id was writing for in 1992 and 1993 was not gaming hardware. It was whatever machine sat on an office desk — an Intel 386 or 486, a few megabytes of RAM, a VGA card that could show 256 colors, and a hard drive measured in megabytes, not gigabytes. There was no graphics accelerator doing the heavy lifting; everything the player saw had to be computed by the main processor. Sanglard's book keeps returning to this ceiling, because every clever thing in the engine exists to get under it.

The team was tiny and the roles were sharp. John Carmack owned the engine — the code that turned a map and a viewpoint into pixels. John Romero built levels and pushed the game design. Others handled tools, art, and the business. Sanglard is careful to show this as collaboration rather than a solo act of genius: the engine only mattered because someone was designing the spaces it drew and building the tools to make them. But the technical spine, the part that had to be fast, was Carmack's, and the book treats his code as its main character.

Download Dygest

for the full experience!

02

Chapter 2 — The trick that made the walls move

The centerpiece of Sanglard's technical account is a structure called the binary space partitioning tree — a BSP tree. The problem it solves is ancient in computer graphics: when you look at a scene, some surfaces are in front of others, and you must draw them in the right order so the near ones cover the far ones. Doing that comparison for every wall, every frame, was far too slow for a 386. The BSP tree let the engine do most of that work once, ahead of time, and then reuse it.

The idea, which id adapted from earlier academic work, is to slice a level into pieces along the planes of its walls and store those pieces in a tree. Because the slicing is fixed, the engine can walk the tree from any viewpoint and instantly produce the surfaces in the correct front-to-back order. The expensive geometry was computed when the level was built, not while the player was running through it. Sanglard shows how this shifted the cost from the player's machine, which had none to spare, to the level designer's machine, which could take its time.

Download Dygest

for the full experience!

03

Chapter 3 — Selling it as a phone call

Doom is remembered as much for how people played it together as for how it looked, and Sanglard gives the networking its own careful treatment. The engine could connect several machines so that players moved through the same level at the same time — either shooting monsters cooperatively or, more famously, shooting each other in what the game called deathmatch. On the office networks of the mid-nineties, this was the feature that turned a game into a social event and, quietly, into a problem for IT departments.

The technical approach was blunt and effective. Rather than have one machine act as the authority, every copy of the game ran the same simulation, and the machines exchanged only the players' inputs — which way each person was moving, when they fired. Because every machine ran identical code on identical inputs, they stayed in step without shipping the whole world back and forth across a slow connection. Sanglard shows why this demanded absolute determinism: the same input had to produce exactly the same result on every machine, or the games would silently drift apart.

Download Dygest

for the full experience!

04

Chapter 4 — The engine outlived the game

What makes id Tech 1 unusual, in Sanglard's telling, is that it stopped being tied to Doom at all. id had learned this lesson with Wolfenstein and pushed it further: the engine and the content were separable. The game was data — maps, textures, monster behavior — fed into a general machine that knew how to render and simulate. Once that separation is clean, the machine can run other games entirely, and it did. id licensed the engine to other studios, who shipped their own titles on it while id moved on to build the next one.

This is the deeper subject of the book. A rendering engine is normally invisible infrastructure, thrown away when the next hardware generation arrives. id Tech 1 instead became a durable, reusable artifact — something with a life independent of any single product. When id released the source code in the late nineties, that life extended again: hobbyists ported it to hardware it was never meant to touch, fixed and extended it, kept it running long after the machines it targeted had gone to landfill. Sanglard's own book exists because that code was made public and could be read.

Download Dygest

for the full experience!

05

Conclusion

The file that overwhelmed a Wisconsin server in December 1993 contained a game, but Sanglard's book insists on looking past it to the machine underneath — the memory manager that never waited, the BSP tree that decided what to skip, the lockstep networking that let two office computers share a room. Each was an answer to a hard limit, and the limits were what forced the answers to be so clean. Doom was the occasion; the engine was the achievement, and it is the engine the book restores to view.

Download Dygest

for the full experience!