Daggerfall Mod:PAK file formats

The UESPWiki – Your source for The Elder Scrolls since 1995
Jump to: navigation, search

PAK is a compression format very similar to RLE, except there are no uncompressed "runs". Since there are no uncompressed "runs", it is not suitable for arbitrary data. This format is used by CLIMATE.PAK and POLITIC.PAK.

General Format[edit]

A stream of PAK-compressed data is composed of a contiguous list of one or more PakRun structures.

PakFile[edit]

A PakFile is merely a contiguous list of one or more PakRun structures.

PakRun[edit]

The 3 byte long PakRun structure is composed of a UInt16 Count field, immediately followed by a single UInt8 Value. This value is to be repeated Count times.

PakRun structure
Offset Type Name Description
0-1 UInt16 Count The number of times the Value field must be copied.
2 UInt8 Value The value to be copied to the output buffer.

Reading PAK files[edit]

To read a PakFile, one merely reads PakRun and processes structures until one has run out of file.