PAK (Tropical Freeze): Difference between revisions

From Retro Modding Wiki
Jump to navigation Jump to search
>Aruki
No edit summary
>Aruki
 
Line 224: Line 224:
== Tools ==
== Tools ==


* [https://drive.google.com/file/d/0B9MLV21H7SDvcGc1QjRfSTFJNk0/view?usp=sharing PakTool] by Aruki; can extract and decompress files from Tropical Freeze paks, but doesn't support repacking or recompressing them
* [https://www.dropbox.com/s/bba2n9jzj719by4/PakTool.rar?dl=0 PakTool] by Aruki; can extract and decompress files from Tropical Freeze paks, but doesn't support repacking or recompressing them


[[Category:File Formats]]
[[Category:File Formats]]
[[Category:Donkey Kong Country: Tropical Freeze]]
[[Category:Donkey Kong Country: Tropical Freeze]]

Latest revision as of 01:33, 13 April 2019

See PAK (File Format) for the other revisions of this format.

The PAK format in Donkey Kong Country: Tropical Freeze is the third version of the .pak format, with another layout overhaul, file IDs being extended from 64 bits to 128 bits (as they now use a new GUID system that is used to associate IDs with various objects across the entire game), and the addition of an extra metadata section.

Format

The Tropical Freeze pak format contains three main header sections: the resource directory, metadata, and name tags.

Offset Type Count Name Description
0x0 Form Descriptor 1 Package Form Descriptor Data type is PACK
0x20 Form Descriptor 1 Table of Contents Form Descriptor Data type is TOCC
0x40 Header data sections (ADIR, META, and STRG) begin

Asset Directory

The asset directory contains a list of every asset in the pak, associating a GUID with an offset/size in the file. Assets are sorted by their GUID in numerical order, which is often not the same order that they actually appear in the file.

Offset Type Count Name Notes
0x0 Chunk Descriptor 1 Asset Directory Chunk Descriptor Data type is ADIR
0x18 u32 1 Asset Count
0x1C Asset Entry Asset Count Asset Directory
End of ADIR section

Asset Entry

Offset Type Count Name Notes
0x0 char 4 Asset Type This is an abbreviated fourCC that doubles as the asset's cooked file extension.
0x4 GUID 1 Asset ID
0x14 u64 1 Offset This is an absolute offset relative to the start of the pak file.
0x1C u64 1 Size
0x24 End of asset entry

Metadata

The metadata section lists extra metadata for some asset types, which are associated with them via their file ID. The structure and contents of a META entry varies depending on the asset type; check that type's page on the Wiki to check the structure of its META entries.

Note that a lot of formats don't have any extra metadata. If there's no assets with extra metadata in the entire pak, then the META section won't appear in the file at all.

Offset Type Count Name Notes
0x0 Chunk Descriptor 1 Metadata Chunk Descriptor Data type is META
0x18 u32 1 Metadata Entry Count
0x1C Metadata Entry Metadata Entry Count Metadata Entry Table
End of META section

Metadata Entry

Offset Type Count Name Notes
0x0 GUID 1 Asset ID This is the ID of the asset that this metadata entry is associated with
0x10 u32 1 Metadata Offset Relative to the start of the META section.
0x14 End of metadata entry

Name Tags

The name tags section associates certain assets with string names. These are the "main" assets of the pak; any asset that does not have a name is a dependency of one of the ones that do.

Offset Type Count Name Notes
0x0 Chunk Descriptor 1 Name Tags Chunk Descriptor Data type is STRG
0x18 u32 1 Name Tag Count
0x1C Name Tag Name Tag Count Name Tag Table
End of STRG section

Name Tag

Offset Type Count Name Notes
0x0 char 4 Asset Type
0x4 GUID 1 Asset ID
0x14 string 1 Asset Name Zero-terminated.
End of name tag

Tools

  • PakTool by Aruki; can extract and decompress files from Tropical Freeze paks, but doesn't support repacking or recompressing them