Nintendo Badge Arcade/PrizeCollection

From 3dbrew
< Nintendo Badge Arcade
Revision as of 18:51, 18 December 2022 by Jonbarrow (talk | contribs) (→‎Language Names: Clarified information on the language names)
Jump to navigation Jump to search

Overview

A PrizeCollection SARC file has the following folder structure:

root
└── pc
    ├── PrizeCollection.xml
    ├── ci
    └── rt
        ├── At
        ├── CI
        ├── Ca
        ├── Cr
        ├── FO
        └── Pr

Each of the subfolders contains a custom file format storing different properties between those. Each of those files are compressed using Yaz0 compression.

Subfolder File type
ci Crane Instance (cib)
At Attachment (atb)
CI Crane Icon (icb)
Ca Category (cab)
Cr Crane (crb)
FO Fixed Object (fob)
Pr Prize (prb)

PrizeCollection.xml

This file has an index of all of the game data stored here. It has the following data:

<?xml version="1.0" encoding="UTF-8"?>
<CenterPrizeCollectionFile>
  <Categories count="x">
    <Category name="CategoryName" />
  </Categories>
  <Cranes count="x">
    <Crane name="CraneName" />
  </Cranes>
  <CraneIcons count="x">
    <CraneIcon name="CraneIconName" />
  </CraneIcons>
  <Prizes count="x">
    <Prize name="PrizeName" />
  <Attachments count="x">
    <Attachment name="AttachmentName" />
  </Attachments>
  <FixedObjects count="x">
    <FixedObject name="FixedObjectName" />
  </FixedObjects>
  <CraneInstances>
    <CraneInstance name="CraneInstanceName" />
  </CraneInstances>
</CenterPrizeCollectionFile>

Crane Instance (cib)

A crane instance file stores the data of a set and the components of the machine.

Offset Size Description
0x0 0x4 Header magic (CIBS)
0x30 0x30 Crane Instance name
0x60 0x30 Crane name
0x90 0x30 Crane Icon name
0x100 0x1000 Language Names
0x1100 + Offset 0x30 Prize name x
0x1880 + Offset 0x30 Fixed Object name x

Offset = 0x30 * x

Attachment (atb)

An attachment file stores the data of an immovable object and its image.

Offset Size Description
0x0 0x4 Header magic (ATBS)
0x2C 0x30 Attachment name
0x5C 0x4 Image width
0x60 0x4 Image height
0x80 w * h ETC1A4 image of attachment
0x80 + (w * h) w * h A8 data of previous image

Crane Icon (icb)

A crane icon file stores the icon of a set (crane instance).

Offset Size Description
0x0 0x4 Header magic (ICBS)
0x1C 0x30 Crane icon name
0x100 0x2000 64x64 RGB565 image

Category (cab)

A category file stores the data of a group of sets and its category image.

Offset Size Description
0x0 0x4 Header magic (CABS)
0x24 0x4 Category ID
0x2C 0x30 Category name
0x5C 0x4 Number of badges
0x60 0x4 Number of sets (crane instances)
0x68 0x1000 Language Names
0x2080 0x2000 64x64 RGB565 image of category

Crane (crb)

A crane file stores the background image used on a set (crane instance).

Offset Size Description
0x0 0x4 Header magic (CRBS)
0x1C 0x30 Crane name
0x800 0x10000 ETC1 image? (Unknown resolution)

Fixed Object (fob)

A fixed object file stores the data of the terrain and its image.

Offset Size Description
0x0 0x4 Header magic (FOBS)
0x24 0x30 Fixed object name
0x54 0x4 Image width
0x58 0x4 Image height
0x80 w * h ETC1A4 image of fixed object

Prize (prb)

A prize file stores the badge data and its image.

Offset Size Description
0x0 0x4 Header magic (PRBS)
0x4 0x38 Unknown
0x3C 0x4 Badge ID
0x40 0x4 Unknown
0x44 0x30 Badge file name
0x74 0x30 Badge category
0xA4 0x8 Title ID it opens (0xFFFFFFFF if none)
0xAC 0xC Unknown
0xB8 0x4 Number of horizontal tiles
0xBC 0x4 Number of vertical tiles
0xE0 0x1000 Badge display names
0x10E0 0x20 Unknown (usually zero?)
0x1100 Image data

Following the badges metadata is it's image data. Each badge contains multiple images used in different places during gameplay

An image can be either RGB565 or ETC1A4. RGB565 images are immediately followed with A4 data for itself, whereas ETC1A4 images are immediately followed with A8 data for itself

A badge may take up multiple spaces on the Home Menu, and as such contains images for each space called "tiles". The number of image tiles a badge uses is found in the badge metadata at offsets 0xB8 and 0xBC

All badge image data begins with a 64x64 RGB565 image of the full badge. Following the 64x64 image is a 32x32 RGB565 image of the full badge, which is used in the badge selector in Home Menu

If the badge is 1x1 tiles, then the first 64x64 RGB565 image is used in Home Menu to display the badge. If the badge is not 1x1, then the badge contains x*y number of additional 64x64 and 32x32 RGB565 images, where x is the number of horizontal tiles and y is the number of vertical tiles. These tiles are then used in Home Menu to display the badge. These additional images are stored immediately after the 32x32 image

Finally, the last image in the badge image data is a single 128x128 ETC1A4 image of the full badge which is used in game

Offset Size Description
0x1100 0x2000 64x64 RGB565 image of full badge (used in Home Menu if badge is 1x1)
0x3100 0x800 A4 data
0x3900 0x800 32x32 RGB565 image of full badge (used in badge selector in Home Menu)
0x4100 0x200 A4 data
0x2000 64x64 Optional additional RGB565 image tile(s). Only exists if badge is not 1x1 (used in Home Menu if badge is not 1x1)
0x800 A4 data
0x800 32x32 Optional additional RGB565 image tile(s). Only exists if badge is not 1x1 (unknown use)
0x200 A4 data
0x4000 128x128 ETC1A4 image (used in game)
0x4000 A8 data

Language Names

Some files, like the badge and the category file, store its display name in a set of 16 different languages.

Each language is stored as a little-endian utf16 string, in an allocated 0x100 byte section stacked on top of each other.

A string does not need to fill the entire 0x100 byte section, the remaining data is set to null bytes

The languages are ordered as follows:

  1. Japanese
  2. English
  3. French
  4. German
  5. Italian
  6. Spanish
  7. Chinese (simple)
  8. Korean
  9. Dutch
  10. Portuguese
  11. Russian
  12. Chinese (traditional)
  13. Unknown
  14. Unknown
  15. Unknown
  16. Unknown