PAK (Metroid Prime 3): Difference between revisions

>Aruki
>Aruki
 
(5 intermediate revisions by 2 users not shown)
Line 5: Line 5:
Note that the Metroid Prime 3 E3 prototype uses a slightly modified version of the Metroid Prime pak format, not this one. See the [[PAK (Metroid Prime)]] page for more info on that revision of the format.
Note that the Metroid Prime 3 E3 prototype uses a slightly modified version of the Metroid Prime pak format, not this one. See the [[PAK (Metroid Prime)]] page for more info on that revision of the format.


{{researchminor
{{research|1|Research needs to be done on how to order files to optimize loads. Also, the very first part of the header is mostly unknown.}}
|reason = Research needs to be done on how to order files to optimize loads. Also, the very first part of the header is mostly unknown.
}}


__TOC__
__TOC__
Line 154: Line 152:
|}
|}


Each compressed block is structured as follows. Note that the first byte of the compressed size value appears to actually be a completely different value, so the three bytes following are what makes up the actual size value.
Each compressed block is structured as follows.


For each block, if the compressed and decompressed sizes match, that indicates the block is uncompressed.
For each block, if the compressed and decompressed sizes match, that indicates the block is uncompressed.
Line 165: Line 163:
| 0x0
| 0x0
| 1
| 1
| {{unknown|'''Unknown'''}}
| '''Flag'''
|-
|-
| 0x1
| 0x1
Line 178: Line 176:
| colspan=2 {{unknown|End of entry}}
| colspan=2 {{unknown|End of entry}}
|}
|}
The flag value can be set to the following possible values:
* If the block count is 1, it will be 0xA0 on block 1.
* If blocks 2/3 are compressed, they will have it set to 0xC0.
* If blocks 2/3 are uncompressed, they will have it set to 0x40.
* 0 in all other circumstances.


Files are left uncompressed if the compressed data is larger than the uncompressed data. Barring that, the following formats are always compressed:
Files are left uncompressed if the compressed data is larger than the uncompressed data. Barring that, the following formats are always compressed:
Line 209: Line 214:


File order matters significantly and easily makes the difference between a pak loading quickly and optimally, or taking 30+ seconds on every door. While more research is required to figure out exactly how files should be ordered to optimize loading, the game generally clusters together resources that are used together, and a file's dependencies generally appear directly before the file itself. The game also often duplicates assets that are used multiple times within the same pak; there might be 10-11 copies of the same model file in order to allow the game to more easily find and load that file when it needs it.
File order matters significantly and easily makes the difference between a pak loading quickly and optimally, or taking 30+ seconds on every door. While more research is required to figure out exactly how files should be ordered to optimize loading, the game generally clusters together resources that are used together, and a file's dependencies generally appear directly before the file itself. The game also often duplicates assets that are used multiple times within the same pak; there might be 10-11 copies of the same model file in order to allow the game to more easily find and load that file when it needs it.
== Tools ==
* [https://www.dropbox.com/s/bba2n9jzj719by4/PakTool.rar?dl=0 PakTool] by Aruki


[[Category:File Formats]]
[[Category:File Formats]]
[[Category:Metroid Prime 3: Corruption]]
[[Category:Metroid Prime 3: Corruption]]
[[Category:Donkey Kong Country Returns]]
[[Category:Donkey Kong Country Returns]]
Anonymous user