Difference between revisions of "BUN file"

From Pikmin Technical Knowledge Base
Jump to navigation Jump to search
(clarification for File Content Indicators.)
m
Line 1: Line 1:
'''BUN''' files (short for '''Bundle''' files) are a Binary Large Object (BLOB) archive format used in ''[[Pikmin]]''.  '''ANM''' files (likely short for '''Animation Folder''') use the structure of BUN files as well.  With minimal metadata, {{unsure|the bundle archive was likely used to reduce load time by packing several files into one}}.  The purpose they serve is different from the [[Pikmin Paired ARC+DIR Files|Paired ARC+DIR Files]], however, as all of the files within a bundle are unpacked into RAM as soon as one is loaded, as shown by the [[OpenGl / Dolphin System]].
+
'''BUN''' files (short for '''Bundle''' files) are a Binary Large Object (BLOB) archive format used in ''[[Pikmin]]''.  '''ANM''' files (likely short for '''Animation Folder''') use the structure of BUN files as well.  With minimal metadata, the bundle archive was likely used to reduce load time by packing several files into one.  The purpose they serve is different from the [[Pikmin Paired ARC+DIR Files|Paired ARC+DIR Files]], however, as all of the files within a bundle are unpacked into RAM as soon as one is loaded, as shown by the [[OpenGl / Dolphin System]] it is structurally similar.
  
 
__TOC__
 
__TOC__
Line 39: Line 39:
  
 
===File content indicator===
 
===File content indicator===
The file content indicator appears to be vestigial in most cases.  However, in-game cutscenes use it to know what type of animation file is being loaded, since they only load the first item in an '''ANM''' file, {{unsure|presumably without checking the filename}}. The following filetypes have been observed to have these values assigned to them:
+
The file content indicator appears to be vestigial in most cases.  However, in-game cutscenes use it to know what type of animation file is being loaded. The following filetypes have been observed to have these values assigned to them:
 
* 0 = [[PCR file|PCR]]
 
* 0 = [[PCR file|PCR]]
 
* 1 = [http://wiki.tockdom.com/wiki/BTI BTI]
 
* 1 = [http://wiki.tockdom.com/wiki/BTI BTI]
Line 45: Line 45:
 
* 3 = DCK
 
* 3 = DCK
  
{{Credits|[[User:Minty_Meeo|Minty_Meeo]]}}
+
{{Credits|[[User:Minty_Meeo|Minty_Meeo]][[User:Patrick_Anton]|Ambrosia]}}
  
 
[[Category:Pikmin]]
 
[[Category:Pikmin]]
 
[[Category:File formats]]
 
[[Category:File formats]]

Revision as of 18:59, 19 October 2019

BUN files (short for Bundle files) are a Binary Large Object (BLOB) archive format used in Pikmin. ANM files (likely short for Animation Folder) use the structure of BUN files as well. With minimal metadata, the bundle archive was likely used to reduce load time by packing several files into one. The purpose they serve is different from the Paired ARC+DIR Files, however, as all of the files within a bundle are unpacked into RAM as soon as one is loaded, as shown by the OpenGl / Dolphin System it is structurally similar.

File structure

The bundle file is very simple. There is a header, followed by a repeating struct for every file contained within the BUN. Each struct has a subheader and file contained within it.

Here is /dataDir/bosses/mizu/mizu.anm annotated for reference.

BUN and ANM file documentation.png Minty Meeo Documentation Legend.png

Header
Offset Size Purpose
0x00 4 Number of structs
File entry struct
Offset Size Purpose
0x00 4 File content indicator
0x04 4 Enclosed file size
0x08 4 Mock-directory string length
0x0c 0x08 value Mock-directory path
0x0c + 0x08 value 0x04 value Enclosed file

Mock-directory

Similar to the Paired ARC+DIR Files, the bundle archive emulates a folder path. When the file is unpacked in-game, it is assumed that whatever code is responsible treats the contents of the bundle files as if they were in the folder path described, starting from the root of the disc.

File content indicator

The file content indicator appears to be vestigial in most cases. However, in-game cutscenes use it to know what type of animation file is being loaded. The following filetypes have been observed to have these values assigned to them:

  • 0 = PCR
  • 1 = BTI
  • 2 = DCA
  • 3 = DCK

{{Credits|Minty_Meeo[[User:Patrick_Anton]|Ambrosia]}}