Difference between revisions of "Paired ARC+DIR file"

From Pikmin Technical Knowledge Base
Jump to navigation Jump to search
(A complete rewrite to better tell the tale of the Paired ARC+DIR Files archive, as well as finally give them a name.)
m
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
'''ARC''' files (likely short for '''Archive''') and '''DIR''' files (technically short for '''Bundle''', though '''Directory''' makes more sense and avoids conflict with [[Pikmin BUN Files|'''BUN''' Files]]) are two peas in a pod, together representing one of the many Binary Large Object (BLOB) archive formats used in Pikmin 1. Together, they will henceforth be referred to as the ''Paired ARC+DIR Files'' archive.
+
'''ARC''' files (short for '''Archive''') and '''DIR''' files (internally named '''Bundle''' ; not to be confused with [[BUN file|'''BUN''' files]]) make up one of ''Pikmin''<nowiki>'s</nowiki> proprietary data storage formats. The '''DIR''' file contains all necessary information about the data in the '''ARC''' file, which stores the aforementioned data.
 
 
With minimal metadata, {{unsure|the Paired ARC+DIR Files archive was likely used to reduce load time by packing several files into one}}.  The purpose it serves is different from the [[Pikmin BUN Files|Bundle]] archive, however, {{unsure|as standalone files within the archive can be unpacked independent of the files before it}}.  This makes the Paired ARC+DIR Files useful for archiving large directories with varied purposes.
 
  
 +
With minimal metadata, the Bundled Archive file format was used to reduce load time by packing several files into one. The purpose it serves is different from the [[BUN file|bundle]] archive, however, as standalone files within the archive can be read independently of the files before it.  This makes the Bundled Archive file format useful for archiving large directories with varied purposes, as to its name.
  
 
__TOC__
 
__TOC__
  
 +
== File structure ==
 +
As mentioned before, the paired ARC+DIR file archive consists of two files: the mock-directory (DIR) and the BLOB archive (ARC).  Think of the mock-directory as a map to navigate through the BLOB archive.
  
==File Structure==
+
=== DIR ===
As mentioned before, the Paired ARC+DIR Files archive consists of two files: the mock-directory (DIR) and the BLOB archive (ARC).  Think of the mock-directory as a map to navigate through the BLOB archive.
+
DIR files consist of a header followed by a repeating entry for each mock-filepath.
  
===DIR===
+
Here is <code>/dataDir/archives/pelletsbin.dir</code> annotated for reference.
DIR files consist of a header followed by a repeating struct for each mock-filepath.
 
 
 
Here is <code>root\dataDir\archives\pelletsbin.dir</code> annotated for reference.
 
  
 
[[File:DIR_file_documentation.png]][[File:Minty_Meeo_Documentation_Legend.png]]
 
[[File:DIR_file_documentation.png]][[File:Minty_Meeo_Documentation_Legend.png]]
Line 23: Line 21:
 
| 0x00 || 4 || Size of DIR file
 
| 0x00 || 4 || Size of DIR file
 
|-
 
|-
| 0x04 || 4 || Number of structs
+
| 0x04 || 4 || Number of entries
 
|-
 
|-
 
|}
 
|}
  
 
{| class="wikitable"  
 
{| class="wikitable"  
|+ Mock-Directory Struct
+
|+ Mock-directory entry
 
! Offset || Size || Purpose
 
! Offset || Size || Purpose
 
|-
 
|-
Line 35: Line 33:
 
| 0x04 || 4 || Size of file in ARC
 
| 0x04 || 4 || Size of file in ARC
 
|-
 
|-
| 0x08 || 4 || Mock-Directory String Length
+
| 0x08 || 4 || Mock-directory string length
 
|-
 
|-
| 0x0C || 0x08 value || Mock-Directory Path
+
| 0x0C || 0x08 value || Mock-directory path
 
|-
 
|-
 
|}
 
|}
  
====Mock-Directory====
+
==== Mock-directory ====
 
The DIR file emulates filepaths.  When a file is unpacked in-game, it is assumed that whatever code is responsible treats the entry in the DIR file as a legitimate filepath on the disc, starting from the root.
 
The DIR file emulates filepaths.  When a file is unpacked in-game, it is assumed that whatever code is responsible treats the entry in the DIR file as a legitimate filepath on the disc, starting from the root.
  
===ARC===
+
=== ARC ===
Here is <code>root\dataDir\archives\pelletsbin.arc</code> annotated to demonstrate searching the BLOB archive. Without the DIR file as a guide, the only way you could possibly differentiate between files would be with the <code>0xCC</code> padding between files.
+
Here is <code>/dataDir/archives/pelletsbin.arc</code> annotated to show how mapping the ARC file would look like with information from the corresponding DIR. Without the DIR file as a guide, the only way you could possibly differentiate between files would be with the <code>0xCC</code> padding between files.
  
 
[[File:ARC_file_documentation.png]][[File:Minty_Meeo_Documentation_Legend.png]]
 
[[File:ARC_file_documentation.png]][[File:Minty_Meeo_Documentation_Legend.png]]
  
====<code>0xCC</code> Padding====
+
==== <code>0xCC</code> padding ====
For whatever reason, files in the ARC are always padded out to have an amount of bytes that is a multiple of 32. These bytes are not included in the file size recorded in the DIR for each file, so the exact purpose of this is unknown.  {{unsure|It could be an absolute necessity, or it could be completely unnecessary.}}
+
Files in the ARC always have padding to nearest multiple of 32, or 0x20. This is because data loading into the Gamecube's register's in multiples of 32 is an optimization.
 
 
  
==Extra Information==
+
== Extra information ==
Every Paired ARC+DIR Files archive has an uncompressed copy elsewhere on the disc.
+
Every paired Bundled Archive file archive has an uncompressed copy elsewhere on the disc.
* In <code>root\dataDir\tekis</code> and <code>root\dataDir\bosses</code>, a file named <code>arc_all.ini</code> can be found.  These INI files holds nothing, but give us a hint at how the developer's archiving tool functioned.
+
* In <code>/dataDir/tekis</code> and <code>/dataDir/bosses</code>, a file named <code>arc_all.ini</code> can be found.  These INI files holds nothing, but are an indicator to the archiving tool to bundle the directory's contents.
* It is unknown if the every file in the archives is identical to its uncompressed sister file.
+
* It is unknown if every file in the archives is identical to its uncompressed sister file.
In the [[OpenGL / Dolphin System]], many files are not read from the Paired ARC+DIR Files archives like they are in the final game, and are instead read from the un-archived versions.   
+
In the [[OpenGL / Dolphin System]], many files are not read from the paired ARC+DIR file archives like they are in the final game, and are instead read from the un-archived versions.   
  
Paired ARC+DIR Files archives that have "bin" in their filename curiously only contain the '''BIN''' files from their respective directory.
+
Bundled Archives that have "bin" in their filename only contain the '''BIN''' files from their respective directory.
  
The <code>log.txt</code> files left in the root of Pikmin 1 [[Pikmin|versions USA Demo, USA v1.00, and JPN v1.02]] detail the plugin "[[OpenGL / Dolphin System|plugTexConv]]" creating a Paired ARC+DIR Files archive.
+
The <code>log.txt</code> files left in the root of [[Pikmin|''Pikmin'' versions USA Demo, USA v1.00, and JPN v1.02]] detail the plugin "[[OpenGL / Dolphin System|plugTexConv]]" creating a paired ARC+DIR file archive.
  
 +
{{Credits|[[User:Minty_Meeo|Minty_Meeo]], [[User:Patrick_Anton|Ambrosia]]}}
  
 
[[Category:Pikmin]]
 
[[Category:Pikmin]]
 
[[Category:File formats]]
 
[[Category:File formats]]

Latest revision as of 16:35, 29 December 2019

ARC files (short for Archive) and DIR files (internally named Bundle ; not to be confused with BUN files) make up one of Pikmin's proprietary data storage formats. The DIR file contains all necessary information about the data in the ARC file, which stores the aforementioned data.

With minimal metadata, the Bundled Archive file format was used to reduce load time by packing several files into one. The purpose it serves is different from the bundle archive, however, as standalone files within the archive can be read independently of the files before it. This makes the Bundled Archive file format useful for archiving large directories with varied purposes, as to its name.

File structure[edit]

As mentioned before, the paired ARC+DIR file archive consists of two files: the mock-directory (DIR) and the BLOB archive (ARC). Think of the mock-directory as a map to navigate through the BLOB archive.

DIR[edit]

DIR files consist of a header followed by a repeating entry for each mock-filepath.

Here is /dataDir/archives/pelletsbin.dir annotated for reference.

DIR file documentation.pngMinty Meeo Documentation Legend.png

Header
Offset Size Purpose
0x00 4 Size of DIR file
0x04 4 Number of entries
Mock-directory entry
Offset Size Purpose
0x00 4 Offset of file in ARC
0x04 4 Size of file in ARC
0x08 4 Mock-directory string length
0x0C 0x08 value Mock-directory path

Mock-directory[edit]

The DIR file emulates filepaths. When a file is unpacked in-game, it is assumed that whatever code is responsible treats the entry in the DIR file as a legitimate filepath on the disc, starting from the root.

ARC[edit]

Here is /dataDir/archives/pelletsbin.arc annotated to show how mapping the ARC file would look like with information from the corresponding DIR. Without the DIR file as a guide, the only way you could possibly differentiate between files would be with the 0xCC padding between files.

ARC file documentation.pngMinty Meeo Documentation Legend.png

0xCC padding[edit]

Files in the ARC always have padding to nearest multiple of 32, or 0x20. This is because data loading into the Gamecube's register's in multiples of 32 is an optimization.

Extra information[edit]

Every paired Bundled Archive file archive has an uncompressed copy elsewhere on the disc.

  • In /dataDir/tekis and /dataDir/bosses, a file named arc_all.ini can be found. These INI files holds nothing, but are an indicator to the archiving tool to bundle the directory's contents.
  • It is unknown if every file in the archives is identical to its uncompressed sister file.

In the OpenGL / Dolphin System, many files are not read from the paired ARC+DIR file archives like they are in the final game, and are instead read from the un-archived versions.

Bundled Archives that have "bin" in their filename only contain the BIN files from their respective directory.

The log.txt files left in the root of Pikmin versions USA Demo, USA v1.00, and JPN v1.02 detail the plugin "plugTexConv" creating a paired ARC+DIR file archive.

Credits: Minty_Meeo, Ambrosia