mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #6215] [Feature]: Finish rolled Game turns in one request without showing the Game Master the dice #3466
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#3466
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @kolacheee on GitHub (Sep 14, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6215
Originally assigned to: @kolacheee on GitHub.
What problem does this solve?
A Game turn that rolls dice costs two full provider requests. The Game Master writes a draft with a sparse check or
[dice:]tag in it, the engine rolls, and then the whole prompt goes back to the model so it can rewrite the narration with the real numbers. The second request resends every message, so on a long chat a single skill check roughly doubles the input tokens of that turn, and on a provider without prompt caching it doubles the bill.The only lever today is Narrate dice outcomes immediately. Turning it off keeps the turn at one request, but the outcome is not narrated until the next turn, so the player reads the attempt, sees the die, and waits.
A pre-rolled dice pool was the first idea for closing this. It works, but it puts a number in front of the model before it decides what the check is and how hard it is, and nothing in the engine can tell whether a difficulty suits the fiction. A model that can see a 19 can pick a DC the 19 clears. That trade-off should be a deliberate opt-in, not the default.
Proposed solution
A per-chat switch in Chat Settings, Function Calling: Finish rolled turns in one request, off by default. While it is on, the Game Master is asked to write a check in one of three forms and to pick by what the outcome actually is. The engine rolls after the writing is done, and the model never sees a number before it commits its prose on the default path.
branch="label"attribute, followed by[branch: label] [on success] ... [on failure] ... [/branch]. The engine rolls through the existing check resolver, keeps the half the roll selected, and deletes the other before anything reads the turn. The discarded half's commands are gone before the spatial and package-verb parsers run.[[roll: 2d6+3]]in the middle of a sentence. The engine rolls it withcrypto.randomIntat parse time and substitutes the total.[[roll: 1d8+STR]]adds a character-sheet modifier by name, offered only when the chat has names to resolve; a name that does not resolve refuses the placeholder rather than defaulting to zero. The rolls appear in the dice history and the session log, and the substituted number carries a hover with the dice behind it.Failure contract: a placeholder the engine cannot read becomes a visible "(roll unavailable)" notice, a branch block it cannot read keeps the recorded roll and drops both halves, and a pass that throws saves the turn with the affected tags left sparse. In none of those cases is a second request made. The stream holds a placeholder or a branch block back while the draft streams, so the player never watches a raw tag turn into a number.
Under the switch, an opt-in sub-option, also off by default: Let the Game Master see one die of each size. The engine throws one die of each standard size before the turn and shows the next value of each, so a three-way outcome can be narrated in the same pass. The engine keeps the queue, hands values out in order, never repeats one, recomputes every number in the record, bounds the DC, and rethrows a size that goes unspent for a few turns. Its help text says plainly that the Game Master can steer outcomes it can see, which the blind forms do not allow.
Two things still cost an extra request and are stated in the docs: a
roll_dicetool call when Enable Tool Use is on and the tool is in the chat's list, and a separate Game tool connection, which always makes its own planning request. Neither is the narration rewrite this removes.Alternatives considered
roll_diceinstead. A tool call is a full extra round of the tool loop and is only available on connections with native tools.{{roll:}}macro spelling. Collides with the macro expander, which already claims that shape.Additional context
The Engine change is ready and its PR is opened alongside this issue. Everything is opt-in per chat and nothing changes how an already-saved transcript reads. The prompt-caching findings gathered while measuring this are deliberately out of scope and will come as a separate PR.
Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked: