[GH-ISSUE #5094] Experience packages get no combat signal and no way to request an encounter #2817

Closed
opened 2026-10-21 05:56:09 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @kolacheee on GitHub (Aug 15, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5094

Originally assigned to: @kolacheee on GitHub.

The gap

A game-surface Experience package has no reliable way to know combat is happening, and no way to request it.

  1. No combat signal. experienceSurfaceProps (the engine state handed to the package's surface element) carries chat, messages, streaming and scene state — but nothing about combat. The only thing a package can watch is chatMeta.gameActiveState, which is the GM's narrative scene state: it is written by a separate POST /game/state/transition fired alongside the client-side flip, so it lags the actual combat UI by a beat — and it can say "combat" when no combat UI mounted at all (narrated scuffles flip it without an encounter being generated). A package HUD keyed on it either lingers over the combat UI or hides when there is no combat.

  2. No deterministic trigger. Combat entry always routes through the manual-start handler (handleRequestManualCombatStart → generateCombatStateForMessage), gated behind a confirm dialog. An Experience with its own world (e.g. an encounter tile in a pixel RPG) cannot ask for a fight without the player also clicking through a modal that duplicates the intent they just expressed in the Experience's own UI.

Try it yourself

Install any game-surface Experience (or log experienceSurfaceProps from a stub package): enter combat in a game — the package's props never change; only chatMeta.gameActiveState eventually does, after the metadata write lands.

Suggested fix

Additive, client-only, no combat mechanics touched:

  • add combatActive (the already-computed combatUiActive) and combatStyle to experienceSurfaceProps, so a package yields the instant the combat UI actually mounts;
  • add requestCombat(opts?: { hint?: string }) — a thin, identity-stable wrapper that calls the SAME generateCombatStateForMessage pass the manual-start button uses, minus the confirm dialog (the Experience's own UI already expressed the intent). The vanilla LLM pass still decides what the encounter is.

Explicitly not proposed: startCombat(party, enemies) or any direct combat-state injection — letting a package construct combatants outside the engine's generation path would be a combat change, and combat stays vanilla.

Motivation: the pixel-RPG Experience (Pixelforge) currently pauses its world on the narrative state and always keeps a Resume escape hatch because the signal can't be trusted; a real signal removes the lag and the guesswork. From the Pixelforge exploration roadmap (PR-C). Verified against staging @ 3fc292429.

Originally created by @kolacheee on GitHub (Aug 15, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5094 Originally assigned to: @kolacheee on GitHub. ### The gap A `game-surface` Experience package has no reliable way to know combat is happening, and no way to request it. 1. **No combat signal.** `experienceSurfaceProps` (the engine state handed to the package's surface element) carries chat, messages, streaming and scene state — but nothing about combat. The only thing a package can watch is `chatMeta.gameActiveState`, which is the GM's *narrative* scene state: it is written by a separate `POST /game/state/transition` fired alongside the client-side flip, so it lags the actual combat UI by a beat — and it can say "combat" when no combat UI mounted at all (narrated scuffles flip it without an encounter being generated). A package HUD keyed on it either lingers over the combat UI or hides when there is no combat. 2. **No deterministic trigger.** Combat entry always routes through the manual-start handler (`handleRequestManualCombatStart` → `generateCombatStateForMessage`), gated behind a confirm dialog. An Experience with its own world (e.g. an encounter tile in a pixel RPG) cannot ask for a fight without the player also clicking through a modal that duplicates the intent they just expressed in the Experience's own UI. ### Try it yourself Install any game-surface Experience (or log `experienceSurfaceProps` from a stub package): enter combat in a game — the package's props never change; only `chatMeta.gameActiveState` eventually does, after the metadata write lands. ### Suggested fix Additive, client-only, no combat mechanics touched: - add `combatActive` (the already-computed `combatUiActive`) and `combatStyle` to `experienceSurfaceProps`, so a package yields the instant the combat UI actually mounts; - add `requestCombat(opts?: { hint?: string })` — a thin, identity-stable wrapper that calls the SAME `generateCombatStateForMessage` pass the manual-start button uses, minus the confirm dialog (the Experience's own UI already expressed the intent). The vanilla LLM pass still decides what the encounter is. Explicitly **not** proposed: `startCombat(party, enemies)` or any direct combat-state injection — letting a package construct combatants outside the engine's generation path would be a combat change, and combat stays vanilla. Motivation: the pixel-RPG Experience (Pixelforge) currently pauses its world on the narrative state and always keeps a Resume escape hatch because the signal can't be trusted; a real signal removes the lag and the guesswork. From the Pixelforge exploration roadmap (PR-C). Verified against `staging` @ 3fc292429.
bsakaguchi 2026-10-21 05:56:09 +07:00
Author
Owner

@kolacheee commented on GitHub (Aug 15, 2026):

Taking this one (agent working from kolacheee's fork) — draft PR is up. Design notes from the pre-submission adversarial review: requestCombat is identity-stable and returns a refusal code instead of toasting Engine chrome over the package's UI; concluded/replay sessions refuse with "unavailable" (mirroring the sendMessage seam); a synchronous in-flight ref prevents same-frame double calls from fanning out concurrent encounter generations; and startCombat(party, enemies) remains deliberately absent — combat stays Engine-owned.

<!-- gh-comment-id:5304292194 --> @kolacheee commented on GitHub (Aug 15, 2026): Taking this one (agent working from kolacheee's fork) — draft PR is up. Design notes from the pre-submission adversarial review: requestCombat is identity-stable and returns a refusal code instead of toasting Engine chrome over the package's UI; concluded/replay sessions refuse with "unavailable" (mirroring the sendMessage seam); a synchronous in-flight ref prevents same-frame double calls from fanning out concurrent encounter generations; and startCombat(party, enemies) remains deliberately absent — combat stays Engine-owned.
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#2817
No description provided.