[PR #4112] [MERGED] Add Hierarchical Maps location visuals and generation context #6237

Closed
opened 2026-10-23 04:08:29 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4112
Author: @thetopham
Created: 7/26/2026
Status: ✅ Merged
Merged: 7/26/2026
Merged by: @SpicyMarinara

Base: staging ← Head: dev/maps-location-reference-images


📝 Commits (10+)

  • 36d0396 feat(spatial): add location visual images
  • 21617da feat(spatial): persist map background position
  • 598b850 feat(gallery): generate reviewed location images
  • 41bdff5 Merge remote-tracking branch 'origin/staging' into dev/maps-location-reference-images
  • 4530291 fix(game): preserve illustration location context
  • abe63f2 feat(maps): follow narrated location changes
  • d8862f1 feat(maps): show minimap in roleplay
  • ff2abd2 revert: show minimap in roleplay
  • 2e3ed6f feat(maps): expose known location paths
  • 8b53b3a fix(game): constrain expanded world map

📊 Changes

17 files changed (+701 additions, -70 deletions)

View changed files

📝 packages/client/src/components/game/GameMap.tsx (+3 -2)
📝 packages/client/src/components/game/GameSurface.tsx (+19 -2)
📝 packages/server/src/routes/gallery.routes.ts (+145 -17)
📝 packages/server/src/routes/game.routes.ts (+101 -36)
📝 packages/server/src/routes/generate.routes.ts (+116 -7)
📝 packages/server/src/routes/generate/retry-agents-route.ts (+24 -1)
📝 packages/server/src/services/game/game-asset-generation.ts (+7 -1)
➕ packages/server/src/services/image/gallery-image-path.ts (+22 -0)
📝 packages/server/src/services/image/image-generation.ts (+9 -0)
➕ packages/server/src/services/image/spatial-location-reference.ts (+51 -0)
📝 packages/server/src/services/prompt-overrides/registry/game-assets.ts (+11 -1)
📝 packages/server/src/services/spatial-context/state-resolution.ts (+66 -1)
📝 packages/shared/src/constants/game-storyboard-image-prompts.ts (+4 -0)
📝 packages/shared/src/schemas/spatial-context.schema.ts (+4 -0)
📝 packages/shared/src/types/spatial-context.ts (+12 -0)
📝 scripts/regressions/prompt.regression.ts (+46 -2)
📝 scripts/regressions/spatial-context.regression.ts (+61 -0)

📄 Description

Linked issue

Related to Pasta-Devs/Marinara-Agents#78
Related to Pasta-Devs/Marinara-Agents#79

The companion Marinara-Agents package PR is intentionally deferred so the Engine host contract can be reviewed first.

Why this change

  • Hierarchical Maps locations can define stable visual identities and per-layer map backgrounds, but Engine had no compatible persistence, gallery, historical-resolution, or image-generation contract for those package-owned controls.
  • Storyboard, Game scene art, and Roleplay illustration generation therefore could not consistently reuse the image assigned to the narrated location.
  • Narration could also advance independently of the selected map location, while the Game world-map panel could grow over lower controls such as Logs.

What changed

  • Extend the shared spatial-location contract with an optional gallery reference image, a generation opt-in, a per-layer background image, and saved background positioning.
  • Add the narrow gallery and spatial-resolution helpers needed to create reviewed location references and resolve the location associated with the source message rather than always using the latest location.
  • Attach the eligible location image to Roleplay Illustrator, Game scene illustration, Storyboard generation, and agent retry paths while reserving provider capacity for it and adding an explicit location-handling prompt line.
  • Expose active map locations as name-only breadcrumb paths and apply validated hidden spatial directives so narration can reuse known locations or discover a new one only when needed.
  • Constrain the expanded desktop world-map panel and make its package content scroll internally so it cannot intercept controls below it.
  • Add focused prompt and spatial regressions for the new schema, historical location resolution, reference ordering, prompt handling, and narrated moves.

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

Manual verification notes

  • Ran pnpm check; it stops at the existing impeccable:check guard with Impeccable context loader did not return valid JSON. before the remaining stages.
  • pnpm localization:check
  • pnpm lint
  • pnpm regression:spatial
  • pnpm regression:prompt
  • pnpm build
  • Manually verified the installed app at desktop, compact-desktop, and mobile widths: the expanded world map scrolls internally, Logs remains clickable, and the modal opens.
  • Played through Roleplay using a known route, a new off-map location, and a return to an existing known location; the existing nodes were reused and only the genuinely new place was added.
  • Played through Game Mode using a map-selected known hop, a new off-map location, and a return to an existing known location; existing locations were reused without duplicates.
  • Verified an interrupted planned route remains at Guild Hall when combat begins there; no move to Tower Gate is committed.
  • Verified the location-reference prompt and reference payload are present in Game illustration/Storyboard generation when the current location has an enabled reference image.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) 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)

No Engine version bump is included. User-facing Maps editor controls and package release metadata remain in the deferred Marinara-Agents companion change.

UI evidence (if applicable)

No screenshots included. Manual installed-browser coverage is listed above.

Summary by CodeRabbit

  • New Features
    • Added the ability to generate and save gallery background images directly from supported game chats.
    • Generated illustrations can now incorporate map location reference images and configured visual settings.
    • Added support for narrated spatial movement and discovery directives, including committed map transitions.
  • Bug Fixes
    • Improved image previews so reviewed prompts and resolved illustration details remain synchronized.
    • Gallery images now retain their actual dimensions.
    • Improved game map panel sizing and scrolling behavior.

🔄 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/4112 **Author:** [@thetopham](https://github.com/thetopham) **Created:** 7/26/2026 **Status:** ✅ Merged **Merged:** 7/26/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `dev/maps-location-reference-images` --- ### 📝 Commits (10+) - [`36d0396`](https://github.com/Pasta-Devs/Marinara-Engine/commit/36d039607843e9c3d37042ec94709effb29d8468) feat(spatial): add location visual images - [`21617da`](https://github.com/Pasta-Devs/Marinara-Engine/commit/21617dab110475bc165527ae9eff8fc5fba4f7be) feat(spatial): persist map background position - [`598b850`](https://github.com/Pasta-Devs/Marinara-Engine/commit/598b850f87b8b29617b9c50f7f31769062fab50a) feat(gallery): generate reviewed location images - [`41bdff5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/41bdff521975b8a91e7f24f66feb40ef704cc75c) Merge remote-tracking branch 'origin/staging' into dev/maps-location-reference-images - [`4530291`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4530291fcb1b5c4dee8afae77d459081532548b4) fix(game): preserve illustration location context - [`abe63f2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/abe63f2308f5a934639dda0a3f7a274b747efc20) feat(maps): follow narrated location changes - [`d8862f1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d8862f157d5af95626f603ea48cacbbc541671c5) feat(maps): show minimap in roleplay - [`ff2abd2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ff2abd2dc2a342d22404c9bf14953f9c3b3bb87d) revert: show minimap in roleplay - [`2e3ed6f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2e3ed6f568c9041802fb1e7003318294efbc8389) feat(maps): expose known location paths - [`8b53b3a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8b53b3ab61538be4f9db045f593b20ba7885eead) fix(game): constrain expanded world map ### 📊 Changes **17 files changed** (+701 additions, -70 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/game/GameMap.tsx` (+3 -2) 📝 `packages/client/src/components/game/GameSurface.tsx` (+19 -2) 📝 `packages/server/src/routes/gallery.routes.ts` (+145 -17) 📝 `packages/server/src/routes/game.routes.ts` (+101 -36) 📝 `packages/server/src/routes/generate.routes.ts` (+116 -7) 📝 `packages/server/src/routes/generate/retry-agents-route.ts` (+24 -1) 📝 `packages/server/src/services/game/game-asset-generation.ts` (+7 -1) ➕ `packages/server/src/services/image/gallery-image-path.ts` (+22 -0) 📝 `packages/server/src/services/image/image-generation.ts` (+9 -0) ➕ `packages/server/src/services/image/spatial-location-reference.ts` (+51 -0) 📝 `packages/server/src/services/prompt-overrides/registry/game-assets.ts` (+11 -1) 📝 `packages/server/src/services/spatial-context/state-resolution.ts` (+66 -1) 📝 `packages/shared/src/constants/game-storyboard-image-prompts.ts` (+4 -0) 📝 `packages/shared/src/schemas/spatial-context.schema.ts` (+4 -0) 📝 `packages/shared/src/types/spatial-context.ts` (+12 -0) 📝 `scripts/regressions/prompt.regression.ts` (+46 -2) 📝 `scripts/regressions/spatial-context.regression.ts` (+61 -0) </details> ### 📄 Description ## Linked issue Related to Pasta-Devs/Marinara-Agents#78 Related to Pasta-Devs/Marinara-Agents#79 The companion Marinara-Agents package PR is intentionally deferred so the Engine host contract can be reviewed first. ## Why this change - Hierarchical Maps locations can define stable visual identities and per-layer map backgrounds, but Engine had no compatible persistence, gallery, historical-resolution, or image-generation contract for those package-owned controls. - Storyboard, Game scene art, and Roleplay illustration generation therefore could not consistently reuse the image assigned to the narrated location. - Narration could also advance independently of the selected map location, while the Game world-map panel could grow over lower controls such as Logs. ## What changed - Extend the shared spatial-location contract with an optional gallery reference image, a generation opt-in, a per-layer background image, and saved background positioning. - Add the narrow gallery and spatial-resolution helpers needed to create reviewed location references and resolve the location associated with the source message rather than always using the latest location. - Attach the eligible location image to Roleplay Illustrator, Game scene illustration, Storyboard generation, and agent retry paths while reserving provider capacity for it and adding an explicit location-handling prompt line. - Expose active map locations as name-only breadcrumb paths and apply validated hidden spatial directives so narration can reuse known locations or discover a new one only when needed. - Constrain the expanded desktop world-map panel and make its package content scroll internally so it cannot intercept controls below it. - Add focused prompt and spatial regressions for the new schema, historical location resolution, reference ordering, prompt handling, and narrated moves. ## Validation - [x] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [x] 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` ### Manual verification notes - Ran `pnpm check`; it stops at the existing `impeccable:check` guard with `Impeccable context loader did not return valid JSON.` before the remaining stages. - `pnpm localization:check` - `pnpm lint` - `pnpm regression:spatial` - `pnpm regression:prompt` - `pnpm build` - Manually verified the installed app at desktop, compact-desktop, and mobile widths: the expanded world map scrolls internally, Logs remains clickable, and the modal opens. - Played through Roleplay using a known route, a new off-map location, and a return to an existing known location; the existing nodes were reused and only the genuinely new place was added. - Played through Game Mode using a map-selected known hop, a new off-map location, and a return to an existing known location; existing locations were reused without duplicates. - Verified an interrupted planned route remains at Guild Hall when combat begins there; no move to Tower Gate is committed. - Verified the location-reference prompt and reference payload are present in Game illustration/Storyboard generation when the current location has an enabled reference image. ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) 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) No Engine version bump is included. User-facing Maps editor controls and package release metadata remain in the deferred Marinara-Agents companion change. ## UI evidence (if applicable) No screenshots included. Manual installed-browser coverage is listed above. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added the ability to generate and save gallery background images directly from supported game chats. * Generated illustrations can now incorporate map location reference images and configured visual settings. * Added support for narrated spatial movement and discovery directives, including committed map transitions. * **Bug Fixes** * Improved image previews so reviewed prompts and resolved illustration details remain synchronized. * Gallery images now retain their actual dimensions. * Improved game map panel sizing and scrolling behavior. <!-- 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-23 04:08:29 +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#6237
No description provided.