Skip to content

war3map.doo Doodads

Stijn Herfst edited this page Aug 11, 2020 · 12 revisions

The file contains the definitions for all doodads including destructables.

Format

Here is the file format:

char[4]		magic_number
int32		format_version
int32		format_subversion?
int32		doodads_count

And then doodads_count doodad structures of variable length (usually 50 bytes).

char[4]		doodad_id
uint32		variation
float		x_position
float		y_position
float		z_position
float		rotation_angle
float		x_scale
float		y_scale
float		z_scale
if (game_version >= 1.32) {
	char[4]		skin_id
}
uint8		flags
uint8		life
uint32		item_table_pointer
uint32		item_sets_count
ItemSet[]	item_sets
uint32		world_editor_id

The above structure is variable in length due to the ItemSets which are repeated item_sets_count and look like this:

uint32		sets_count
char[4]		item_id
uint32		item_chance

Where item_id and chance are repeated sets_count times.

Anything to do with item sets is not present in file version 7


After the last normal doodad definitions there are terrain doodads (those which can't be edited once they are placed). This includes anything from the Cliff/Terrain tab in the doodads palette.

uint32		terrain_format_version
uint32		terrain_doodads_count

Then terrain_doodads_count times a special doodad structure:

char[4]		terrain_doodad_id
uint32		terrain_variation
uint32		terrain_x_position
uint32		terrain_y_position

Explanation

char[4]		magic_number

The constant string "W3do" at the start of the war3map.doo used to identify it.

int32		format_version

The version where 8 or higher signals that it is the TFT format.

int32		format_subversion?

Unknown, seems to be "0B 00 00 00".

int32		doodads_count

The amount of doodads.

Doodad

char[4]		doodad_id

The id of the doodad. Look in "Units\DestructableData.slk" and "Doodads/Doodads.slk" for their specific info like what model to load.

uint32		variation

The variation of the model. Append this to the model name you extract with the doodad_id.

float		x_position
float		y_position
float		z_position

The position in game coordinated. (Relative to horizontal_offset and vertical_offset from war3map.w3e)

float		angle

The rotation of the doodad in radians.

float		x_scale
float		y_scale
float		z_scale

The amount the model needs to be scaled by.

uint8		flags

The flags keep some info on how the tree will behave. You can for instance have visible trees that you are able to walk through.

0 = Invisible and non-solid tree
1 = Visible but non-solid tree
2 = Normal tree (visible and solid)

uint8		life

The percentual life of the doodad.

uint32		item_table_pointer

If this value is -1 then it doesn't point to anything. Otherwise >= 0 then items from the item table with this number are dropped on death. These item tables are defined in defined in war3map.w3i.

uint32		item_sets_count

The amount of custom item sets. This value should only be nonzero if item_table_pointer is -1. If nonzero then item_sets_count amount of ItemSet structures follow.

ItemSet		item_sets

The item sets from which the doodad can drop items when it dies.

uint32		world_editor_id

Unique doodad id used by the World Editor.

Item Set

uint32		sets_count

Amount of items in this item set. Following this are sets_count amount of item_id and item_chance. When the doodad dies one item from each item set is chosen to possibly drop.

char[4]		item_id

The id of the item which you can use to find more information in "Units/ItemData.slk".

uint32		item_chance

The percentual chance of this item being picked in the item set.

Terrain Doodad

uint32		terrain_format_version

Seems to always be 0.

uint32		terrain_doodads_count

Amount of special doodad structures each one measuring 16 bytes.

char[4]		terrain_doodad_id

The id used to look up more doodad details in the slk files.

uint32		terrain_variation

Seems to be an unused variation parameter. Always 0?

uint32		terrain_x_position
uint32		terrain_y_position

The position of the doodad relative to the bottom left corner. This value is in whole grid cells.