[PR #7568] [MERGED] feat(game): worlds that keep what happened, and a world for a game made without one #7802

Closed
opened 2026-10-24 04:07:38 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7568
Author: @kolacheee
Created: 10/13/2026
Status: ✅ Merged
Merged: 10/13/2026
Merged by: @kolacheee

Base: staging ← Head: feat/worlds-keep-what-happened


📝 Commits (5)

  • 2332f6f Worlds that keep what happened, split out of PR 8
  • 1e47fcb Merge staging into the worlds part of PR 8
  • 570a779 fix(world): CodeRabbit on #7568: one world piece at a time, an unreadable snapshot left out of an export, setup imports and ground checked
  • 26a0bde fix(world): an imported world of this generator is made from its recipe
  • 78fff0f Merge remote-tracking branch 'upstream/staging' into split/pr8-worlds

📊 Changes

50 files changed (+2936 additions, -240 deletions)

View changed files

📝 docs/development/optional-agent-packages.md (+6 -1)
📝 docs/game/getting-started.md (+5 -1)
📝 e2e/game-experience-setup.e2e.ts (+3 -0)
📝 e2e/game-world-journal.e2e.ts (+23 -3)
➕ e2e/game-world-save-state.e2e.ts (+144 -0)
📝 packages/client/src/components/game/GameJournal.tsx (+46 -2)
➕ packages/client/src/components/game/GameMakeWorld.tsx (+140 -0)
📝 packages/client/src/components/game/GameSetupWizard.tsx (+10 -5)
📝 packages/client/src/components/game/GameSetupWorldChooser.tsx (+60 -6)
📝 packages/client/src/components/game/GameSetupWorldKitChooser.tsx (+29 -5)
📝 packages/client/src/components/game/GameSurface.tsx (+41 -6)
📝 packages/client/src/features/multiplayer/MultiplayerChat.tsx (+2 -0)
📝 packages/client/src/hooks/use-game.ts (+24 -1)
📝 packages/client/src/lib/game-setup-share.ts (+26 -1)
📝 packages/client/src/localization/locales/en.json (+13 -0)
📝 packages/server/src/db/file-backed-store.ts (+4 -0)
➕ packages/server/src/db/schema/game-world-snapshots.ts (+31 -0)
📝 packages/server/src/db/schema/index.ts (+1 -0)
📝 packages/server/src/routes/chats.routes.ts (+23 -0)
📝 packages/server/src/routes/game-worlds.routes.ts (+45 -21)

...and 30 more files

📄 Description

Linked issue

Part of #7468

This continues the series after the five worlds PRs (#7470 to #7474). It is the worlds half of #7563, split out so each half stays under CodeRabbit's file limit; #7563 keeps the ruleset combat and ruleset work and follows this one. New Overworld games stay behind the MARINARA_OVERWORLD_GAMES switch from #7470, and this PR adds the Journal's half of that lock.

Why this change

  • A generated world was rebuilt from its recipe each session, so what happened to it did not carry over, and a game made without a world could not get one later.
  • A world file carried only the recipe, so a world made by an earlier generator could not be shared as it was made.
  • A market day where the world put the party ended after one turn.

What changed

  • Worlds keep what happened: a game plays on in the world it was made with. The world is kept as the game's snapshot when the game is made, each session folds on from the living world the earlier ones left, and the screen reads the world from the server instead of making it again from its recipe.
  • World files carry the world as it was made: a world file, a setup file and a room's setup keep the world's snapshot, so a world made by another version of the generator is played as it was made.
  • A world for a game made without one: the Journal offers to make a world for a game that has none, written for the game's own setting with its own connection. It is greyed while Overworld games are locked, and never offered for a game an Experience runs.
  • Setup: a long write in setup counts its seconds and says a model can take a few minutes.
  • Fixes: a market day where the world put the party runs across turns and counts its buys.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md
  • On this branch merged with staging 185fc5d99: pnpm check green, and the world (28), import (13), export (6) and avatar (8) regression lanes pass. The market, game-setup and multiplayer lanes passed on the earlier staging merge 58cd2e777.
  • E2E: game-world-journal, game-world-save-state and game-experience-setup pass (19 tests, desktop Chromium).

Manual verification notes

  • Not checked by a person yet: making a world from the Journal for a live game.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)
  • docs/game/getting-started.md and docs/development/optional-agent-packages.md changed. The translations are tracked on #7512.

UI evidence (if applicable)

No screenshots attached. The e2e specs above drive these screens.

Summary by CodeRabbit

  • New Features

    • Eligible existing games can receive a world from the journal, starting on the next turn without changing earlier turns.
    • World files preserve the generated world, so worlds from earlier generator versions can be imported and played. These worlds cannot be edited.
    • Worlds persist across saves, sessions, branches, and exported chats.
    • World and setting-kit generation show elapsed time and a notice when writing takes longer.
    • World-file size limits are increased to 8 MB; map-pack files remain limited to 2 MB.
  • Bug Fixes

    • Invalid or incompatible world imports are refused with an explanation. Changing a world’s seed or brief discards its hand edits and story data.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/7568 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 10/13/2026 **Status:** ✅ Merged **Merged:** 10/13/2026 **Merged by:** [@kolacheee](https://github.com/kolacheee) **Base:** `staging` ← **Head:** `feat/worlds-keep-what-happened` --- ### 📝 Commits (5) - [`2332f6f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2332f6f6c4f616f8446d67d59b958ed08bd405db) Worlds that keep what happened, split out of PR 8 - [`1e47fcb`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1e47fcb4ecb757556c2a606c2025ce0f9e8edad7) Merge staging into the worlds part of PR 8 - [`570a779`](https://github.com/Pasta-Devs/Marinara-Engine/commit/570a779f98abb2b638b97cf0952d086f2c93b6b7) fix(world): CodeRabbit on #7568: one world piece at a time, an unreadable snapshot left out of an export, setup imports and ground checked - [`26a0bde`](https://github.com/Pasta-Devs/Marinara-Engine/commit/26a0bde7d2a5d3854944b6626ed4c86d68f9a166) fix(world): an imported world of this generator is made from its recipe - [`78fff0f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/78fff0ff4c88c3e0bfdaee44cfc2a78ee68d5ad4) Merge remote-tracking branch 'upstream/staging' into split/pr8-worlds ### 📊 Changes **50 files changed** (+2936 additions, -240 deletions) <details> <summary>View changed files</summary> 📝 `docs/development/optional-agent-packages.md` (+6 -1) 📝 `docs/game/getting-started.md` (+5 -1) 📝 `e2e/game-experience-setup.e2e.ts` (+3 -0) 📝 `e2e/game-world-journal.e2e.ts` (+23 -3) ➕ `e2e/game-world-save-state.e2e.ts` (+144 -0) 📝 `packages/client/src/components/game/GameJournal.tsx` (+46 -2) ➕ `packages/client/src/components/game/GameMakeWorld.tsx` (+140 -0) 📝 `packages/client/src/components/game/GameSetupWizard.tsx` (+10 -5) 📝 `packages/client/src/components/game/GameSetupWorldChooser.tsx` (+60 -6) 📝 `packages/client/src/components/game/GameSetupWorldKitChooser.tsx` (+29 -5) 📝 `packages/client/src/components/game/GameSurface.tsx` (+41 -6) 📝 `packages/client/src/features/multiplayer/MultiplayerChat.tsx` (+2 -0) 📝 `packages/client/src/hooks/use-game.ts` (+24 -1) 📝 `packages/client/src/lib/game-setup-share.ts` (+26 -1) 📝 `packages/client/src/localization/locales/en.json` (+13 -0) 📝 `packages/server/src/db/file-backed-store.ts` (+4 -0) ➕ `packages/server/src/db/schema/game-world-snapshots.ts` (+31 -0) 📝 `packages/server/src/db/schema/index.ts` (+1 -0) 📝 `packages/server/src/routes/chats.routes.ts` (+23 -0) 📝 `packages/server/src/routes/game-worlds.routes.ts` (+45 -21) _...and 30 more files_ </details> ### 📄 Description ## Linked issue Part of #7468 This continues the series after the five worlds PRs (#7470 to #7474). It is the worlds half of #7563, split out so each half stays under CodeRabbit's file limit; #7563 keeps the ruleset combat and ruleset work and follows this one. New Overworld games stay behind the `MARINARA_OVERWORLD_GAMES` switch from #7470, and this PR adds the Journal's half of that lock. ## Why this change - A generated world was rebuilt from its recipe each session, so what happened to it did not carry over, and a game made without a world could not get one later. - A world file carried only the recipe, so a world made by an earlier generator could not be shared as it was made. - A market day where the world put the party ended after one turn. ## What changed - **Worlds keep what happened:** a game plays on in the world it was made with. The world is kept as the game's snapshot when the game is made, each session folds on from the living world the earlier ones left, and the screen reads the world from the server instead of making it again from its recipe. - **World files carry the world as it was made:** a world file, a setup file and a room's setup keep the world's snapshot, so a world made by another version of the generator is played as it was made. - **A world for a game made without one:** the Journal offers to make a world for a game that has none, written for the game's own setting with its own connection. It is greyed while Overworld games are locked, and never offered for a game an Experience runs. - **Setup:** a long write in setup counts its seconds and says a model can take a few minutes. - **Fixes:** a market day where the world put the party runs across turns and counts its buys. ## Validation - [x] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` - On this branch merged with staging 185fc5d99: `pnpm check` green, and the `world` (28), `import` (13), `export` (6) and `avatar` (8) regression lanes pass. The `market`, `game-setup` and `multiplayer` lanes passed on the earlier staging merge 58cd2e777. - E2E: `game-world-journal`, `game-world-save-state` and `game-experience-setup` pass (19 tests, desktop Chromium). ### Manual verification notes - Not checked by a person yet: making a world from the Journal for a live game. ## Docs and release impact - [ ] No docs changes needed - [x] Updated docs (README / CONTRIBUTING / android/README) as needed - [x] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) - `docs/game/getting-started.md` and `docs/development/optional-agent-packages.md` changed. The translations are tracked on #7512. ## UI evidence (if applicable) No screenshots attached. The e2e specs above drive these screens. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Eligible existing games can receive a world from the journal, starting on the next turn without changing earlier turns. * World files preserve the generated world, so worlds from earlier generator versions can be imported and played. These worlds cannot be edited. * Worlds persist across saves, sessions, branches, and exported chats. * World and setting-kit generation show elapsed time and a notice when writing takes longer. * World-file size limits are increased to 8 MB; map-pack files remain limited to 2 MB. * **Bug Fixes** * Invalid or incompatible world imports are refused with an explanation. Changing a world’s seed or brief discards its hand edits and story data. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:07:38 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#7802
No description provided.