WDT entity¶
The user-facing compound WDT — the assembly with everything baked in:
the main .wdt file plus every satellite file its era has, read and written
as one object. WDT is the abstract base; each expansion has a concrete
subclass (WDTVanillaToMop, WDTWod, …) exposing that version's layout —
the satellites appear as members only on the versions whose clients have
them (occlusion/lights since WoD, fogs since Legion 7.2.5,
particulates since BfA). Construct a concrete version with
for_version(expansion); read/write speak the filesystem gateway, which
locates the satellites by the {map}_occ.wdt naming convention up to 8.1
and by the MPHD FileDataIDs after. A satellite file the map does not have
stays default-empty and is not written back.
The main file (WDTRoot) and the four satellites are documented
field-by-field, with expansion and FourCC badges, on
WDT main file and Satellites.
The WDT assembly¶
WDT
¶
Bases: FileEntity
A whole map description, abstract over the client version — the main .wdt file and its era's satellite files (_occ/_lgt/_fogs/_mpv) as one entity. Construct the concrete version with WDT.for_version(expansion), then read()/write(); the per-version WDT* classes are subclasses. See https://wowdev.wiki/WDT.
read
¶
read(source: FileSystem, key: FileKey) -> None
Load the map description — the main file and every satellite present (_occ/_lgt/_fogs/_mpv) — from a client filesystem, replacing this entity's contents. Satellites are located by path convention pre-8.1 and by the MPHD FileDataIDs after.
for_version staticmethod¶
for_version(expansion: Expansion) -> WDT⟨version⟩Construct the concrete WDT for a client version — the abstract WDT is never instantiated directly. The return type narrows per expansion (a typed overload per Expansion member), so for_version(Expansion.Wotlk) returns a WDTWotlk; a runtime Expansion value yields the AnyWDT union.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
source
|
FileSystem
|
the filesystem gateway |
required |
key
|
FileKey
|
the main .wdt identity (path and/or FileDataID) |
required |
Returns:
| Type | Description |
|---|---|
None
|
nothing; raises on a missing file or malformed chunk stream |
write
¶
write(dest: FileSystem, key: FileKey) -> None
Serialize the main file and every engaged satellite through the filesystem's project overlay; satellite names derive from the key.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dest
|
FileSystem
|
the filesystem gateway |
required |
key
|
FileKey
|
the main .wdt identity; must resolve to a path |
required |
Returns:
| Type | Description |
|---|---|
None
|
nothing; raises when the key has no path or a file fails to write |
convert
¶
convert(target: Literal[Vanilla]) -> WDT⟨version⟩
convert(target: Literal[Tbc]) -> WDT⟨version⟩
convert(target: Literal[Wotlk]) -> WDT⟨version⟩
convert(target: Literal[Cata]) -> WDT⟨version⟩
convert(target: Literal[Mop]) -> WDT⟨version⟩
convert(target: Literal[Wod]) -> WDT⟨version⟩
convert(target: Literal[Legion]) -> WDT⟨version⟩
convert(target: Literal[Bfa]) -> WDT⟨version⟩
convert(target: Literal[Shadowlands]) -> WDT⟨version⟩
convert(target: Literal[Dragonflight]) -> WDT⟨version⟩
convert(target: Literal[TheWarWithin]) -> WDT⟨version⟩
convert(target: Expansion) -> AnyWDT
Rebuild this map description as the target expansion's concrete class, stepping the version ladder one adjacent release at a time (this instance is left unchanged). The return type narrows when the target is a literal.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target
|
Literal[Vanilla]
|
the expansion to convert to |
required |
Returns:
| Type | Description |
|---|---|
WDT⟨version⟩
|
the converted map; raises when a ladder step is not implemented |
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 |
WDT⟨version⟩
¶
Bases: WDT
A whole map description for one client version: the main .wdt file and its era's satellite files (_occ/_lgt since WoD, _fogs since Legion 7.2.5, _mpv since BfA) as one entity. Satellites locate by the "{map}_occ.wdt" naming convention up to 8.1 and by the MPHD FileDataIDs after; a missing satellite stays default-empty. An entity read from a client and left unmodified rewrites byte-for-byte. See https://wowdev.wiki/WDT.
occlusion
property
writable
¶
occlusion: WDTOcclusion⟨version⟩
The _occ.wdt occlusion satellite (WoD+); default-empty when the file does not exist.
lights
property
writable
¶
lights: WDTLights⟨version⟩
The _lgt.wdt lights satellite (WoD+); default-empty when the file does not exist.
fogs
property
writable
¶
fogs: WDTFogs⟨version⟩
The _fogs.wdt volumetric-fog satellite (Legion 7.2.5+); default-empty when the file does not exist.
particulates
property
writable
¶
particulates: WDTParticulates⟨version⟩
The _mpv.wdt particulate-volume satellite (BfA+); default-empty when the file does not exist.
validate
¶
Check the logical integrity contracts this object must satisfy to LOAD in the client — across the main file AND every engaged satellite — which write() deliberately never enforces. Call it before writing when you want to know the files will load. An object read from a client and left unmodified reports no errors.
Returns:
| Type | Description |
|---|---|
ValidationReport
|
every violated contract, each with its member path |
ValidationReport
|
("root..." / "occlusion..." / "lights..." / |
ValidationReport
|
"fogs..." / "particulates...") |
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 |
One layout per expansion, documented generically
The WDT layout is version-parametric — WDT<version> per expansion.
Every version shares the same field names; a field simply exists only
within its expansion range. The WDT main file and
Satellites pages document that generically rather than
repeating a dozen per-version class listings.
See the guide's Reading a map (WDT & WDL) for a worked example.