Skip to content

Asset Pack Format

palaceswitcher edited this page Feb 26, 2025 · 2 revisions

Last updated: 2025-2-25

This has only been tested with Diamond Rush and Rayman Kart. These are likely applicable to other games but this has not been verified. All numbers specified are little-endian, if applicable.

Offset Format

This format stores files and only keeps track of their starting offset, meaning the size of each file has to be calculated based on the differences between offsets. Since the amount of files is one less than the amount of offsets, the last offset should always point to the end of the file. Because of the constraints of this format, files must be stored sequentially in the payload.

Field Size Type Description
Offset Count 2 bytes int16 Amount of offsets
Offsets 4 x {Offset Count} Bytes int32 array Start offsets for each file
Payload Variable binary Raw file data

Alternate Offset Format

A less common variant of this format store the file count as a 32-bit integer and has a single terminator byte (usually 00) after the header. File offsets also represent the end offset of each file rather than the start offset, so the number of files is the same as the number of offsets.

Offset and Size Format

This is the most commonly used format. It stores both the sizes and offsets for each file, meaning files do not have to be stored sequentially in the payload (though this is often done anyways as it makes the most sense).

Field Size Type Description
File Count 1 byte int8 Amount of files
Offsets + Sizes 8 * {File Count} bytes struct Pairs of the offsets and sizes of each file (in that order) as 32-bit integers
Payload Variable binary Raw file data

Minimal Size Format

This is the most barebones format, featuring no header and instead having each file stored sequentially preceded by a 16-bit integer representing their size.

Text Pack Format

Text packs are stored as two binary files packed in the minimal pack format, with the first file being the string table, which stores the raw string data, and the second file being the index table, which stores the indexes of each string in the table.

String Table

The string table contains a header specifying how many bytes it takes up followed by an array of shorts representing the start index for each string. Strings are null-terminated and are encoded in ISO/IEC 8859-1, with the exception of the single quote being encoded by character 0x92.

String Index Table

The string table contains the number of strings in the string table followed by the starting index of every string. The first string is assumed to be at index 0, and the last index typically points to the end of the string table.

Field Size Type Description
String Count 2 bytes int16 Amount of strings
String Indices 2 * {String Count} bytes int16 array Starting indices of each string
Clone this wiki locally