codebase-save-load

Serialize versioned GameState with RON and rebuild spatial indices on load.

Updated Dec 13, 2025
One-click install
npx skills add https://github.com/EliasVahlberg/saltglass-steppe --skill codebase-save-load
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: codebase-save-load
Source: https://github.com/EliasVahlberg/saltglass-steppe/tree/main/.kiro_snapshot_2026-04-04_1209/skills/codebase-save-load
Command: npx skills add https://github.com/EliasVahlberg/saltglass-steppe --skill codebase-save-load

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides a deterministic, versioned save and load workflow for persisting and restoring complex game state so that serialization changes, missing derived data, and incompatible files are detected and handled with clear errors.

Core Features & Use Cases

  • Versioned envelope pattern that serializes GameState inside a SaveFile with an explicit version number to prevent accidental incompatible loads.
  • Uses RON for human-readable serialization and includes post-load reconstruction steps such as rebuilding spatial indices and updating lighting.
  • Clear error reporting on version mismatch, tests for roundtrip integrity, and guidance for when to bump the save schema version; useful when adding, removing, or renaming GameState fields or diagnosing corrupted saves.

Quick Start

Use the save system to write the current game state to the default save file and verify that loading performs index rebuilds and lighting updates.

Frequently Asked Questions about codebase-save-load

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle game state serialization and prevent loading incompatible save files in Rust?

Game state serialization in Rust can prevent incompatible loads by wrapping the GameState in a versioned envelope. This approach checks the version number on load and returns a descriptive error if the file's schema does not match the current game version.

What is a versioned envelope pattern for save file migration?

A versioned envelope pattern serializes game state inside a SaveFile structure with an explicit version number. It enables reliable save file migration by detecting schema changes during deserialization and rejecting incompatible files before they corrupt the game.

Does RON serialization work well for human-readable game saves?

RON serialization works well for human-readable game saves because it provides clear text formats for inspecting persisted data. It integrates with versioned envelopes to ensure deterministic saving and loading of complex game states while remaining debuggable.

How do I rebuild spatial indices and update lighting after loading a game state?

To rebuild spatial indices and update lighting after loading game state, perform post-load recomputations during the deserialization process. The save system automatically triggers these reconstruction steps to restore derived data that is not persisted directly in the save file.

When should I bump my save schema version for game state?

You should bump your save schema version when adding, removing, or renaming GameState fields. Incrementing the version number ensures that older save files are detected as incompatible and triggers clear error reporting instead of causing silent data corruption during loading.

Why does loading a migrated save file fail with a version mismatch error?

Loading a migrated save file fails with a version mismatch error because the save system enforces strict version checks against the versioned envelope. This descriptive error indicates that the file's schema version does not match the current game's expected serialization format.