[GH-ISSUE #5959] Let the GM ask the engine to roll any dice from narration text, not just d20 checks #3301

Closed
opened 2026-10-21 06:01:48 +07:00 by bsakaguchi · 1 comment
Owner

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

Originally assigned to: @SpicyMarinara on GitHub.

The gap this closes: the engine already throws honest dice for d20 skill checks over a plain text channel — no tools API involved, which is why it works on every connection including Claude/Grok subscriptions (#5923). But that resolver only answers d20-shaped checks. isEngineRollableSkillCheckTag (shared/src/utils/skill-check-tag.ts:90) deliberately refuses pools, 3d6, 1d10, bare 2d20, count/mode disagreements — even 1d20+3. Those tags are left byte-identical, which means the numbers standing in the saved text for a 6d10 pool are the model's inventions. That's honest labeling, not honest dice.

So a player running anything but d20 gets made-up numbers today, and a player on a subscription connection has no path to real ones for those systems at all (the roll_dice tool can't reach them — see #5958).

The ask: let the GM request any roll in narration text and have the server throw it.

[dice: 3d8+2]   →   resolved server-side, spliced back into the content

Most of this already exists — the transport is general, only the resolver is narrow:

  • shared/src/utils/dice-notation.ts is already the single shared grammar across the /roll service, the skill-check tag, the tool executor and the client roller.
  • The [skill_check:] grammar already carries arbitrary dice=, resolution="successes" and per-die rolls=.
  • resolveSkillCheckTagsInContent already rewrites resolved values into the message content in reading order, handles every tag in a turn, and runs before the content-replace event and before the save. It never inspects the provider or connection.
  • The player-side roller is already fully general (POST /game/dice/roll, arbitrary notation, clamped at 100 dice / 1000 sides).

Suggested scope, cheapest first:

  1. A [dice: …] request tag resolved by the existing rewriter, sharing the same grammar and the same clamps.
  2. Draw the animated card for it. A server-resolved roll currently renders as a flat text badge (game-narration-format.ts:36); mirroring what skill checks already do is roughly six lines and is the cheapest part of the whole design.
  3. A resolution="successes" branch so pool systems are genuinely rolled rather than left as invention.

The honest feel cost, in the words a player would use — this is the real difference from a tool call, not the card:

  • "The GM stops mid-move." You get "You press flat to the wall and hold your breath—" and then nothing; a card flips up with 14; you send another turn to find out whether the guard walked past. Every roll breaks the prose at the same place.
  • "The GM can't build toward anything." It doesn't know whether it's writing toward triumph or disaster, so the run-up to a roll is flat and it can't foreshadow.
  • "Sometimes the story and the card disagree" — see the separate span-scoping issue.

The shipped softener: rolling from the dice tray before sending gives about a beat and a half — the GM sees your raw die while writing, though not the verdict, since modifiers are applied after.

Relationship to the tool path: #5924's roll_dice buys the two things this channel structurally cannot — arbitrary notation and in-turn reaction — for connections that can call tools. This isn't a replacement for it; it's the honest floor for everyone else, and it's the only way subscription users ever get real non-d20 dice.

Originally created by @kolacheee on GitHub (Sep 8, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5959 Originally assigned to: @SpicyMarinara on GitHub. **The gap this closes:** the engine already throws honest dice for d20 skill checks over a plain text channel — no tools API involved, which is why it works on every connection including Claude/Grok subscriptions (#5923). But that resolver only answers d20-shaped checks. `isEngineRollableSkillCheckTag` (`shared/src/utils/skill-check-tag.ts:90`) deliberately refuses pools, `3d6`, `1d10`, bare `2d20`, count/mode disagreements — even `1d20+3`. Those tags are left byte-identical, which means **the numbers standing in the saved text for a 6d10 pool are the model's inventions.** That's honest labeling, not honest dice. So a player running anything but d20 gets made-up numbers today, and a player on a subscription connection has no path to real ones for those systems at all (the `roll_dice` tool can't reach them — see #5958). **The ask:** let the GM request *any* roll in narration text and have the server throw it. ``` [dice: 3d8+2] → resolved server-side, spliced back into the content ``` **Most of this already exists — the transport is general, only the resolver is narrow:** - `shared/src/utils/dice-notation.ts` is already the single shared grammar across the `/roll` service, the skill-check tag, the tool executor and the client roller. - The `[skill_check:]` grammar already carries arbitrary `dice=`, `resolution="successes"` and per-die `rolls=`. - `resolveSkillCheckTagsInContent` already rewrites resolved values into the message content in reading order, handles every tag in a turn, and runs before the content-replace event and before the save. It never inspects the provider or connection. - The player-side roller is already fully general (`POST /game/dice/roll`, arbitrary notation, clamped at 100 dice / 1000 sides). **Suggested scope, cheapest first:** 1. A `[dice: …]` request tag resolved by the existing rewriter, sharing the same grammar and the same clamps. 2. **Draw the animated card for it.** A server-resolved roll currently renders as a flat text badge (`game-narration-format.ts:36`); mirroring what skill checks already do is roughly six lines and is the cheapest part of the whole design. 3. A `resolution="successes"` branch so pool systems are genuinely rolled rather than left as invention. **The honest feel cost, in the words a player would use** — this is the real difference from a tool call, not the card: - *"The GM stops mid-move."* You get "You press flat to the wall and hold your breath—" and then nothing; a card flips up with 14; you send another turn to find out whether the guard walked past. Every roll breaks the prose at the same place. - *"The GM can't build toward anything."* It doesn't know whether it's writing toward triumph or disaster, so the run-up to a roll is flat and it can't foreshadow. - *"Sometimes the story and the card disagree"* — see the separate span-scoping issue. The shipped softener: rolling from the dice tray *before* sending gives about a beat and a half — the GM sees your raw die while writing, though not the verdict, since modifiers are applied after. **Relationship to the tool path:** #5924's `roll_dice` buys the two things this channel structurally cannot — arbitrary notation *and* in-turn reaction — for connections that can call tools. This isn't a replacement for it; it's the honest floor for everyone else, and it's the only way subscription users ever get real non-d20 dice.
bsakaguchi 2026-10-21 06:01:48 +07:00
  • closed this issue
  • added the
    in-pr
    label
Author
Owner

@SpicyMarinara commented on GitHub (Sep 8, 2026):

Implementation is owned by @SpicyMarinara with Codex in draft #5979, as part of the authorized issue sweep. The work reuses the shared dice parser, existing cards, and per-swipe metadata.

<!-- gh-comment-id:5592958529 --> @SpicyMarinara commented on GitHub (Sep 8, 2026): Implementation is owned by @SpicyMarinara with Codex in draft #5979, as part of the authorized issue sweep. The work reuses the shared dice parser, existing cards, and per-swipe metadata.
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#3301
No description provided.