Introduction
This is the model format of Quake, released by id Software in 1996, used for monsters, weapons, items and the player. A model is a single mesh animated by storing the position of every vertex in every frame. Its skins, the textures wrapped around it, are 8-bit images in Quake’s 256-colour palette, stored inside the model file.
The Quake source code was released under the GPL in 1999, and the format is still used by Quake engine ports and the games and mods built on them. It was followed by MD2 in Quake II. Half-Life’s studio models share the extension but not the format.
Structure
A Quake MDL file is binary and little-endian. The header starts with
IDPO and version 6, then gives a scale and an origin used to unpack the
vertices, a bounding radius, the eye position, the counts of skins, vertices,
triangles and frames, the skin size, and flags such as the rocket trail an object
leaves.
The skins follow, each a block of palette indices, or a group of skins that animate. Then come the texture coordinates, with a flag for vertices on the seam between the front and back of the skin, the triangles, each with a flag saying whether it faces front, and the frames. Each frame stores every vertex as three bytes plus a byte choosing a normal from a fixed table, and a frame can also be a group of frames that play in a loop.
0HeaderIDPO, version 6, scale, origin, counts, flags84 bytes84Skins 8-bit palette imagesvaries…Texture coordinates seam flag, s, t12 bytes each…Triangles front flag, three vertex indices16 bytes each…Frames packed vertices for each framevaries
In this reference
- Header and data – every header field, sync types and effect flags, skins and skin groups, texture coordinates and the seam rule, triangles, frames and frame groups, with a worked example
- Normal table – the 162 vertex normals, shared with Quake II’s MD2
Not described
Known, not yet covered
- Viewer: there is no viewer for Quake models yet, so a dropped file is recognised by its
IDPOsignature and shown as bytes.
Other formats that use .mdl
The Quake model is a different format from Valve’s studio models: they share only the extension.
- Half-Life model (IDST) – Valve’s skeletal model for Half-Life (GoldSrc): bones, sequences and hit boxes
- Source engine model – Valve’s studio model for Source, versions 44 to 49, with vertex and strip files
Links
Software
- QuakeSpasm – Quake engine port that plays Quake and its mods (Windows, macOS, Linux)
Developers
- Quake source code – id Software’s engine code under the GPL, including the model loader (C)
- Assimp – library that imports dozens of 3D formats, Quake MDL among them (C++)
Reference
- modelgen.h – the Quake header file that defines the model structures
- Unofficial Quake Specs: Alias models – the community’s 1996 description of the format