Skip to content

Save — Samples

The Save Samples folder contains runnable scenes for exploring how the save coordinator composes state from many systems into a single payload.

These samples are designed to:

  • Demonstrate the participant contract in isolation
  • Show what a real payload looks like
  • Provide a copyable starting point for your own save state

They are not production systems and can be safely removed from builds.


Save Is Not A System

Every other folder under Samples/Systems/ belongs to a system you can add or remove. Save is different: it lives in Core, ships in every package, and holds no opinion about what is being saved.

That shapes what these samples can show. There is no "Save system" to demonstrate — only a contract, IRevSaveParticipant, and a coordinator that composes whatever implements it. The samples here teach that contract directly rather than any one system's save format.


Folder Overview

Samples/
  Systems/
    Save/
      Scenes/       // Runnable coordinator demos

Where The Rest Of Save Lives

Location Contains
Teaching/Save/ SaveCoordinatorPanel — the teachable panel these scenes use
Integrations/Save/<System>/ Per-system participants: Health, Currency, Inventory, Crafting, StatusEffects
Documentation/Save/ The guarantees matrix and public API reference
Runtime/Core/Save/ RevSaveCoordinator, RevSaveReport, RevSaveSection

The per-system participants are translators, not modifications — no system was changed to support saving, so deleting a system still compiles.


Usage Guidance

  • Use the scenes to understand the participant contract and the report
  • Use Integrations/Save/ when you want a framework system's state in your save
  • Write your own IRevSaveParticipant for game state the framework knows nothing about — quest flags, unlocked levels, settings

Framework systems are not privileged here. Your participants sit in the same payload alongside theirs, through the same interface.


Important Notes

  • The coordinator performs no file I/O. It takes and returns a string, so where a save lives is yours: Application.persistentDataPath, PlayerPrefs, cloud save, inside a larger save of your own, or encrypted.
  • Scenes require Play Mode — the teachable panel is drawn through OnGUI.
  • The panel is gated on REV_TEACHABLES and drops out when Teaching/ is removed for a shipping build.

  • Save — Guarantees Matrix
  • Save — Public API
  • Core — IRevSaveParticipant
  • Teaching Panels — guided debugging and inspection

These samples exist to help you understand and validate the contract.

Use them as a reference — then write participants for your own game state.