Skip to content

Data Loading

Current Target Shape

The World of Warcraft target is built as openwow. It links WoW-specific game, renderer, and UI libraries through the same selected-game runtime boundary as the Warcraft III and StarCraft II targets.

Build:

make openwow

Run with the Makefile sample path:

make run-wow

Direct run:

build/bin/openwow -data data/world-of-warcraft +map World/Maps/Azeroth/Azeroth.wdt

The current data path expects a locally supplied WoW client install or extracted/installable MPQs. The repository does not contain retail client data.

Installed Data Layout

The local workflow described by tools/README.md installs data under:

data/world-of-warcraft/

Useful archive examples:

  • model.MPQ
  • texture.MPQ
  • dbc.MPQ
  • terrain/world archives containing World/Maps/...

The WoW target reads files through the engine filesystem/archive layer. Keep tests and fixtures independent from a developer's local data folder unless the test is explicitly a manual asset experiment.

Map Entry

Wow_PrepareMap resolves the destination's Map.dbc/LoadingScreens.dbc background and title and writes the initial loading layout before WDT/ADT loading or entity spawning. The shared server retains its compressed layout and sends its image/font configstrings before svc_loading_screen chunks. Complete assembly registers the resources and presents immediately. The final svc_mirror "precache" after the full configstring and baseline pages permits world registration. UIWow_DrawLoadingScreenC remains an unused legacy menu helper. See the shared loading lifecycle and WC3 investigation.

The September 9 visual check also found two defects introduced with the initial-layout move (df68693c1): UI_SetFrameRect received pixel dimensions 1024×768 although it stores normalized dimensions. A bounded SCR_LayoutDrawTexture probe confirmed a valid image handle drawn into a 1024×768 normalized rectangle, showing only a magnified dark corner. The background now uses 1×1. The classic archive's bar texture is Interface/Glues/LoadingBar/Loading-BarFill.blp; Loading-Bar.blp was missing and displayed the error texture. Verify the authoritative asset with:

build/bin/mpqtool -mpq data/world-of-warcraft/interface.MPQ ls Interface/Glues/LoadingBar
build/bin/mpqtool -mpq data/world-of-warcraft/interface.MPQ imginfo Interface/Glues/LoadingBar/Loading-BarFill.blp

The map command accepts a WDT path:

World/Maps/<MapName>/<MapName>.wdt

Examples:

World/Maps/Azeroth/Azeroth.wdt
World/Maps/Kalimdor/Kalimdor.wdt

The common world path normalizes the map directory/name, then derives ADT paths:

World/Maps/<MapName>/<MapName>_<tile_x>_<tile_y>.adt

The coordinate helper maps world coordinates to the 64x64 ADT grid with 32.0 - coord / 533.333313.

DBC Files

The current code reads classic-style WDBC files for targeted lookups rather than full DBC/DB2 coverage.

Known useful files:

  • DBFilesClient\Map.dbc
  • DBFilesClient\WorldSafeLocs.dbc
  • DBFilesClient\CharStartOutfit.dbc
  • DBFilesClient\ItemDisplayInfo.dbc
  • DBFilesClient\CharSections.dbc
  • DBFilesClient\CharHairGeosets.dbc
  • DBFilesClient\CharHairTextures.dbc
  • DBFilesClient\HelmetGeosetVisData.dbc

Map.dbc and WorldSafeLocs.dbc are used for map metadata and spawn/safe-location lookup. Character display work uses the character and item DBCs listed above.

Classic-era DBCs can report a logical field count larger than record_size / 4. Do not reject the whole file for that alone; validate the envelope and check each accessed field against record_size.

See docs/dbc-reference.md for the WDBC container layout, the per-table field offsets, and the packed appearance/equipment bitfields.

Tools

Inspect MPQs:

build/bin/mpqtool -mpq data/world-of-warcraft/model.MPQ ls
build/bin/mpqtool -mpq data/world-of-warcraft/dbc.MPQ cat DBFilesClient\\Map.dbc

Inspect or preview M2 models:

build/bin/m2tool \
  -mpq data/world-of-warcraft/model.MPQ \
  -model "Character\\Orc\\Male\\OrcMale.m2" \
  --info

DBC-backed player configuration preview:

build/bin/m2tool \
  -mpq data/world-of-warcraft/model.MPQ \
  -mpq data/world-of-warcraft/dbc.MPQ \
  -mpq data/world-of-warcraft/texture.MPQ \
  -model "Character\\Orc\\Male\\OrcMale.m2" \
  --wow-player-config-only