Daggerfall's WOODS.WLD File Format by Dave Humphrey - dave@uesp.net 28 October 2000 This is a description of the format of the WOODS.WLD file found in the ARENA2 directory of Elder Scrolls:Daggerfall by Bethesda. The information here is not complete or 100% percent accurate, although the basic format appears to be well understood. For more information, corrections, or comments, e-mail me at the above address. Check out http://www.uesp.net/dagger/ for the latest version of this document. General File Layout ------------------------------------- Header Map Data Offsets Data Section #1 Small Map Data Large Map Data Header ------------------------------------- The first 0x90 (144) bytes of the file. The Data Offsets section immediately follows the header. [Bytes 0-3] long OffsetSize; Total length in bytes of the data offsets section. [Bytes 4-7] long ImageWidth = 1000; Indicates the width of the image contained in the Small Map Data. [Bytes 8-11] long ImageHeight = 500; Indicates the height of the image contained in the Small Map Data. [Bytes 12-15] long NullValue = 0x00000000; [Bytes 16-19] long Data1Offset; Offset from file origin to start of the Data Section #1. [Bytes 20-23] long Unknown1 = 0x00000001; [Bytes 24-27] long Unknown2 = 0x00000010; [Bytes 28-31] long SmallMapOffset; Offset from file origin to start of the Small Map Data. [Bytes 32-143] long NullValues[28] = 0x00000000; Data Offsets ------------------------------------- Contains 4 byte, long offsets to the 500000 (width*height) data records which compose most of the file. Follows the file header and comes before the Data Section #1. The offsets are from the file origin. Data Section #1 ------------------------------------- This section follows the 50000 data offsets and contains unknown data. It may be related to the Small Map Data which follows it. The section is 1024 bytes in size (0x0400) [Bytes 0-15] char Bytes[16] Unknown, non-zero data, mostly. [Bytes 16-1023] long NullValues[252]; 1008 bytes of 00's. Small Map Data ------------------------------------- As the name suggests, this section contains data for a small, 1000x500, map of the area the game of Daggerfall takes place in. Each byte can be considered a grayscale value from 0-255 which water in the 0x00 to 0x02 value range. This data may be used to create the landscape of the world but how exactly is unknown. Since this data is linear it can be easily copied out into a file and import into some picture editors (such as Paint Shop Pro with the RAW file format). Large Map Data ------------------------------------- For each of the 500000 pixels of data in the small map data, there is a corresponding record of large map data (0x2F, 47 bytes in size). This data continues until the end of the file with no leftover bytes. [Bytes 0-1] short Number1; Unknown purpose, but takes a wide variety of random values ranging approximately from 0 to around 4400. Could be a random 'seed' value or other land area parameter. [Bytes 2-5] long NullValue1; Always 0x00000000 (confirmed). [Bytes 6-7] short ClimateType; Probably indicates the basic type of terrain with 4 values. 0x0002 (2) = Desert (Alik'r Region) 0x0066 (102) = Mountain (Wrothgarian, etc...) 0x012E (302) = Temperate (Daggerfall, Wayrest) 0x0192 (402) = Jungle (Provinces just south of Wayrest) Note that these numbers correspond exactly to the appropriate texture files (TEXTURE.102, etc...). [Byte 8] char LandType; Another unknown type field with 3 possible values. 0x00 = Temperate/Jungle 0x01 = Mountainous 0x02 = Desert [Byte 9] char LandHeight; Might represent the randomness or height of the land. The data in this field is slightly random, or noisy, but only takes on 6 possible values. 0x20 (32) = Deserts (more flat, lower?) 0x40 (64) = 0x60 (96) = 0x80 (128) = 0xA0 (160) = 0xC0 (192) = Mountains (more random, higher?) [Bytes 10-21] long NullValues[3]; Always 0x00000000 (confirmed). [Bytes 22-46] unsigned char MapData[5][5]; Contains the 'expanded' map data. Nothing much is truly known at this time. Expanding all the data in this section creates a large Daggerfall map 5000x2500 in size. For some reason this map has a strange grid-like pattern imposed on it. One might assume that this data is used for the landscape generation in some manner. The header data in each record might define the type of land (desert, hilly, flat, etc...) and the image data the 'seeds' for the land generation (I'm guessing here though).