Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Development

Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 12-28-2003, 09:31 AM
daeken_bb
Discordant
 
Join Date: Mar 2003
Location: Chambersburg, PA
Posts: 469
Default WLD file format

Not sure which forum this is appropriate in, so I'll just drop it here.

The WLD file format is fairly simple once you break it down into fragments. The header is 24 bytes long, and is as follows:

Code:
struct WLD_Header {
/* 0x0000 */ unsigned long features[2]; // Info used to analyze what features the WLD uses.
/* 0x0008 */ unsigned long maxFragment; // Number of fragments in the file.
/* 0x000C */ unsigned long unk[2]; // 8 bytes of unknown data, usually 0x1DBB and 0x680D4.
/* 0x0014 */ unsigned long nameHash_size; // The length of the namehash.
};
I am unsure as to what the values of the two longs in the features field or in the unk field are used for, as of yet. The maxFragment field is the number of fragments. The nameHash_size field is the length of the namehash in the file.

After the header comes the namehash, and its length is, of course, the value of nameHash_size. The namehash is encoded and decoded using the following algorithm (thanks to the creators of ZoneConvertor for the algorithm):

Code:
function Code($data, $size)
{
  $codes = array(0x95, 0x3A, 0xC5, 0x2A, 0x95, 0x7A, 0x95, 0x6A);
  for($i = 0; $i < $size; ++$i)
    $data{$i} = chr(ord($data{$i}) ^ $codes[$i & 7]);
}
Next comes maxFragment number of fragments which are in the format of this struct:

Code:
struct WLD_Fragment {
/* 0x0000 */ unsigned long size; // The size of the fragment.
/* 0x0004 */ unsigned long object; // Fragment type.
};
After the struct, comes the fragment data itself, which is as long as the size field of the struct indicates. Valid fragment/object types are 0x03, 0x04, 0x05, 0x06, 0x07, 0x10, 0x11, 0x12, 0x13, 0x14, 0x17, 0x18, 0x21, 0x22, 0x26, 0x27, 0x2C, 0x2D, 0x30, 0x31, 0x34, 0x36. If the fragment/object type is set to something else, then it's of type "DataWithName", according to ZoneConvertor. What is done with the fragment data depends on the fragment/object type.


Hopefully my info is accurate

Cheers,
Daeken
__________________
Keep me unemployed and working on OpenEQ, PM me about donating

Check out my deviantART page at http://daeken.deviantart.com/
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 01:52 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3