PAK (Tropical Freeze): Difference between revisions
no edit summary
>Aruki No edit summary |
>Aruki No edit summary |
||
Line 1: | Line 1: | ||
''See [[PAK (File Format)]] for the other revisions of this format.'' | ''See [[PAK (File Format)]] for the other revisions of this format.'' | ||
The ''' | 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. | ||
__TOC__ | __TOC__ | ||
Line 7: | Line 7: | ||
== Format == | == Format == | ||
The format | The Tropical Freeze pak format contains three main header sections: [[#Resource Directory|the resource directory]], [[#Metadata|metadata]], and [[#Name Tags|name tags]]. | ||
{| class="wikitable" | {| class="wikitable" | ||
! Offset | ! Offset | ||
! | ! Type | ||
! Count | |||
! Name | |||
! Description | ! Description | ||
|- | |- | ||
| 0x0 | | 0x0 | ||
! [[Form Descriptor (Tropical Freeze)|Form Descriptor]] | |||
| 1 | |||
| '''Package Form Descriptor''' | |||
| Data type is <code>PACK</code> | |||
|- | |- | ||
| 0x20 | | 0x20 | ||
| | | [[Form Descriptor (Tropical Freeze)|Form Descriptor]] | ||
| 1 | |||
| '''Table of Contents Form Descriptor''' | |||
| Data type is <code>TOCC</code> | |||
|- | |- | ||
| 0x40 | | 0x40 | ||
| colspan= | | colspan=4 {{unknown|Header data sections (ADIR, META, and STRG) begin}} | ||
|} | |} | ||
=== | === Asset Directory === | ||
The | 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. | ||
{| class="wikitable" | {| class="wikitable" | ||
! Offset | ! Offset | ||
! | ! Type | ||
! | ! Count | ||
! Name | |||
! Notes | |||
|- | |- | ||
| 0x0 | | 0x0 | ||
| | | [[Chunk Descriptor (Tropical Freeze)|Chunk Descriptor]] | ||
| 1 | |||
| '''Asset Directory Chunk Descriptor''' | |||
| Data type is <code>ADIR</code> | |||
|- | |- | ||
| 0x18 | | 0x18 | ||
| | | u32 | ||
| ''' | | 1 | ||
| '''Asset Count''' | |||
| | |||
|- | |- | ||
| 0x1C | | 0x1C | ||
| colspan= | | [[#Asset Entry|Asset Entry]] | ||
| ''Asset Count' | |||
| '''Asset Directory''' | |||
| | |||
|- | |||
| colspan=5 {{unknown|End of <code>ADIR</code> section}} | |||
|} | |} | ||
==== Asset Entry ==== | |||
{| class="wikitable" | {| class="wikitable" | ||
! Offset | ! Offset | ||
! | ! Type | ||
! | ! Count | ||
! Name | |||
! Notes | |||
|- | |- | ||
| 0x0 | | 0x0 | ||
| char | |||
| 4 | | 4 | ||
| ''' | | '''Asset Type''' | ||
| This is an abbreviated fourCC that doubles as the asset's cooked file extension. | |||
|- | |- | ||
| 0x4 | | 0x4 | ||
| | | GUID | ||
| ''' | | 1 | ||
| '''Asset ID''' | |||
| | |||
|- | |- | ||
| 0x14 | | 0x14 | ||
| | | u64 | ||
| 1 | |||
| '''Offset''' | | '''Offset''' | ||
| This is an absolute offset relative to the start of the pak file. | |||
|- | |- | ||
| 0x1C | | 0x1C | ||
| | | u64 | ||
| 1 | |||
| '''Size''' | | '''Size''' | ||
| | |||
|- | |- | ||
| 0x24 | | 0x24 | ||
| colspan= | | colspan=4 {{unknown|End of resource entry}} | ||
|} | |} | ||
=== Metadata === | === Metadata === | ||
The metadata section lists extra | 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 <code>META</code> entry varies depending on the asset type; check that type's page on the Wiki to check the structure of its <code>META</code> entries. | ||
If there's no | 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 <code>META</code> section won't appear in the file at all. | ||
{| class="wikitable" | {| class="wikitable" | ||
! Offset | ! Offset | ||
! | ! Type | ||
! | ! Count | ||
! Name | |||
! Notes | |||
|- | |- | ||
| 0x0 | | 0x0 | ||
| | | [[Chunk Descriptor (Tropical Freeze)|Chunk Descriptor]] | ||
| 1 | |||
| '''Metadata Chunk Descriptor''' | |||
| Data type is <code>META</code> | |||
|- | |- | ||
| 0x18 | | 0x18 | ||
| | | u32 | ||
| '''Metadata | | 1 | ||
| '''Metadata Entry Count''' | |||
| | |||
|- | |||
| 0x1C | |||
| [[#Metadata Entry|Metadata Entry]] | |||
| ''Metadata Entry Count'' | |||
| '''Metadata Entry Table''' | |||
| | |||
|- | |||
| colspan=5 {{unknown|End of <code>META</code> section}} | |||
|} | |} | ||
{|class="wikitable" | ==== Metadata Entry ==== | ||
{| class="wikitable" | |||
! Offset | ! Offset | ||
! | ! Type | ||
! | ! Count | ||
! Name | |||
! Notes | |||
|- | |- | ||
| 0x0 | | 0x0 | ||
| | | GUID | ||
| ''' | | 1 | ||
| '''Asset ID''' | |||
| This is the ID of the asset that this metadata entry is associated with | |||
|- | |- | ||
| 0x10 | | 0x10 | ||
| | | u32 | ||
| '''Metadata | | 1 | ||
| '''Metadata Offset''' | |||
| Relative to the start of the <code>META</code> section. | |||
|- | |- | ||
| 0x14 | | 0x14 | ||
| colspan= | | colspan=4 {{unknown|End of metadata entry}} | ||
|} | |} | ||
=== | === Name Tags=== | ||
The string | 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. | ||
{|class="wikitable" | {| class="wikitable" | ||
! Offset | ! Offset | ||
! | ! Type | ||
! | ! Count | ||
! Name | |||
! Notes | |||
|- | |- | ||
| 0x0 | | 0x0 | ||
| | | [[Chunk Descriptor (Tropical Freeze)|Chunk Descriptor]] | ||
| 1 | |||
| '''Name Tags Chunk Descriptor''' | |||
| Data type is <code>STRG</code> | |||
|- | |- | ||
| 0x18 | | 0x18 | ||
| | | u32 | ||
| ''' | | 1 | ||
| '''Name Tag Count''' | |||
| | |||
|- | |||
| 0x1C | |||
| [[#Name Tag|Name Tag]] | |||
| ''Name Tag Count'' | |||
| '''Name Tag Table''' | |||
| | |||
|- | |||
| colspan=5 {{unknown|End of <code>STRG</code> section}} | |||
|} | |} | ||
==== Name Tag ==== | |||
{|class="wikitable" | {|class="wikitable" | ||
! Offset | ! Offset | ||
! | ! Type | ||
! | ! Count | ||
! Name | |||
! Notes | |||
|- | |- | ||
| 0x0 | | 0x0 | ||
| char | |||
| 4 | | 4 | ||
| ''' | | '''Asset Type''' | ||
| | |||
|- | |- | ||
| 0x4 | | 0x4 | ||
| | | GUID | ||
| ''' | | 1 | ||
| '''Asset ID''' | |||
| | |||
|- | |- | ||
| 0x14 | | 0x14 | ||
| | | string | ||
| ''' | | 1 | ||
| '''Asset Name''' | |||
| Zero-terminated. | |||
|- | |- | ||
| colspan=5 {{unknown|End of string entry}} | |||
| colspan= | |||
|} | |} | ||