Skip to content

feat(world): resumable New Game worlds with save and Load - #111

Merged
alexjercan merged 7 commits into
frozen-sectorsfrom
resumable-worlds
Oct 9, 2026
Merged

alexjercan merged 7 commits into
frozen-sectorsfrom
resumable-worlds

Conversation

@alexjercan

Copy link
Copy Markdown
Owner

Task: tasks/20261007-090756 (resumable New Game worlds). Depends on #110 (frozen-sectors); this PR targets that branch and must merge after it.

What it does

  • Desktop New Game asks for a world name and saves the world to disk on each sector crossing and on leaving. Death keeps the last save.
  • A Load screen lists saved worlds and shows why a world cannot load. A status line shows the last save. Leaving shows a save overlay with Try again.
  • Load is a real resume, not a reseed. It restores the frozen sector ledger (mined rocks, surviving sections with health, ammunition and plates, holds, credits, AI progress, canisters), the player ship pose, stock and credits, and rounds, torpedoes and detached pieces in flight.
  • A load that cannot fill its window is refused, and the refusal releases the clocks (crates/nova_core/tests/world_resume_refusal.rs).
  • (breaking) A scenario object id or a ship section id may not contain /, and two sections of one ship may not share an id. Both fail at lint and at load.
  • Docs: the architecture, wiki and create pages now say that a saved world keeps state across a Load.

Proof

  • Unit and ECS tests in nova_world_base::save, nova_ship frozen pieces, rounds and torpedoes, the camera resume, and the nova_menu load and leave screens.
  • system_world_resume example (Xvfb + lavapipe): it creates a world, saves, leaves, then loads. It pairs each thawed transient with its saved record by save-list index and checks the player pose, credits and stock at thaw. Two consecutive full passes, with 47 and 32 transients and a 0.0000 m / 0.0000 s max delta on each kind (tasks/20261007-090756/SW-PT9.md). The before-leave and after-load frames show the same hull, the same chunk and the same PDC markers.
  • P7 save-cost measurement, reported but not asserted (tasks/20261007-090756/P7.md).

Limitations

  • The web build keeps no saved worlds. New Game there is a one-off session with no Load button or world name field.
  • Only the Open World New Game saves. Authored scenarios still reset stock and credits on reload.
  • P7 is a one-sided save-cost reading on a shared host. Its branch-vs-master streaming comparison also includes the feat(world): freeze streamed sectors in session memory #110 frozen-sector work, so it does not isolate persistence.
  • The full workspace tests and Clippy were not run locally (repo policy). CI owns them.

alexjercan and others added 2 commits October 9, 2026 08:20
… worlds

Pair each thawed transient with its saved record by save-list index in
system_world_resume, and check the player pose, credits and stock at thaw.
Docs now state that a saved world keeps stock, credits and the frozen
ledger across a Load. Format world_resume_refusal. Add the SW-PT9 round
7-8 proof notes and the P7 save-cost measurement for task
20261007-090756.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@alexjercan
alexjercan requested a balanced review from Copilot October 9, 2026 10:51
@alexjercan
alexjercan added this pull request to stack #112 October 9, 2026 10:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Saved-world lock and canister-ID validation are incomplete, and the new systems probe is missing required catalog registration.

3 open findings
What changed in this PR

Adds native saved Open Worlds with resumable sector, ship, camera, inventory, and transient state.

Changes:

  • Adds save/load lifecycle, UI, validation, and failure handling.
  • Serializes frozen world and combat state.
  • Updates examples, tests, documentation, and probes.
File Description
CHANGELOG.md Records persistence changes.
Cargo.lock Updates dependency lockfile.
Cargo.toml Registers resume example.
crates/​nova_assets/​src/​collections.rs Exposes asteroid texture path.
crates/​nova_assets/​src/​lib.rs Re-exports texture constant.
crates/​nova_assets/​src/​merge.rs Validates ship section IDs.
crates/​nova_assets/​src/​storage.rs Adds worlds storage root.
crates/​nova_assets/​tests/​section_load_gate.rs Tests invalid design rejection.
crates/​nova_bench/​src/​manual.md Documents world-name entry.
crates/​nova_bench/​src/​manual.rs Updates automated New Game instructions.
crates/​nova_core/​Cargo.toml Adds resume-test dependencies.
crates/​nova_core/​src/​lib.rs Routes native window closing.
crates/​nova_core/​src/​loading_screen.rs Shows resume progress.
crates/​nova_core/​tests/​world_resume_refusal.rs Tests failed-resume cleanup.
crates/​nova_events/​src/​lib.rs Serializes entity IDs.
crates/​nova_gameplay/​src/​cooldown.rs Serializes cooldown state.
crates/​nova_gameplay/​src/​damage.rs Serializes projectile damage.
crates/​nova_gameplay/​src/​freeze.rs Adds world-resume clock owner.
crates/​nova_gameplay/​src/​integrity/​carve.rs Serializes damage marks.
crates/​nova_gameplay/​src/​integrity/​chunk.rs Restores chunk grace.
crates/​nova_gameplay/​src/​integrity/​health.rs Serializes health.
crates/​nova_gameplay/​src/​inventory.rs Persists inventory and canister IDs.
crates/​nova_gameplay/​src/​lib.rs Exports saved references.
crates/​nova_gameplay/​src/​lifetime.rs Restores transient lifetimes.
crates/​nova_gameplay/​src/​mesh/​field.rs Serializes carved fields.
crates/​nova_gameplay/​src/​rounds.rs Freezes and thaws rounds.
crates/​nova_gameplay/​src/​saved_refs.rs Defines durable saved references.
crates/​nova_menu/​Cargo.toml Adds save UI test dependencies.
crates/​nova_menu/​src/​leave.rs Implements save-before-leave flow.
crates/​nova_menu/​src/​lib.rs Registers persistence UI systems.
crates/​nova_menu/​src/​load_screen.rs Implements saved-world picker.
crates/​nova_menu/​src/​menu_ui.rs Adds Load UI and exit handling.
crates/​nova_menu/​src/​pause.rs Adds Load-last-save behavior.
crates/​nova_menu/​src/​save_status.rs Displays save status.
crates/​nova_menu/​src/​tests/​leave.rs Tests leave workflows.
crates/​nova_menu/​src/​tests/​load_screen.rs Tests saved-world loading.
crates/​nova_menu/​src/​tests/​mod.rs Registers new menu tests.
crates/​nova_menu/​src/​tests/​support.rs Isolates test world storage.
crates/​nova_menu/​src/​tests/​world_setup.rs Tests named world creation.
crates/​nova_menu/​src/​world_setup.rs Adds world-name creation flow.
crates/​nova_scenario/​src/​actions/​spawn.rs Guards resumed ship spawning.
crates/​nova_scenario/​src/​lint/​scenario.rs Rejects reserved object IDs.
crates/​nova_scenario/​src/​lint/​ship.rs Lints section IDs.
crates/​nova_scenario/​src/​loader/​lifecycle.rs Tests invalid inline designs.
crates/​nova_scenario/​src/​mining.rs Serializes mining state.
crates/​nova_scenario/​src/​objects/​asteroid.rs Persists asteroid state.
crates/​nova_scenario/​src/​objects/​asteroid_carve.rs Persists carved chunks.
crates/​nova_scenario/​src/​objects/​ship_design.rs Enforces section-ID rules.
crates/​nova_scenario/​src/​objects/​spaceship.rs Freezes and resumes ships.
crates/​nova_ship/​src/​camera/​chase.rs Blends resumed camera pose.
crates/​nova_ship/​src/​camera/​mod.rs Exports resume camera APIs.
crates/​nova_ship/​src/​camera/​resume.rs Captures saved camera views.
crates/​nova_ship/​src/​camera/​resume/​tests.rs Tests camera restoration.
crates/​nova_ship/​src/​camera/​rig.rs Applies resumed camera state.
crates/​nova_ship/​src/​camera/​zoom.rs Documents persisted zoom.
crates/​nova_ship/​src/​input/​ai/​behavior.rs Serializes AI behavior.
crates/​nova_ship/​src/​input/​ai/​frozen.rs Serializes frozen AI.
crates/​nova_ship/​src/​input/​ai/​mod.rs Serializes engagement grace.
crates/​nova_ship/​src/​input/​ai/​threat.rs Serializes AI threat state.
crates/​nova_ship/​src/​sections/​ammo.rs Serializes ammunition state.
crates/​nova_ship/​src/​sections/​cargo_intake_section.rs Persists canisters and queues.
crates/​nova_ship/​src/​sections/​controller_section.rs Marks placeholder controller art.
crates/​nova_ship/​src/​sections/​damage_cracks.rs Preserves wreck damage art.
crates/​nova_ship/​src/​sections/​docking_section/​render.rs Marks placeholder docking art.
crates/​nova_ship/​src/​sections/​fixture.rs Retains shed-fixture styles.
crates/​nova_ship/​src/​sections/​frozen.rs Extends frozen section state.
crates/​nova_ship/​src/​sections/​frozen_piece.rs Saves detached pieces.
crates/​nova_ship/​src/​sections/​frozen_rounds.rs Restores projectile art.
crates/​nova_ship/​src/​sections/​hull_section.rs Marks placeholder hull art.
crates/​nova_ship/​src/​sections/​integrity.rs Adds durable wreck IDs.
crates/​nova_ship/​src/​sections/​mod.rs Registers transient freeze modules.
crates/​nova_ship/​src/​sections/​placeholder_art.rs Identifies placeholder art.
crates/​nova_ship/​src/​sections/​railgun_section/​mod.rs Serializes railgun charge.
crates/​nova_ship/​src/​sections/​railgun_section/​render.rs Marks placeholder railgun art.
crates/​nova_ship/​src/​sections/​section_animation.rs Serializes animation state.
crates/​nova_ship/​src/​sections/​shell_skin.rs Rebuilds frozen plate colliders.
crates/​nova_ship/​src/​sections/​skin_decor.rs Rebuilds decor colliders.
crates/​nova_ship/​src/​sections/​skin_style.rs Serializes ship styles.
crates/​nova_ship/​src/​sections/​thruster_section.rs Marks placeholder thruster art.
crates/​nova_ship/​src/​sections/​torpedo_section/​bay.rs Emits launch events.
crates/​nova_ship/​src/​sections/​torpedo_section/​frozen.rs Saves torpedoes in flight.
crates/​nova_ship/​src/​sections/​torpedo_section/​mod.rs Exports frozen torpedo APIs.
crates/​nova_ship/​src/​sections/​torpedo_section/​render.rs Uses launch events for effects.
crates/​nova_ship/​src/​sections/​turret_section/​firing.rs Emits round-fired events.
crates/​nova_ship/​src/​sections/​turret_section/​mod.rs Exports round events.
crates/​nova_ship/​src/​sections/​turret_section/​render.rs Uses firing events for effects.
crates/​nova_ship/​src/​sections/​turret_section/​setup.rs Serializes turret hinges.
crates/​nova_ship/​src/​sections/​turret_section/​stow.rs Serializes turret stow state.
crates/​nova_ship/​src/​ship_audio/​combat.rs Uses launch events for audio.
crates/​nova_world/​Cargo.toml Adds ledger serialization.
crates/​nova_world/​src/​frozen.rs Snapshots and restores ledgers.
crates/​nova_world/​src/​generation.rs Prepares frozen asteroid geometry.
crates/​nova_world/​src/​lib.rs Exports snapshot APIs.
crates/​nova_world/​src/​streaming.rs Shares frozen sector records.
crates/​nova_world/​src/​tests/​frozen.rs Tests ledger persistence.
crates/​nova_world_base/​Cargo.toml Adds native save dependencies.
crates/​nova_world_base/​src/​clusters.rs Updates fixture imports.
crates/​nova_world_base/​src/​lib.rs Installs save and restore systems.
crates/​nova_world_base/​src/​save/​mod.rs Defines disk save format.
crates/​nova_world_base/​src/​save/​session.rs Drives save sessions.
crates/​nova_world_base/​src/​save/​tests.rs Tests save format and lifecycle.
crates/​nova_world_base/​src/​save/​transients.rs Restores saved transients.
crates/​nova_world_base/​src/​ship_layout.rs Exposes test fixture packs.
crates/​nova_world_base/​src/​test_support.rs Provides save test fixture.
crates/​nova_world_base/​src/​tests.rs Uses shared fixture packs.
docs/​architecture.md Documents persistence architecture.
examples/​screenshots/​lesson_generated_world.rs Names screenshot worlds.
examples/​screenshots/​lesson_menu_advanced.rs Names screenshot worlds.
examples/​screenshots/​lesson_menu_mouse.rs Names screenshot worlds.
examples/​screenshots/​lesson_menu_quality.rs Names screenshot worlds.
examples/​screenshots/​loop_world_start.rs Automates world-name entry.
examples/​screenshots/​screenshot_menu.rs Captures named-world setup.
examples/​systems/​bug_failed_assets.rs Updates New Game automation.
examples/​systems/​system_menu_boot.rs Updates menu boot flow.
examples/​systems/​system_open_world.rs Updates Open World flow.
examples/​systems/​system_open_world_identity.rs Updates identity flow.
examples/​systems/​system_session_loop.rs Updates session-loop flow.
examples/​systems/​system_world_resume.rs Adds end-to-end resume probe.
tasks/​20261007-090756/​CAMERA-GATE.md Records camera decisions.
tasks/​20261007-090756/​GATE.md Records implementation gate.
tasks/​20261007-090756/​MUTATIONS.md Records mutation evidence.
tasks/​20261007-090756/​P7.md Reports save-cost measurements.
tasks/​20261007-090756/​PROOF-CAMDEPS.md Records camera dependency proof.
tasks/​20261007-090756/​PROOF-EXAMPLES.md Records example verification.
tasks/​20261007-090756/​PROOF-LOADFLAKE.md Records load-test flake.
tasks/​20261007-090756/​PROOF-LOADORDER.md Records load-order checks.
tasks/​20261007-090756/​PROOF-P6FRAMES.md Records rendered proof.
tasks/​20261007-090756/​PROOF-P6FRAMES2.md Records rendered rerun.
tasks/​20261007-090756/​PROOF-T1.md Records transient proof.
tasks/​20261007-090756/​PROOF-TIMEFIX.md Records timing fix proof.
tasks/​20261007-090756/​REVIEW-S123.md Records slice review.
tasks/​20261007-090756/​REVIEW-S4.md Records UI slice review.
tasks/​20261007-090756/​REVIEW-T1.md Records transient review.
tasks/​20261007-090756/​REVIEW-T23.md Records transient reviews.
tasks/​20261007-090756/​SCOUT-ART.md Investigates saved art.
tasks/​20261007-090756/​SCOUT-IDLESS.md Investigates id-less targets.
tasks/​20261007-090756/​SCOUT-IDS.md Investigates durable IDs.
tasks/​20261007-090756/​SCOUT-PIECES.md Investigates detached pieces.
tasks/​20261007-090756/​SCOUT-SLASH.md Investigates reserved IDs.
tasks/​20261007-090756/​SCOUT-TRANSIENTS.md Investigates transient scope.
tasks/​20261007-090756/​SCOUT-TRIGGERS.md Investigates cue triggers.
tasks/​20261007-090756/​SLICE4.md Specifies UI delivery slice.
tasks/​20261007-090756/​SW-ACCESS.md Records access changes.
tasks/​20261007-090756/​SW-CAMPROOF.md Records camera tests.
tasks/​20261007-090756/​SW-CHUNK.md Records chunk persistence.
tasks/​20261007-090756/​SW-CUES.md Records cue changes.
tasks/​20261007-090756/​SW-CUETEST.md Records cue tests.
tasks/​20261007-090756/​SW-DOCK.md Records docking behavior.
tasks/​20261007-090756/​SW-DOCS.md Records documentation work.
tasks/​20261007-090756/​SW-EXAMPLES.md Records example updates.
tasks/​20261007-090756/​SW-IDRULE.md Records ID validation.
tasks/​20261007-090756/​SW-LOAD.md Records Load UI work.
tasks/​20261007-090756/​SW-P6.md Records rendered proof work.
tasks/​20261007-090756/​SW-PIECE.md Records piece persistence.
tasks/​20261007-090756/​SW-PT11.md Records proof task.
tasks/​20261007-090756/​SW-PT9.md Records resume proof.
tasks/​20261007-090756/​SW-REFUSE.md Records refusal flow.
tasks/​20261007-090756/​SW-ROUNDS.md Records round persistence.
tasks/​20261007-090756/​SW-SAVETESTS.md Records save tests.
tasks/​20261007-090756/​SW-SERDE.md Records serialization work.
tasks/​20261007-090756/​SW-SHED.md Records shed-fixture work.
tasks/​20261007-090756/​SW-TORPEDO.md Records torpedo persistence.
tasks/​20261007-090756/​SW-WRECKID.md Records wreck-ID work.
tasks/​20261007-090756/​T1-PLAN.md Plans transient implementation.
tasks/​20261007-090756/​TRANSIENT-GATE.md Defines transient gate.
tasks/​20261007-090756/​p6-frames/​world_resume-leave-overlay.png Captures failed-save overlay.
tasks/​20261007-090756/​p6-frames/​world_resume-load-screen.png Captures Load screen.
tasks/​20261007-090756/​p6-frames/​world_resume-status-line.png Captures save status.
web/​src/​create/​objects.md Documents creator persistence.
web/​src/​wiki/​flight-autopilot.md Documents saved camera zoom.
web/​src/​wiki/​getting-started.md Documents saved worlds.
web/​src/​wiki/​interface.md Documents persisted inventory.
web/​src/​wiki/​scenarios.md Updates Open World behavior.
web/​src/​wiki/​sections/​cargo-intake.md Documents saved canisters.
web/​src/​wiki/​sections/​mining-beam.md Documents mined canister persistence.

🧠 Review effort: Balanced


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread Cargo.toml
Comment thread crates/nova_world_base/src/save/mod.rs
Comment thread crates/nova_world_base/src/save/mod.rs
@alexjercan
alexjercan merged commit b210fee into master Oct 9, 2026
7 checks passed
@alexjercan
alexjercan deleted the resumable-worlds branch October 9, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants