PAK (Tropical Freeze): Difference between revisions

Jump to navigation Jump to search
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 '''.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, and the addition of an extra metadata section.
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 begins with two [[Form Descriptor (Tropical Freeze)|form descriptors]]. Following that are three data sections: files, metadata, and strings.
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
! Size
! Type
! Count
! Name
! Description
! Description
|-
|-
| 0x0
| 0x0
| 32
! [[Form Descriptor (Tropical Freeze)|Form Descriptor]]
| '''PACK [[Form Descriptor (Tropical Freeze)|Form Descriptor]]'''
| 1
| '''Package Form Descriptor'''
| Data type is <code>PACK</code>
|-
|-
| 0x20
| 0x20
| 32
| [[Form Descriptor (Tropical Freeze)|Form Descriptor]]
| '''TOCC [[Form Descriptor (Tropical Freeze)|Form Descriptor]]'''
| 1
| '''Table of Contents Form Descriptor'''
| Data type is <code>TOCC</code>
|-
|-
| 0x40
| 0x40
| colspan=2 | End of pak header
| colspan=4 {{unknown|Header data sections (ADIR, META, and STRG) begin}}
|}
|}


=== Resource Table ===
=== Asset Directory ===


The resource table lists files sorted by their file ID in numerical order; they're often not listed in the same order that they actually appear in the file.
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
! Size
! Type
! Description
! Count
! Name
! Notes
|-
|-
| 0x0
| 0x0
| 24
| [[Chunk Descriptor (Tropical Freeze)|Chunk Descriptor]]
| '''ADIR [[Chunk Descriptor (Tropical Freeze)|Chunk Descriptor]]'''
| 1
| '''Asset Directory Chunk Descriptor'''
| Data type is <code>ADIR</code>
|-
|-
| 0x18
| 0x18
| 4
| u32
| '''Resource count'''
| 1
| '''Asset Count'''
|
|-
|-
| 0x1C
| 0x1C
| colspan=2 | End of file table header
| [[#Asset Entry|Asset Entry]]
| ''Asset Count'
| '''Asset Directory'''
|
|-
| colspan=5 {{unknown|End of <code>ADIR</code> section}}
|}
|}


Following this header are resource entries, which are structured as follows:
==== Asset Entry ====


{| class="wikitable"
{| class="wikitable"
! Offset
! Offset
! Size
! Type
! Description
! Count
! Name
! Notes
|-
|-
| 0x0
| 0x0
| char
| 4
| 4
| '''File type''' fourCC
| '''Asset Type'''
| This is an abbreviated fourCC that doubles as the asset's cooked file extension.
|-
|-
| 0x4
| 0x4
| 16
| GUID
| '''File ID'''
| 1
| '''Asset ID'''
|
|-
|-
| 0x14
| 0x14
| 8
| u64
| 1
| '''Offset'''
| '''Offset'''
| This is an absolute offset relative to the start of the pak file.
|-
|-
| 0x1C
| 0x1C
| 8
| u64
| 1
| '''Size'''
| '''Size'''
|
|-
|-
| 0x24
| 0x24
| colspan=2 | End of file entry
| colspan=4 {{unknown|End of resource entry}}
|}
|}


=== Metadata ===
=== Metadata ===


The metadata section lists extra data for certain resource types, which are associated with them via their file ID. The structure and contents of a metadata entry varies depending on the resource type; check that type's page on the Wiki to check its structure.
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 resources with metadata attached to them in the entire pak, then the metadata section won't exist at all; make sure you check for that.
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
! Size
! Type
! Description
! Count
! Name
! Notes
|-
|-
| 0x0
| 0x0
| 24
| [[Chunk Descriptor (Tropical Freeze)|Chunk Descriptor]]
| '''META [[Chunk Descriptor (Tropical Freeze)|Chunk Descriptor]]'''
| 1
| '''Metadata Chunk Descriptor'''
| Data type is <code>META</code>
|-
|-
| 0x18
| 0x18
| 4
| u32
| '''Metadata entry count'''
| 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
! Size
! Type
! Description
! Count
! Name
! Notes
|-
|-
| 0x0
| 0x0
| 16
| GUID
| '''Resource ID'''
| 1
| '''Asset ID'''
| This is the ID of the asset that this metadata entry is associated with
|-
|-
| 0x10
| 0x10
| 4
| u32
| '''Metadata offset''' (relative to start of the metadata section)
| 1
| '''Metadata Offset'''
| Relative to the start of the <code>META</code> section.
|-
|-
| 0x14
| 0x14
| colspan=2 | End of entry
| colspan=4 {{unknown|End of metadata entry}}
|}
|}


=== String Table ===
=== Name Tags===


The string table attaches names to certain resources to allow the game to access them directly. It's structured as follows:
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
! Size
! Type
! Description
! Count
! Name
! Notes
|-
|-
| 0x0
| 0x0
| 24
| [[Chunk Descriptor (Tropical Freeze)|Chunk Descriptor]]
| '''STRG [[Chunk Descriptor (Tropical Freeze)|Chunk Descriptor]]'''
| 1
| '''Name Tags Chunk Descriptor'''
| Data type is <code>STRG</code>
|-
|-
| 0x18
| 0x18
| 4
| u32
| '''String entry count'''
| 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
! Size
! Type
! Description
! Count
! Name
! Notes
|-
|-
| 0x0
| 0x0
| char
| 4
| 4
| '''Resource type''' fourCC
| '''Asset Type'''
|
|-
|-
| 0x4
| 0x4
| 16
| GUID
| '''Resource ID'''
| 1
| '''Asset ID'''
|
|-
|-
| 0x14
| 0x14
| N
| string
| '''Resource name'''; zero-terminated
| 1
| '''Asset Name'''
| Zero-terminated.
|-
|-
| 0x14 + N
| colspan=5 {{unknown|End of string entry}}
| colspan=2 | End of string entry
|}
|}


Anonymous user

Navigation menu