war3map.w3e — Terrain / Environment
The terrain file stores the complete heightmap and tileset data for the map. The map is a grid of tiles; each tile has 4 corners called tilepoints. All geometry derives from tilepoints, not tile centres.
For a map of size W×H tiles there are (W+1)×(H+1) tilepoints, stored row by row from the bottom-left corner going right then up (when viewed from above).
File version
| Version | WC3 era |
|---|---|
| 11 | Classic RoC, TFT, pre-Reforged, Reforged 1.32 |
| 12 | Reforged 2.0+ |
Header
char[4] file ID "W3E!"
int version 0x0B = 11 (classic/TFT/Reforged), 0x0C = 12 (2.0+)
char main tileset single character (see table below)
int custom tilesets 1 = using custom tilesets, 0 = standard
int a number of ground tilesets used (max 16)
char[4][a] ground tileset IDs e.g. "Ldrt" = Lordaeron Summer Dirt
int b number of cliff tilesets used (max 16)
char[4][b] cliff tileset IDs e.g. "CLdi" = Lordaeron Cliff Dirt
int Mx map width + 1 (number of tilepoint columns)
int My map height + 1 (number of tilepoint rows)
float center offset X typically -(Mx-1)*128/2
float center offset Y typically -(My-1)*128/2
Main tileset codes
| Code | Tileset |
|---|---|
A |
Ashenvale |
B |
Barrens |
C |
Felwood |
D |
Dungeon |
F |
Lordaeron Fall |
G |
Underground |
I |
Icecrown |
J |
Dalaran Ruins |
K |
Black Citadel |
L |
Lordaeron Summer |
N |
Northrend |
O |
Outland |
Q |
Village Fall |
V |
Village |
W |
Lordaeron Winter |
X |
Dalaran |
Y |
Cityscape |
Z |
Sunken Ruins |
Ground tileset IDs are found in TerrainArt\Terrain.slk inside war3.mpq.
Cliff tileset IDs are found in TerrainArt\CliffTypes.slk.
OpenRealm uses the authored cliff list directly. Do not rebuild or sort it by the ground palette: Undead04 stores
CLgr,CVdi. Index 15 means no explicit type at that vertex. Retail checks a cell's SW, SE, NW, NE corners,
then a 5×5 vertex window centred on its SW corner (ascending X, then Y). The first non-15 index wins; if none
exists, retail uses index 0. OpenRealm logs that unresolved case. Undead04's river cells resolve to grass
slot 0, not dirt slot 1. Descriptions of the World Editor deriving a cliff list from ground tiles do not
establish a runtime reordering rule.
See Undead04 material verification.
Center offsets
The in-game coordinate origin (0,0) is placed at the map center. The offsets translate the tilepoint grid (whose raw origin is bottom-left) to this centered space:
One tile = 128 world-space units.
Tilepoint data (version 11: 7 bytes; version 12: 8 bytes)
Total tilepoints = Mx * My. Each tilepoint:
short ground height raw value; see formula below
short water level + flag boundary flag 1 is bit 14; low 14 bits are water level
byte/short flags + ground v11: flags in high nibble, ground index in low nibble
v12: flags in bits 6..15, ground index in bits 0..5
byte ground/cliff variation; field bit order changes in v12
byte cliff texture high nibble = index; low nibble = layer height
Version 11 uses 7 bytes per tilepoint. Version 12 uses 8 bytes: its ground/flag field is a ushort, allowing 64 ground tiles, and the ground/cliff variation bits are reversed. Do not decode version 12 with the 7-byte stride; this shifts every vertex after the first.
Ground height formula
0x2000(8192) = ground zero level- Layer 2 = layer zero; each layer step =
0x0200(512) raw units - Range:
0xC000(min, −16384) to0x3FFF(max, +16383); normal =0x2000
Water level formula
−89.6= water zero (fromWater.slk, height−0.7, scaled by 128)
Tilepoint flags
| Bit (in the full 2-byte group) | Value | Meaning |
|---|---|---|
| Bit 15 of water short | 0x8000 / 0x4000 |
Boundary flag 1 (WE shadow on map edge) |
| Flags field | 0x0010 (v11), 0x0040 (v12) |
Ramp flag |
| Flags field | 0x0020 (v11), 0x0080 (v12) |
Blight flag (Undead ground appearance) |
| Flags field | 0x0040 (v11), 0x0100 (v12) |
Water flag (enables water rendering) |
| Flags field | 0x0080 (v11), 0x0200 (v12) |
Boundary flag 2 (camera bounds area) |
Example tilepoint decode
Raw bytes: 51 21 00 62 56 84 13
ground height: 0x2151 = 8529
→ display = (8529 - 8192 + 1*512) / 4 = 212.25
water short: 0x6200
boundary flag 1: 0x6200 & 0xC000 = 0x4000 → SET
water level: 0x6200 & 0x3FFF = 0x2200 = 8704
→ display water = 8704/4 - 89.6 = 2086 - 89.6 = 38.4 (below ground, invisible)
byte 0x56:
flags nibble = 5 → water flag (0x40) + ramp flag (0x10) both set
ground texture = 6 → ground tileset index 6
byte 0x84:
texture detail = 0x84 = 132
byte 0x13:
cliff texture = 1 → cliff tileset index 1
layer height = 3
References
- Ground texture IDs:
TerrainArt\Terrain.slkinwar3.mpq - Cliff texture IDs:
TerrainArt\CliffTypes.slkinwar3.mpq - Water zero level:
TerrainArt\Water.slk - Version 12 changes (Reforged 2.0): see ChiefOfGxBxL/WC3MapSpecification
Terrain/12.md