WLW: Difference between revisions

From wowdev
Jump to navigation Jump to search
m (→‎Header: added liquid type enum for v1)
mNo edit summary
Line 1: Line 1:
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...
These files are found for all of World of Warcraft's water however are not read by any version of the client. For each contained body of water in the game (except for the oceans) there exists one of these files which documents it's heightmap ('''W'''ater '''L'''evel '''W'''ater). Since release, 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==
==Header==


'''Type Name Description'''
Below is a structure based on the known information of this file. This may not be correct.
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
  struct Header
Line 17: Line 9:
   char magic[4];      // LIQ*
   char magic[4];      // LIQ*
   uint16_t version;    // 0, 1, 2
   uint16_t version;    // 0, 1, 2
   uint16_t _unk06;    // always 1
   uint16_t _unk06;    // always 1, probably also part of version
   uint16_t liquidType; // version ≤ 1 {{Template:Unverified|LiquidType}}, version 2 = [[DB/LiquidType]] ID
   uint16_t liquidType; // version ≤ 1 {{Template:Unverified|LiquidType}}, version 2 = [[DB/LiquidType]] ID
   uint16_t padding;    // more likely that liquidType is a uint32_t
   uint16_t padding;    // more likely that liquidType is a uint32_t
   uint32_t count;
   Block blocks[count];
   uint32_t block_count;
  struct block
  {
    {{Template:Type|C3Vector}} vertices[0x10];
    {{Template:Type|C2Vector}} coord;  // internal coords
    uint16_t data[0x50];  
   }[block_count];
    
    
   uint32_t count_2;    // only seen in 'world/maps/azeroth/test.wlm'
   uint32_t block2_count;    // only seen in 'world/maps/azeroth/test.wlm'
   struct block_2
   struct block2
   {
   {
     {{Template:Type|C3Vector}} _unk00;
     {{Template:Type|C3Vector}} _unk00;
     {{Template:Type|C2Vector}} _unk0C;
     {{Template:Type|C2Vector}} _unk0C;
     char _unk14[0x38]; // 4 floats then 0 filled in the above
     char _unk14[0x38]; // 4 floats then 0 filled in the above
   }[count_2];
   }[block2_count];
    
    
   #if version ≥ 1
   #if version ≥ 1
Line 44: Line 42:
     fast flowing = 8,
     fast flowing = 8,
   }
   }
}
==Data==
*nCount blocks of 0x168 bytes.
<pre>Type Name Description
float[16][3] heights a height map for this section of the water
uint16[54]? unk ?</pre>
struct Block {
  {{Template:Type|C3Vector}} vertices[0x10];
  {{Template:Type|C2Vector}} coord;  // internal coords
  uint16_t data[0x50];
  }
  }


===Height Map===
===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.
The <code>block</code>s are made of 48 float's that make up 16 vertices ( z-up ) arranged in a grid that starts in the lower right corner.
<pre>15 14 13 12
<pre>15 14 13 12


Line 70: Line 55:
3 2 1 0</pre>
3 2 1 0</pre>


When all the chunks are combined, they form a height map of the water, similar to those in the ADT's
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.
 
--[[User:Riraito|Riraito]] 03:00, 25 July 2008 (CDT)

Revision as of 13:22, 16 December 2019

These files are found for all of World of Warcraft's water however are not read by any version of the client. For each contained body of water in the game (except for the oceans) there exists one of these files which documents it's heightmap (Water Level Water). Since release, 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

Below is a structure 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 _unk06;     // always 1, probably also part of version
 uint16_t liquidType; // version ≤ 1 LiquidType, version 2 = DB/LiquidType ID
 uint16_t padding;    // more likely that liquidType is a uint32_t

 uint32_t block_count;
 struct block 
 {
   C3Vector vertices[0x10];
   C2Vector coord;   // internal coords
   uint16_t data[0x50]; 
 }[block_count];
 
 uint32_t block2_count;    // only seen in 'world/maps/azeroth/test.wlm'
 struct block2 
 {
   C3Vector _unk00;
   C2Vector _unk0C;
   char _unk14[0x38]; // 4 floats then 0 filled in the above
 }[block2_count];
 
 #if version ≥ 1
  char unknown;       // mostly 1
 #endif

 enum LiquidType      // appears to match MCLQ tiles
 {
   still = 0,
   ocean = 1,
   ? = 2,             // used by 'Shadowmoon Pools 02.wlm'
   slow/river = 4,
   magma = 6,
   fast flowing = 8,
 }
}

Height Map

The blocks 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.