Paired ARC+DIR file

From Pikmin Technical Knowledge Base
(Redirected from Paired ARC+DIR Files)
Jump to navigation Jump to search

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

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

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

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

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

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

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