Open main menu

UESPWiki β

Daggerfall Mod:CLIMATE.PAK

< Mod / Daggerfall: Daggerfall Mod: File Formats: PAK file formats(Redirected from Daggerfall:CLIMATE.PAK)

The CLIMATE.PAK is used by Daggerfall to determine the base ground and flat textures for the region of the Iliac Bay defined by WOODS.WLD. These two files are used in conjunction by Daggerfall.

Grey-scale output of CLIMATE.PAK

General FormatEdit

The file consists of a contiguous list of UInt32 offsets, followed by a contiguous list of PakFile structures.

CLIMATE.PAK coarse structure
OffsetList
PakFileList

OffsetListEdit

This is a contiguous list of UInt32 offsets. Since the PakFile data immediately follows this list, the length of the list can be implied by the current position within the file. Each element is relative from the start of the list. Each offset points to a PakFile structure within the file. The OffsetList is 500 elements in count, one for each row of output pixel data, and editors should preserve this format by encoding one row at a time. The offsets are not required to be in any particular order; that is to say Offsetn may be greater than Offsetn + 1. Editors should be prepared to accept offsets in any particular order. Editors should save the data in offset-sorted order.

PakFileListEdit

Immediately following the OffsetList is a contiguous list of PakFile strucures, one for each element of the OffsetList. Since no PakFile structures overlap, the length of each element can be implied by the OffsetList. Each PakFile structure begins at a location specified by an element of the OffsetList. Each PakFile describes a single row of the output bitmap. Editors should ensure each PakFile structure describes a single row of the output bitmap.

TextureEdit

Decompressing and concatenating all the PakFiles together results in a 1001x500 pixel bitmap, which corresponds to the 1000x500 map in WOODS.WLD. The values of this bitmap range from 223 through and including 232. One should note that there are no texture files within this range. Instead, these values map to valid textures according to the table below.

Texture translation table
Value Ground Textures Flat Textures Sky File
223 402-404 502 29-31
224 002-004 503 09-11
225 002-004 503 09-11
226 102-104 510 01-03
227 402-404 500 29-31
228 402-404 502 29-31
229 002-004 503 25-27
230 102-104 504 17-19
231 302-304 508 17-19
232 302-304 508 17-19

Reading CLIMATE.PAKEdit

One merely reads the OffsetList, stopping when the current file position is within the range of values specified by the OffsetList. At this point one may begin computing the size of each PakFile structure contained. Now one may seek to each position within the offset list and begin decompressing the PakFile structures as per standard PakFile logic. It should be remembered that each element is a separate PakFile for purposes of decompression.

Once the data has been decompressed and concatenated, one may use the above look-up table to determine which ground texture and sky file to use, as well as which overland flats to display. Building and NPC textures can also be inferred based on the ground texture.