WMO

From wowdev
Revision as of 00:08, 21 July 2007 by Malu05 (talk | contribs) (New page: == WMO Files == WMO files contain world map objects. They, too, have a chunked structure just like the WDT files. There are two types of WMO files, actually: * #WMO root file - li...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

WMO Files

WMO files contain world map objects. They, too, have a chunked structure just like the WDT files.

There are two types of WMO files, actually:

   * #WMO root file - lists textures (BLP Files), doodads (M2 or MDX Files), etc., and orientation for the WMO groups
   * #WMO group file - 3d model data for one unit in the world map object 

The root file and the groups are stored with the following filenames:

World\wmo\path\WMOName.wmo World\wmo\path\WMOName_NNN.wmo [edit]

WMO root file

The root file lists the following:

   * textures (BLP File references)
   * materials
   * models (M2 File references)
   * groups
   * visibility information
   * more data


MOHD chunk

Header for the map object. 64 bytes.

Offset 	Type 	Description
0x00 	uint32 	nTextures - number of textures (BLP Files)
0x04 	uint32 	nGroups - number of WMO groups
0x08 	uint32 	nPortals - number of portals
0x0C 	uint32 	nLights - number of lights
0x10 	uint32 	nModels - number of M2 models imported
0x14 	uint32 	nDoodads - number of doodads (M2 instances)
0x18 	uint32 	nSets - number of doodad sets
0x1C 	uint32 	ambient color?
0x20 	uint32 	WMO ID (column 2 in WMOAreaTable.dbc)
0x24 	float[3] 	Bounding box corner 1
0x30 	float[3] 	Bounding box corner 2
0x3C 	uint32 	always 0?
struct SMOHeader // 03-29-2005 By ObscuR
{
/*000h*/  UINT32 nTextures;		
/*004h*/  UINT32 nGroups;		
/*008h*/  UINT32 nPortals;		
/*00Ch*/  UINT32 nLights;		
/*010h*/  UINT32 nDoodadNames;		
/*014h*/  UINT32 nDoodadDefs;		
/*018h*/  UINT32 nDoodadSets;		
/*01Ch*/  float ambColor[6];		
/*020h*/ 
/*024h*/  	
/*028h*/  		
/*02Ch*/ 	
/*030h*/  float pos[2];		
/*034h*/  		
/*038h*/  		
/*03Ch*/   UINT32 wmoID;		
/*040h*/ 
};


MOTX chunk

List of textures (BLP Files) used in this map object. A block of zero-padded, zero-terminated strings, that are complete filenames with paths. There will be further material information for each texture in the next chunk. The gaps between the filenames are padded with extra zeroes, but the material chunk does have some positional information for these strings.

There are nTextures entries in this chunk.


MOMT chunk

Materials used in this map object, 64 bytes per texture (BLP file), nTextures entries.

Only the known fields are documented here.

Offset 	Type 	Description
0x00 	uint32 	Flags (?)
0x08 	uint32 	Blending: 0 for opaque, 1 for transparent
0x0C 	uint32 	Start position for the texture filename in the MOTX data block
0x18 	uint32 	End position for the texture filename in the MOTX data block
0x1C 	4 * uint8 	Looks like an RGBA color?
struct SMOMaterial // 03-29-2005 By ObscuR
{
/*000h*/  UINT32 version;		
/*004h*/  UINT32 flags;		
/*008h*/  UINT32 blendMode;		
/*00Ch*/  UINT32 diffuseNameIndex;		
/*010h*/  float sidnColor[3];		
/*014h*/  		
/*018h*/ 		
/*01Ch*/  UINT32 frameSidnColor[3];		
/*020h*/  	
/*024h*/   	
/*028h*/  UINT32 envNameIndex;
/*02Ch*/  float diffColor[3] 		
/*030h*/   		
/*034h*/  		
/*038h*/  UINT32 groundType;		
/*03Ch*/  UINT32 hMaps;		
/*040h*/ 		
}

The field that looks like a color value is green for some of the wooden textures in human buildings, so it is obviously not a texture color. So its purpose is unknown.

The flags might used to tweak alpha testing values, I'm not sure about it, but some grates and flags in IF seem to require an alpha testing threshold of 0, at other places this is greater than 0.

Flag 	Meaning
0x01 	 ?
0x04 	Two-sided (disable backface culling)
0x10 	Bright at night (unshaded) (used on windows and lamps in Stormwind, for example) -ProFeT: i think that is Unshaded becase external face of windows are flagged like this.
0x20 	 ?
0x28 	Darkned ?, the intern face of windows are flagged 0x28
0x40 	 ?
0x80 	 ?


MOGN chunk

List of group names for the groups in this map object. A contiguous block of zero-terminated strings. The names are purely informational, they aren't used elsewhere (to my knowledge)

There are nGroups entries in this chunk.


MOGI chunk

Group information for WMO groups, 32 bytes per group, nGroups entries.

Offset 	Type 	Description
0x00 	uint32 	Flags
0x04 	3 * float 	Bounding box corner 1
0x10 	3 * float 	Bounding box corner 2
0x1C 	int32 	name offset in MOGN chunk (or -1 for no name?)

Groups don't have placement or orientation information, because the coordinates for the vertices in the additional .WMO files are already correctly transformed relative to (0,0,0) which is the entire WMO's base position in model space.

The name offsets seem to be incorrect (or something else entirely?). The correct name offsets are in the WMO group file headers. (along with more descriptive names for some groups)

The flags for the groups seem to specify whether it is indoors/outdoors, probably to choose what kind of lighting to use. Not fully understood. "Indoors" and "Outdoors" are flags used to tell the client whether certain spells can be cast and abilities used. (Example: Entangling Roots cannot be used indoors).

Flag 	Meaning
0x8 	Outdoor (use global lights?)
0x40 	 ?
0x80 	 ?
0x2000 	Indoor (use local lights?)
0x8000 	Unknown, but frequently used
0x10000 	Used in Stormwind?
0x40000 	Show skybox if the player is "inside" the group