WDT main file¶
The main .wdt file holds the map-wide header (MPHD), the 64 × 64 tile table
(MAIN) saying which tiles have terrain, since 8.1 the per-tile FileDataID
table (MAID), and — for WMO-only maps — the single global map object
(MWMO/MODF). It is version-parametric: the layout differs by client version,
which wowlib models as one WDTRoot<version> per expansion (Python:
WDTRootVanillaToLegion, WDTRootBfa, WDTRootShadowlandsPlus). This page
documents the generic model, shown as WDTRoot⟨version⟩.
Each field carries its chunk FourCC (linking to wowdev.wiki). A field whose availability is version-restricted also carries an expansion badge (both ends inclusive); a field with no badge exists in every supported version. The badges are generated from the C++ sources, so they cannot drift.
The WDTRoot base¶
WDTRoot
¶
A WDT main file, abstract over the client version. The main file says which map tiles exist (and, since 8.1, which FileDataIDs serve them), or references the one global WMO of an object-only map. Construct a concrete version with WDTRoot.for_version(expansion); the per-version WDTRoot* classes are subclasses. See https://wowdev.wiki/WDT.
for_version staticmethod¶
for_version(expansion: Expansion) -> WDTRoot⟨version⟩Construct the concrete WDTRoot for a client version — the abstract WDTRoot is never instantiated directly. The return type narrows per expansion (a typed overload per Expansion member), so for_version(Expansion.Wotlk) returns a WDTRootWotlk; a runtime Expansion value yields the AnyWDTRoot union.
validate
¶
Check the logical integrity contracts this file must satisfy to LOAD in the client, which write() deliberately never enforces. Call it before writing when you want to know the result will load. A file read from a client and left unmodified reports no errors; warnings mark states real client files ship.
Returns:
| Type | Description |
|---|---|
ValidationReport
|
every violated contract, each with its member path |
ensure_valid
¶
Validate and raise on the first error instead of returning a report — the assert-style face of validate().
Returns:
| Type | Description |
|---|---|
None
|
nothing; raises when validate() finds any error |
Fields¶
Header¶
The file version, the map-wide header and the Shadowlands anima paths.
mver
property
writable
¶
The WDT format version; 18 for every supported client.
header
property
writable
¶
header: WDTHeader⟨version⟩
The map header (MPHD): flags and, since 8.1, the satellite FileDataIDs.
Tile table¶
Which of the 64 x 64 map tiles exist, and (since 8.1) the FileDataIDs serving each.
tiles
property
¶
tiles: list[SMAreaInfo]
The tile table (MAIN): 64 x 64 records in row-major order (y outer, x inner), flagging which tiles have an ADT.