From Source Peek Wiki
The file contains the trees definitions and positions for doodads.
Reign of Chaos Format
Header
| Type | Description |
|
| char[4]
| file ID = "W3do"
|
| int
| file version = 7
|
| int
| unknown (usually set to [09 00 00 00]h, rarely [07 00 00 00]h)
|
| int
| number of trees defined
|
Data
Each tree is defined by a block of 42 bytes organized like this.
| Type | Description |
|
| char[4]
| Tree ID (can be found in the file "Units\DestructableData.slk")
|
| int
| Variation (little endian)
|
| float
| Tree X coordinate on the map
|
| float
| Tree Y coordinate on the map
|
| float
| Tree Z coordinate on the map
|
| float
| Tree angle (radian angle value)(degree = radian*180/pi)
|
| float
| Tree X scale
|
| float
| Tree Y scale
|
| float
| Tree Z scale
|
| byte
| Tree flags (see below)
|
| byte
| Tree life (integer stored in %, 100% is 0x64, 170% is 0xAA for example)
|
| int
| Tree ID number in the World Editor (little endian) (each tree has a different one)
|
Flags
- 0 = invisible and non-solid tree
- 1 = visible but non-solid tree
- 2 = normal tree (visible and solid)
To sum up how it looks:
tt tt tt tt vv vv vv vv xx xx xx xx yy yy yy yy zz zz zz zz aa aa aa aa xs xs xs xs ys ys ys ys zs
zs zs zs ff ll dd dd dd dd
The values are:
- tt: type
- vv: variation
- xx: x coordinate
- yy: y coordinate
- zz: z coordinates
- aa: rotation angle
- xs: x scale
- ys: y scale
- zs: z scale
- ff: flags
- ll: life
- dd: doodad number in the editor
Example (this is the second tree of Legend):
4C 54 6C 74 08 00 00 00 00 00 74 45 00 00 70 44 00 10 24 44 E5 CB 96 40 98 85 98 3F 98 85 98 3F 98 85 98 3F 02 64 8D 01 00 00
4C 54 6C 74 --> LTlt (tree type)
08 00 00 00 --> 00000008 = variation #8 (changes the shape of the tree)
00 00 74 45 --> X=3904.
00 00 70 44 --> Y=960.
00 10 24 44 --> Z=656.25
E5 CB 96 40 --> Angle (float value=4.7123895, angle=270°)
98 85 98 3F --> X_Scale=1.191577
98 85 98 3F --> Y_Scale=1.191577
98 85 98 3F --> Z_Scale=1.191577
02 --> tree is solid and selectable
64 --> life=100% of default tree life
8D 01 00 00 --> 0000018D=397, tree number 397
After the last tree definition, there are 4 bytes set to '0' (dunno if it's a version or not).
| Type | Description |
|
| int
| N times "special" doodads ("special" like cliffs,...)
|
Then N times a special doodad structure (16 bytes each):
| Type | Description |
|
| char[4]
| doodad ID
|
| byte[4]
| ? (0)
|
| int
| X? (w3e coordinates)
|
| int
| Y? (w3e coordinates)
|
Frozen Throne Format
Header
| Type | Description |
|
| char[4]
| file ID = "W3do"
|
| int
| file version = 8
|
| int
| unknown ([0B 00 00 00]h)
|
| int
| number of trees defined
|
Data
Each tree is defined by a block of 50 bytes.
| Type | Description |
|
| char[4]
| Tree ID (can be found in the file "Units\DestructableData.slk")
|
| int
| Variation (little endian)
|
| float
| Tree X coordinate on the map
|
| float
| Tree Y coordinate on the map
|
| float
| Tree Z coordinate on the map
|
| float
| Tree angle (radian angle value)(degree = radian*180/pi)
|
| float
| Tree X scale
|
| float
| Tree Y scale
|
| float
| Tree Z scale
|
| byte
| Tree flags (see below)
|
| byte
| Tree life (integer stored in %, 100% is 0x64, 170% is 0xAA for example)
|
| int
| unknown (-1)
|
| int
| unknown (0)
|
| int
| Tree ID number in the World Editor (little endian) (each tree has a different one)
|
Flags
- 0 = invisible and non-solid tree
- 1 = visible but non-solid tree
- 2 = normal tree (visible and solid)
To sum up how it looks:
tt tt tt tt vv vv vv vv xx xx xx xx yy yy yy yy zz zz zz zz aa aa aa aa xs xs xs xs ys ys ys ys zs
zs zs zs ff ll bb bb bb bb cc cc cc cc dd dd dd dd
Where:
- tt: type
- vv: variation
- xx: x coordinate
- yy: y coordinate
- zz: z coordinates
- aa: rotation angle
- xs: x scale
- ys: y scale
- zs: z scale
- ff: flags
- ll: life
- bb: unknown
- cc: unknown
- dd: doodad number in the editor