Expand description
Save/load for dotzuki run: GameSave, a versioned JSON snapshot.
The save lives at <project>/.dotzuki-save.json (a dotfile in the project
dir; override with --save-file). It captures only stable overworld
state — current map, player tile + facing, persistent story flags,
language — never a suspended scene engine, so it is written at stable
points (see crate::game::RunnerGame) and resumes into a fresh
overworld.
A plain versioned serde JSON file was chosen over the engine’s binary
slot/CRC16 framework (dotzuki_engine::save): one file, human-readable,
trivially debuggable, and corruption tolerance is handled by the
load-then-validate path below. Loading never fails hard: a missing,
unreadable, corrupt or version-mismatched file logs a warning and
returns None, and the game boots fresh.
Structs§
- Game
Save - A
dotzuki runsave file. - Party
Member Save - One party member’s persistent battle state (v2): current HP/MP and the
non-volatile status (a
kind: Statusrecord id) carried between battles. Base stats are NOT saved — they are rebuilt from the records each battle. With abattle.levelsblock,level/expride along as OPTIONAL fields (the version stays 3: a save without them simply defaults to level 1 / 0 EXP, and older tooling ignores unknown keys). - Player
Save - Saved player state (tile coordinates + facing + elevation level).
Constants§
- DEFAULT_
SAVE_ FILE - Default save file name in the project directory.
- SAVE_
VERSION - Current save format version. Saves from a NEWER version are ignored
(fresh boot); older saves load with per-field defaults (v1 has no party
or inventory — both start fresh; v1/v2 have no money — the manifest’s
shop.startMoneydefault applies; party members withoutlevel/expdefault to level 1 / 0 EXP — the levels fields are optional, so the version stays 3).