GameData

From Luma's Workshop
Revision as of 23:39, 13 August 2025 by VTXG (talk | contribs) (Fix luigi entry link)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
This page is in progress and may contain incomplete information or editor's notes.

In Super Mario Galaxy, save data is stored on the Wii's NAND, inside the file GameData.bin.

SMG1

The file starts with a 16-byte long header.

Offset Size Name Description
0x0 4 Checksum A checksum of the file's contents.
0x4 4 Version Always 2
0x8 4 Save Entry Count The number of save entries inside this file. In SMG1, this value is 19.
0xC 4 File Size The size of this file, in bytes.

This is followed up by a list of entry headers, each one with this structure:

Offset Size Name Description
0x0 12 Name The name of this entry.
0xC 4 Offset The offset to this entry's data.

In SMG1, the following entries can be found:

Name Description
mario1 - mario6 User Save Data. (Mario)
luigi1 - luigi6 User Save Data. (Luigi)
config1 - config6 User Config Data. Shared between mario and luigi data.
sysconf System Config Data. Shared across all save entries.

User Save Data

The data starts with a Binary Chunk Holder Header with the following values:

Name Value
Unknown 1
Chunk Count 6

GameDataPlayerStatus Section

This section stores information about the story progress, the star bit count, and the life count.
This section starts with a Binary Chunk Header with the following values:

Name Value Notes
Signature PLAY
Hash 0x27C90F Unknown hash.
Size 19

The actual data is structured as follows:

Offset Size Name Description
0x0 1 Story Progress The story progress value. Corresponds to the progressvalue of Unlabeled Table 1.
0x1 4 Star Bit Count The number of star bits owned.
0x5 2 Life Remaining The player's life count.

NOTE: The Life Remaining value is not used to set the mario's life count, but is instead used for 1-Up mail calculation. (This needs more research)

GameEventFlagStorage Section

This section stores game event flags. A complete list of events can be found in the Progress Checks page.
This section starts with a Binary Chunk Header with the following values:

Name Value Notes
Signature FLG1
Hash 0x65020442 Hash code of the string "2bytes/flag"
Size 126

This section's data is made up of multiple 2-byte numbers:

Offset Bit Count Name Description
0 1 Value If this flag is enabled or not.
1 15 Hash A shortened hash code of the flag's name.

StarPieceAlmsStorage Section

This section stores information about hungry lumas.
This section starts with a Binary Chunk Header with the following values:

Name Value Notes
Signature PCE1
Hash 0xF5DE1DC0 Hash code of the string "StarPieceAlmsStorage" multiplied by 32.
Size 44

The data is an array of 16 2-byte values, each one corresponding to the amount of star bits fed to hungry lumas.
TicoFat and TicoGalaxy use their Obj_arg7 to indicate what index they get/set their star bit count from, although TicoGalaxy uses Obj_arg7 + 8 for the index.
Due to TicoFat and TicoGalaxy having 7 occurrences each, this means that the values at index 7 and 15 go unused.
Furthermore, due to theTicoFat in StarEggRoadZone having an Obj_arg7 of -1, index 0 also goes unused.

SpinDriverPathStorage Section

This section stores information about launch star paths.
This section starts with a Binary Chunk Header with the following values:

Name Value Notes
Signature SPN1
Hash 0x12345679 Unknown hash.
Size 998

Todo.

GameEventValueStorage Section

This section stores game event values. A complete list of events can be found in the Progress Checks page.
This section starts with a Binary Chunk Header with the following values:

Name Value Notes
Signature VLE1
Hash 0x564C4531 The string "VLE1".
Size 112

This section's data is made up of key-value pairs:

Offset Size Name Description
0x0 2 Hash The hash of the event's name.
0x1 2 Value The value of this event.

GameDataAllGalaxyStorage Section

This section stores galaxy information, such as the collected power stars.
This section starts with a Binary Chunk Header with the following values:

Name Value Notes
Signature GALA
Hash 0xBF0640EE Unknown hash.
Size 874

This section uses the Binary Data Content system to write its data.
This section starts with a galaxy count:

Offset Size Name Description
0x0 2 Galaxy Count The number of galaxies. In SMG1, this value is 42.

Followed by a Binary Data Content header:

Name Value
Attribute Count 4
Data Size 20

The Binary Data Content contains the following attributes:

Offset Size Name Description
0x0 2 mGalaxyName The name of the galaxy.
0x2 1 mPowerStarFlag The power star collection flags. Each bit corresponds to a power star.
0x3 1 mFirstPlayFlag Todo.
0x4 16 mMaxCoinNum Todo.

User Config Data

The data starts with a Binary Chunk Holder Header with the following values:

Name Value
Unknown 1
Chunk Count 3

ConfigDataCreateChunk Section

This section defines if the file slot the config data belongs to is created.
This section starts with a Binary Chunk Header with the following values:

Name Value Notes
Signature CONF
Hash 0x2432DA Unknown hash.
Size 13

This section contains a single byte which defines the creation state.

Offset Size Name Description
0x0 1 Creation State If this file slot is created or not:
  • 0 = Not Created;
  • 255 = Created.

ConfigDataMii Section

This section contains information about this file slot's icon.
This section starts with a Binary Chunk Header with the following values:

Name Value Notes
Signature MII
Hash 0x2836E9 Unknown hash.
Size 22

This section's data is the following:

Offset Size Name Description
0x0 1 Icon Flag 1 = Uses Mii ID; 2 = Uses Icon ID (Needs further research)
0x1 8 Mii ID Todo.
0x9 1 Icon ID Todo.

ConfigDataMisc Section

This section contains information about this file slot's icon.
This section starts with a Binary Chunk Header with the following values:

Name Value Notes
Signature MISC
Hash 0x1
Size 21

This section's data is the following:

Offset Size Name Description
0x0 1 Flags A bitfield of flags.
  • Last Loaded Mario = 1;
  • Completed Mario Ending = 2;
  • Completed Luigi Ending = 4.
0x1 8 Last Modified The OSTime since this file was last modified.

System Config Data

The data starts with a Binary Chunk Holder Header with the following values:

Name Value
Unknown 1
Chunk Count 1

SysConfigChunk Section

This section contains game-wide information about Wii mail data.
This section starts with a Binary Chunk Header with the following values:

Name Value Notes
Signature SYSC
Hash 0x1
Size 48

This section uses the Binary Data Content system to write its data:

Name Value
Attribute Count 3
Data Size 20

The Binary Data Content contains the following attributes:

Offset Size Name Description
0x0 8 mTimeAnnounced The last OSTime the PAL60 mode warning was displayed.
0x8 8 mTimeSent The last OSTime a mail was sent to the Wii.
0x10 4 mSentBytes The size, in bytes, of the last mail sent to the Wii.

SMG2

Todo.

Binary Chunk System

To write save entry data, a system was created to read, write, and manage writing sub-sections of the data.

Binary Chunk Holder Header

A 4-byte header used throughout all save entries.

Offset Size Name Description
0x0 1 Unknown 1 in SMG1, and 2 in SMG2. Could be a version number.
0x1 1 Chunk Count The number of chunks in the data.
0x2 2 Padding

Binary Chunk Header

A 12-byte header used for identifying the sub-sections of data.

Offset Size Name Description
0x0 4 Signature A 4-byte long ASCII string
0x4 4 Hash An additional identifier for the chunk.
0x8 4 Size The size of this chunk, in bytes, from the start of this header.

NOTE: The Hash value is not always a hash code, as some chunks simply use 1 as the value.

Binary Data Content

The save file's dynamic data serialization system. The data starts with a 8-byte long header.

Offset Size Name Description
0x0 2 Attribute Count The number of attributes in the data structure.
0x2 2 Data Size The size of the data structure.

This is followed by multiple attribute headers.

Offset Size Name Description
0x0 2 Hash The hash of the attribute's name.
0x2 2 Offset The offset from the start of the data structure.

As for the data, its structure is dinamically created by the attributes. Furthermore, multiple data structures can be written to the data buffer.

Tools

  • TKSaveEditor - A currently WIP tool by VTXG.