Rendering the Color Palette

Last time I stopped after getting the WAD loader up and running. I could open a WAD file, parse the header, read the directory, and extract individual lumps. The next natural step was to look at one of those lumps in detail. I decided to start with PLAYPAL, the color palette that defines every color Doom uses. Understanding the PLAYPAL Lump The PLAYPAL lump stores 14 palettes. Each palette has 256 colors, and each color is three bytes: red, green, blue. That means each palette is 256 × 3 = 768 bytes, and the whole lump is 14 × 768 = 10 752 bytes. ...

October 26, 2025

Building a Minimal Doom WAD Loader

I wanted to learn how Doom’s WAD files work, so I wrote a simple loader. My goal was just to understand how a WAD is structured, open it and read its contents. WAD File Overview A WAD file (“Where’s All the Data”) is Doom’s archive format. It stores maps, textures, sprites, palettes, and other data. The layout is straightforward: ┌──────────────────────────────────────────┐ │ Header (12 bytes) │ │ ├── 4 bytes: "IWAD" or "PWAD" │ │ ├── 4 bytes: Lump count (little-endian) │ │ └── 4 bytes: Directory offset (LE32) │ │ │ │ Lump data... │ │ │ │ Directory (16 bytes per entry): │ │ ├── 4 bytes: Lump position │ │ ├── 4 bytes: Lump size │ │ └── 8 bytes: Lump name (null-padded) │ └──────────────────────────────────────────┘ Each WAD starts with a header that tells me how many “lumps” there are and where the directory is. The directory is a list of fixed-size entries that point to each lump’s position and size in the file. ...

October 24, 2025
DOOM Logo

Building the DOOM Engine from Scratch: A Learning Journey

I’ve been reading Fabien Sanglard’s Game Engine Black Book: DOOM, and honestly, it has blown my mind. The book breaks down all the clever tricks behind id Software’s masterpiece and makes you appreciate just how insanely talented those early developers were. Reading about BSP trees, sub-pixel accuracy and perspective-correct texture mapping has me itching to build something myself. So that is exactly what I am going to do. I am starting an id Tech 1 engine recreation project in C++. This is not about making a game. It is about learning by doing, understanding how everything works under the hood, and gaining a deeper appreciation for the engineering genius Sanglard documents so well. I want to implement the core systems from scratch and see firsthand how they all fit together. ...

September 19, 2025

Hello World!

My earliest gaming memory is sitting on my dad’s lap at four or five, firing the shotgun in DOOM while he handled the movement. I had no idea what I was doing, and I’m pretty sure the game was way too intense for a toddler. Even so, I remember staring at the screen and being completely fascinated, caught up in this strange new world I didn’t fully understand but couldn’t look away from. ...

September 19, 2025