Savegame: kaitai format (#1713)

* Add savegame.ksy

* Updates

* Updates
This commit is contained in:
Christian Semmler
2026-01-10 16:27:44 -07:00
committed by GitHub
parent f52b275130
commit 4998bdaf65
6 changed files with 1027 additions and 5 deletions

View File

@@ -116,19 +116,19 @@ void LegoRace::Enable(MxBool p_enable)
// FUNCTION: LEGO1 0x10015f30 // FUNCTION: LEGO1 0x10015f30
RaceState::RaceState() RaceState::RaceState()
{ {
m_entries[0].m_id = 1; m_entries[0].m_id = LegoActor::c_pepper;
m_entries[0].m_lastScore = 0; m_entries[0].m_lastScore = 0;
m_entries[0].m_score = 0; m_entries[0].m_score = 0;
m_entries[1].m_id = 2; m_entries[1].m_id = LegoActor::c_mama;
m_entries[1].m_lastScore = 0; m_entries[1].m_lastScore = 0;
m_entries[1].m_score = 0; m_entries[1].m_score = 0;
m_entries[2].m_id = 3; m_entries[2].m_id = LegoActor::c_papa;
m_entries[2].m_lastScore = 0; m_entries[2].m_lastScore = 0;
m_entries[2].m_score = 0; m_entries[2].m_score = 0;
m_entries[3].m_id = 4; m_entries[3].m_id = LegoActor::c_nick;
m_entries[3].m_lastScore = 0; m_entries[3].m_lastScore = 0;
m_entries[3].m_score = 0; m_entries[3].m_score = 0;
m_entries[4].m_id = 5; m_entries[4].m_id = LegoActor::c_laura;
m_entries[4].m_lastScore = 0; m_entries[4].m_lastScore = 0;
m_entries[4].m_score = 0; m_entries[4].m_score = 0;
m_state = RaceState::e_carrace; m_state = RaceState::e_carrace;

View File

@@ -15,6 +15,7 @@ Kaitai Struct allows you to define binary formats in a YAML-based `.ksy` file, w
| File | Extension | Description | | File | Extension | Description |
|------|-----------|-------------| |------|-----------|-------------|
| [`savegame.ksy`](/docs/savegame.ksy) | `.GS` | Main game save data (game state, progress, customizations) |
| [`players.ksy`](/docs/players.ksy) | `.gsi` | Player profile save data (usernames) | | [`players.ksy`](/docs/players.ksy) | `.gsi` | Player profile save data (usernames) |
| [`history.ksy`](/docs/history.ksy) | `.gsi` | Score history and high scores | | [`history.ksy`](/docs/history.ksy) | `.gsi` | Score history and high scores |
@@ -29,6 +30,9 @@ See the [Kaitai Struct Visualizer installation instructions](https://github.com/
The [Kaitai Struct Visualizer](https://github.com/kaitai-io/kaitai_struct_visualizer) (`ksv`) provides an interactive terminal UI for exploring binary files. The [Kaitai Struct Visualizer](https://github.com/kaitai-io/kaitai_struct_visualizer) (`ksv`) provides an interactive terminal UI for exploring binary files.
```bash ```bash
# View a save game file
ksv samples/G0.GS savegame.ksy
# View a Players.gsi file # View a Players.gsi file
ksv samples/Players.gsi players.ksy ksv samples/Players.gsi players.ksy
@@ -41,6 +45,9 @@ ksv samples/History.gsi history.ksy
`ksdump` outputs the parsed structure as JSON or YAML for scripting and inspection. `ksdump` outputs the parsed structure as JSON or YAML for scripting and inspection.
```bash ```bash
# Dump a save game to JSON
ksdump --format json samples/G0.GS savegame.ksy
# Dump Players.gsi to JSON # Dump Players.gsi to JSON
ksdump --format json samples/Players.gsi players.ksy ksdump --format json samples/Players.gsi players.ksy
@@ -51,5 +58,6 @@ ksdump --format yaml samples/History.gsi history.ksy
## Sample Files ## Sample Files
The [`samples/`](/docs/samples/) directory contains example save files for testing: The [`samples/`](/docs/samples/) directory contains example save files for testing:
- `G0.GS`, `G1.GS`, `G2.GS` - Sample main game save files (slots 0, 1, 2)
- `Players.gsi` - Sample player profile data - `Players.gsi` - Sample player profile data
- `History.gsi` - Sample score history data - `History.gsi` - Sample score history data

BIN
docs/samples/G0.GS Executable file

Binary file not shown.

BIN
docs/samples/G1.GS Executable file

Binary file not shown.

BIN
docs/samples/G2.GS Executable file

Binary file not shown.

1014
docs/savegame.ksy Normal file

File diff suppressed because it is too large Load Diff