Difference between revisions of "BUN file"

From Pikmin Technical Knowledge Base
Jump to navigation Jump to search
(Bundle Files: Declassified)
 
(fixed links)
Line 1: Line 1:
'''BUN''' files (short for '''Bundle''' files) are a Binary Large Object (BLOB) archive format used in Pikmin 1.  '''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 ARC+DIR File Pairs|ARC+DIR file pair system]], however, as all of the files within a bundle are unpacked into RAM as soon as they 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 1.  '''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 they one is loaded, as shown by the [[OpenGl / Dolphin System]].
  
  
Line 39: Line 39:
  
 
===Mock-Directory===
 
===Mock-Directory===
Similar to the [[Pikmin ARC+DIR File Pairs|ARC+DIR file pair system]], 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.
+
Similar to the [[Pikmin Paired ARC+DIR Files|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.
  
  

Revision as of 21:56, 23 April 2018

BUN files (short for Bundle files) are a Binary Large Object (BLOB) archive format used in Pikmin 1. 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[unsure]. 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 they one is loaded, as shown by the OpenGl / Dolphin System.



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 root\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 is a seemingly vestigial function. However, it has been observed that it always is set to specific values that reflect the type of file contained within the struct.

  • 0 = PCR
  • 1 = BTI
  • 2 = DCA
  • 3 = DCK
Credits: Minty_Meeo