Introduction
A .wad file holds the data of a game built on the Doom engine, which
id Software wrote for Doom (1993) and Doom II
(1994). Raven Software’s Heretic and Hexen and Rogue Entertainment’s Strife use the same
engine and the same file format. The name is said to stand for “Where’s All the Data?”.
A WAD is a simple archive. It holds lumps: pieces of data with an eight-character name,
such as a map, a picture, a sound or a song. A directory at the end of the file lists
them. The game’s own data file is an IWAD (“internal WAD”), such as
DOOM.WAD or DOOM2.WAD. Players’ maps and mods are PWADs
(“patch WADs”), loaded over the IWAD: a lump in a PWAD replaces the IWAD’s lump of the
same name.
Structure
All numbers are little-endian. The file starts with a 12-byte header. The lumps’ data follows, in any order, and the directory comes last, though the header can point to it anywhere.
0TypeIWADorPWAD4 bytes4Lump count entries in the directory4 bytes8Directory offset where the directory starts4 bytes12Lump data the lumps, one after anothervaries…Directory offset, size and name of each lump16 bytes a lump
The directory gives each lump only a name, an offset and a size. What a lump holds is
known from its name and from where it stands in the directory. Empty marker lumps such as
S_START and S_END bracket the sprites, and a map is a marker
lump, such as E1M1 or MAP01, followed by its ten lumps in a
fixed order.
| Lumps | What they hold |
|---|---|
E1M1, MAP01 and the lumps after them | A map: things, lines, sides, vertices, sectors and the node tree |
PLAYPAL, COLORMAP | The palettes and the light-level tables |
Sprites between S_START and S_END, wall patches, screens | Pictures in the column-post format |
Between F_START and F_END | Flats: 64 × 64 floor and ceiling pictures |
TEXTURE1, TEXTURE2, PNAMES | Wall textures, put together from patches |
DS…, DP…, GENMIDI | Sound effects and the OPL instrument bank |
D_… (Doom), MUS_… (Heretic) | Music in the MUS format |
DEMO1 to DEMO4 | Recorded games |
ENDOOM | The text screen shown on quitting |
A .wad file dropped on any page of this site opens in the explorer. It lists
every lump with what it is, draws each map from above with its lines and things, draws
the pictures, flats, sprites, textures and the ENDOOM screen with the WAD’s own palette,
plays the sounds, shows the music as notes and opens it as a standard MIDI file, and
reads the demos tic by tic. Each picture’s posts can be picked out pixel by pixel and
byte by byte. A PWAD has no palette of its own unless it adds one, and its pictures are
then drawn in grey.
IWAD and PWAD
The two kinds have the same layout and differ only in their first four bytes and in how the game uses them. The game loads one IWAD, then any PWADs named on its command line, and looks lumps up by name from the last loaded back, so a PWAD’s lump wins. Doom itself only lets a PWAD replace some kinds of lump: maps and sounds always work, while sprites and flats in a PWAD need a source port or a tool that merges them into the IWAD. The explorer reads the two kinds the same way.
In this reference
- Header and directory – the 12-byte header, the 16-byte directory entries, names, markers and namespaces
- Map lumps – THINGS, LINEDEFS, SIDEDEFS, VERTEXES, SEGS, SSECTORS, NODES, SECTORS, REJECT and BLOCKMAP, in Doom’s and Hexen’s formats
- Picture format – the header, column offsets and posts of sprites, patches and screens
- Flats – floors and ceilings, and raw full-screen pictures
- Textures – PNAMES and TEXTURE1 and TEXTURE2, and how a texture is put together
- Palettes and ENDOOM – PLAYPAL, COLORMAP, translucency tables and the quit screen
- Sounds – DMX digital sounds, PC speaker sounds and GENMIDI
- MUS music – the header, the events and how they become MIDI
- Demos – the header and the tics of a recorded game
- Game differences – what Doom, Doom II, Heretic, Hexen and Strife do differently
Links
Software
- SLADE – editor for WAD files and their lumps: pictures, sounds, textures, maps and text (Windows, macOS, Linux)
- Chocolate Doom – source port that plays Doom, Heretic, Hexen and Strife as the original games did (Windows, macOS, Linux)
- GZDoom – source port that plays Doom engine games and mods, with many additions to the format (Windows, macOS, Linux)
- Freedoom – free IWADs that replace Doom’s and Doom II’s data
Developers
- Doom source code – id Software’s 1997 release of the Linux version, which reads every lump described here (C)
- Omgifol – library that reads and writes WAD files, maps, pictures and sounds (Python)
Reference
- The Unofficial Doom Specs – Matthew Fell’s 1994 description of the WAD format and its lumps
- WAD on the Doom Wiki – the format, its history and the lumps of each game