Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Format:WAD3 (GoldSrc)

From ReverseEngineering.wiki
Format
Developer Valve
Versions WAD2 (Quake), WAD3 (Half-Life)
Magic 57 41 44 33 ("WAD3") at offset 0
Extensions .wad
Endianness little
On this wiki Facts · Code · Notes · Topics

Texture archive of GoldSrc (Half-Life 1) engines: the Quake WAD2 container (12-byte header, 32-byte directory entries) with the identification WAD3 and miptex, palette and font lumps.

Identification

The first four bytes are WAD3 (Half-Life) or WAD2 (Quake). The Half-Life SDK tool library accepts both ids and its writer sets the fourth character to '3' when asked for a WAD3 (utils/common/wadlib.c). Do not confuse it with the Doom container (Format:WAD (Doom engine)), which has a different directory layout.

Layout

wadinfo_t { char identification[4]; int numlumps; int infotableofs; } (12 bytes), and the directory at infotableofs is numlumps entries of lumpinfo_t { int filepos; int disksize; int size; char type; char compression; char pad1, pad2; char name[16]; } (32 bytes; size is the uncompressed size, the name must be NUL terminated). Compression constants: CMP_NONE 0, CMP_LZSS 1. Type constants in the SDK: TYP_NONE 0, TYP_LABEL 1, TYP_LUMPY 64 (64 plus the grab command number).

Lump types

Unverified: in WAD3 files the types seen in the wild are 0x40 (64) palette, 0x42 (66) qpic, 0x43 (67) miptex, 0x46 (70) font; a miptex lump is the miptex_t of Format:BSP (GoldSrc) (name[16], width, height, four mip offsets) followed by the mips and a 256-colour RGB palette. These values come from community documentation, not from the SDK files read here; verify by listing a stock halflife.wad directory.

Code & repositories

  • https://github.com/ValveSoftware/halflife @ b1b5cf5892918535619b2937bb927e46cb097ba1 · license: LicenseRef-Valve-Half-Life-SDK (declared by the contributor; GitHub's detector did not recognize LICENSE)
    Half-Life 1 SDK: utils/common/bspfile.h and wadlib.h/.c (BSP v30, WAD2/WAD3), engine/studio.h and utils/studiomdl/studiomdl.h (MDL v10). Valve SDK license, not open source.
    Tested on: source read, not run · checked 2026-10-18; last activity 2024-10-02

Evidence & references

ValveSoftware/halflife utils/common/wadlib.h lines 17-41 and wadlib.c lines 62-64, 313-329 at commit b1b5cf5892918535619b2937bb927e46cb097ba1.