WLW

From wowdev
Jump to navigation Jump to search

These files are used for all of World of Warcraft's water. For each contained body of water in the game (except for the oceans) there exists one of these files. There is also a WLQ file located at the exact same file and pathname as the .wlw files. Little else is known about this file format...

Header

Type		Name			Description
char[4]		Identifier		"*QIL"
int16		Used			1 if data is in the file.
int32		Version			always 01000400
int16		Unknown			always 0
int32		nCount			how many liquids are in this chunk
int32?		Unknown			?

Below is a struct based on the known information of this file. This may not be correct.

struct Header
{
 char magic[4];       // LIQ*
 uint16_t version;    // 0, 1, 2
 uint16_t unk_06;     // always 1
 uint16_t liquidType; // version ≤ 1 some enum similar to SMChunkFlags, version 2 = DB/LiquidType ID
 uint16_t padding;    // more likely that liquidType is a uint32_t
 uint32_t count;  	
 Block blocks[count];
 
 uint32_t count_2;    // only seen in 'world/maps/azeroth/test.wlm'
 struct block_2 
 {
   C3Vector _unk00;
   C2Vector _unk0C;
   char _unk14[0x38]; // 4 floats then 0 filled in the above
 }[count_2];
 
 #if version ≥ 1
  char unknown;       // mostly 1
 #endif
}

Data

  • nCount blocks of 0x168 bytes.
Type		Name			Description
float[16][3]	heights			a height map for this section of the water
uint16[54]?	unk			?
struct Block {
 C3Vector vertices[0x10];
 C2Vector coord;   // internal coords
 uint16_t data[0x50]; 
}

Height Map

The first 0xC0 bytes are made of 48 float's that make up 16 vertices ( z-up ) arranged in a grid that starts in the lower right corner.

15	14	13	12

11	10	9	8

7	6	5	4

3	2	1	0

When all the chunks are combined, they form a height map of the water, similar to those in the ADT's

Unknown

The rest of the block seems to be made of 2 floats ( always integers ) and 40 uint32's.

--Riraito 03:00, 25 July 2008 (CDT)