[GH-ISSUE #6405] [Feature]: a ruleset catalog entry cannot change how a check is rolled, so charms that re-roll or add successes are flavour text #3583

Closed
opened 2026-10-21 06:04:31 +07:00 by bsakaguchi · 4 comments
Owner

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

Originally assigned to: @kolacheee on GitHub.

The gap

A ruleset author can write a charm, a knack or a feat whose whole point is that it changes a check: "re-roll all 1s until none remain", "this check succeeds automatically", "add two dice to this one check", "count 9s as two successes this time". Today none of that can be said, and a contributor who writes it gets a row that costs a resource and changes nothing about the dice.

Three separate things stop it, and fixing any one alone is not enough:

  1. The rule never reaches the sheet. rowsFromCatalogEntry (packages/shared/src/schemas/ruleset.schema.ts) copies a picked entry's row.values plus the _catalog marker. label, summary and mechanics stay in the catalog, so the sheet row is a name and nothing else.
  2. The Game Master never sees the entry on a normal turn. renderRulesetSheetBlock (packages/shared/src/features/rulesets/sheet-prompt.ts) prints only each row's nameColumn. An entry's summary reaches exactly one place in the codebase, features/rulesets/combat-bridge.ts, which is the combat subsystem. No entry prose is in the non-combat prompt at all.
  3. mechanics cannot describe a check. Every key of catalogMechanicsSchema is combat shaped: kind (attack, heal, buff, debuff, utility), range, area, amount, damageType, attackRoll, save, cost, applies, budget. There is nothing about dice, thresholds or successes, and nothing in the skill-check path reads mechanics at all.

And the roll itself is the Engine's: rollDicePoolCheck in packages/shared/src/features/rulesets/sheet-math.ts throws every die with a crypto RNG, and isRulesetRollableSkillCheckTag deliberately ignores any dice= or resolution= the model wrote. That is the right design, and it is exactly why the rule has to be expressible as DATA rather than left to the model.

What exists today, so nobody reimplements it

  • resolution.explode adds a die on a HIGH face. It is not a re-roll and never replaces a face.
  • resolution.situationalDice plus the Game Master's bonus= adds dice to one check, clamped to the declared range.
  • [sheet: op="use" name="..."] already pays an entry's mechanics.cost, all or nothing. The spending half of this already works; only the effect is missing.
  • docs/extending/writing-rulesets.md already says this out loud: "Two things this kind does not model are re-rolls bought with a resource and automatic successes."

Suggested shape

A closed, neutral mechanics.check block on a catalog entry, read by the skill-check resolver the way mechanics is read by the combat bridge. A first cut, all optional:

check: {
  reroll?: { upTo: number, mode: "once" | "until" },   // re-throw dice at or below `upTo`
  dice?: number,                                        // extra dice for this check
  successes?: number,                                   // automatic successes added
  threshold?: number,                                   // this check's per-die target instead
  applies: "next-check" | "named-check"                 // when it is spent
}

with the same discipline the rest of the format keeps: bounded numbers, an Engine ceiling on a "until" loop, refused at import when the ruleset's resolution kind cannot honour it (a dice-sum ruleset has no successes to add), and a Capability API bump so an older Engine refuses the package rather than silently ignoring the charm.

Invocation can stay exactly as it is: the player says it narratively, the Game Master writes the use tag it already knows, and the Engine pays the cost and applies the effect to that turn's check instead of only paying.

Why it matters

This is the difference between a ruleset that can describe its own character options and one where every interesting charm is flavour text. It came up from a contributor question about a charm that re-rolls 1s.

Originally created by @kolacheee on GitHub (Sep 20, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6405 Originally assigned to: @kolacheee on GitHub. ## The gap A ruleset author can write a charm, a knack or a feat whose whole point is that it changes a **check**: "re-roll all 1s until none remain", "this check succeeds automatically", "add two dice to this one check", "count 9s as two successes this time". Today none of that can be said, and a contributor who writes it gets a row that costs a resource and changes nothing about the dice. Three separate things stop it, and fixing any one alone is not enough: 1. **The rule never reaches the sheet.** `rowsFromCatalogEntry` (`packages/shared/src/schemas/ruleset.schema.ts`) copies a picked entry's `row.values` plus the `_catalog` marker. `label`, `summary` and `mechanics` stay in the catalog, so the sheet row is a name and nothing else. 2. **The Game Master never sees the entry on a normal turn.** `renderRulesetSheetBlock` (`packages/shared/src/features/rulesets/sheet-prompt.ts`) prints only each row's `nameColumn`. An entry's `summary` reaches exactly one place in the codebase, `features/rulesets/combat-bridge.ts`, which is the combat subsystem. No entry prose is in the non-combat prompt at all. 3. **`mechanics` cannot describe a check.** Every key of `catalogMechanicsSchema` is combat shaped: `kind` (attack, heal, buff, debuff, utility), `range`, `area`, `amount`, `damageType`, `attackRoll`, `save`, `cost`, `applies`, `budget`. There is nothing about dice, thresholds or successes, and nothing in the skill-check path reads `mechanics` at all. And the roll itself is the Engine's: `rollDicePoolCheck` in `packages/shared/src/features/rulesets/sheet-math.ts` throws every die with a crypto RNG, and `isRulesetRollableSkillCheckTag` deliberately ignores any `dice=` or `resolution=` the model wrote. That is the right design, and it is exactly why the rule has to be expressible as DATA rather than left to the model. ## What exists today, so nobody reimplements it - `resolution.explode` adds a die on a HIGH face. It is not a re-roll and never replaces a face. - `resolution.situationalDice` plus the Game Master's `bonus=` adds dice to one check, clamped to the declared range. - `[sheet: op="use" name="..."]` already pays an entry's `mechanics.cost`, all or nothing. **The spending half of this already works**; only the effect is missing. - `docs/extending/writing-rulesets.md` already says this out loud: "Two things this kind does not model are re-rolls bought with a resource and automatic successes." ## Suggested shape A closed, neutral `mechanics.check` block on a catalog entry, read by the skill-check resolver the way `mechanics` is read by the combat bridge. A first cut, all optional: ``` check: { reroll?: { upTo: number, mode: "once" | "until" }, // re-throw dice at or below `upTo` dice?: number, // extra dice for this check successes?: number, // automatic successes added threshold?: number, // this check's per-die target instead applies: "next-check" | "named-check" // when it is spent } ``` with the same discipline the rest of the format keeps: bounded numbers, an Engine ceiling on a `"until"` loop, refused at import when the ruleset's `resolution` kind cannot honour it (a `dice-sum` ruleset has no successes to add), and a Capability API bump so an older Engine refuses the package rather than silently ignoring the charm. Invocation can stay exactly as it is: the player says it narratively, the Game Master writes the `use` tag it already knows, and the Engine pays the cost and applies the effect to that turn's check instead of only paying. ## Why it matters This is the difference between a ruleset that can describe its own character options and one where every interesting charm is flavour text. It came up from a contributor question about a charm that re-rolls 1s.
bsakaguchi 2026-10-21 06:04:31 +07:00
Author
Owner

@kolacheee commented on GitHub (Sep 20, 2026):

Context from the contributor who ran into this, which sharpens the shape:

For auto-successes it'd be something narrative like "I spend 1 willpower to gain a success" or "I spend a point of blood for Potence to gain 3 auto-successes on this roll" and similar lorebook/catalog look-up for the rule on the sheet

Those two sentences are not the same feature, and the difference matters:

1. A standing rule of the system, not of any one entry. "Spend 1 willpower for one automatic success" is true of every check in that game, whether or not the character has picked anything. It has no catalog entry to hang on, so mechanics.check is the wrong home for it. It belongs beside resolution, something like:

resolution.spend: [{ pool: "willpower", amount: 1, successes: 1, perCheck: 1 }]

one or two entries at most, bounded, with a per-check cap so a full pool cannot buy an unlosable roll.

2. An effect an entry gives, scaled by what the character bought. "A point of blood for Potence, three automatic successes" is Potence's own rule, and the three comes from the rating on the sheet. That is mechanics.check on the catalog entry, and the existing pair mechanics.cost plus mechanics.perCostStep already expresses the scaling half: one blood buys one step, three blood buys three. So the entry says what a step is worth and the Engine does the arithmetic, exactly as it already does for a spell cast at a higher level.

Both end in the same place: the Engine adds successes to the roll it is about to make. Neither can work by being read out of the sheet in prose, because the Game Master model cannot influence a pool roll at all: isRulesetRollableSkillCheckTag deliberately discards any dice the model writes, and rollDicePoolCheck throws every die itself. The look-up the contributor is imagining has to end in data, not in text the model is trusted to honour.

One consequence worth stating in the design: a ruleset whose resolution is dice-sum has no successes to add, so both forms must be refused at import for that kind rather than silently ignored.

<!-- gh-comment-id:5747093648 --> @kolacheee commented on GitHub (Sep 20, 2026): Context from the contributor who ran into this, which sharpens the shape: > For auto-successes it'd be something narrative like "I spend 1 willpower to gain a success" or "I spend a point of blood for Potence to gain 3 auto-successes on this roll" and similar lorebook/catalog look-up for the rule on the sheet Those two sentences are not the same feature, and the difference matters: **1. A standing rule of the system, not of any one entry.** "Spend 1 willpower for one automatic success" is true of every check in that game, whether or not the character has picked anything. It has no catalog entry to hang on, so `mechanics.check` is the wrong home for it. It belongs beside `resolution`, something like: ``` resolution.spend: [{ pool: "willpower", amount: 1, successes: 1, perCheck: 1 }] ``` one or two entries at most, bounded, with a per-check cap so a full pool cannot buy an unlosable roll. **2. An effect an entry gives, scaled by what the character bought.** "A point of blood for Potence, three automatic successes" is Potence's own rule, and the three comes from the rating on the sheet. That is `mechanics.check` on the catalog entry, and the existing pair `mechanics.cost` plus `mechanics.perCostStep` already expresses the scaling half: one blood buys one step, three blood buys three. So the entry says what a step is worth and the Engine does the arithmetic, exactly as it already does for a spell cast at a higher level. Both end in the same place: the Engine adds successes to the roll it is about to make. Neither can work by being read out of the sheet in prose, because the Game Master model cannot influence a pool roll at all: `isRulesetRollableSkillCheckTag` deliberately discards any dice the model writes, and `rollDicePoolCheck` throws every die itself. The look-up the contributor is imagining has to end in data, not in text the model is trusted to honour. One consequence worth stating in the design: a ruleset whose `resolution` is `dice-sum` has no successes to add, so both forms must be refused at import for that kind rather than silently ignored.
Author
Owner

@kolacheee commented on GitHub (Sep 20, 2026):

One ordering fact for whoever builds this, because it decides the shape.

Both halves are read out of the SAME generated reply, in this order (packages/server/src/routes/generate.routes.ts):

  1. line 8199, resolveSkillCheckTagsInContent(fullResponse, ...) rolls the check
  2. line 8337, applyGameRulesetSheetTurn(...) applies the [sheet: ...] ops, which is where use pays a cost and spend takes a resource

So in one turn the dice are already thrown by the time the spend happens. A design that says "the GM spends a point, therefore the roll gains a success" cannot work as two independent tags in one message: the roll would have to be re-resolved after the fact, and the Engine has no notion of an already-rolled check being changed.

The way out is for the check tag itself to carry what was spent, so one resolution does both:

[skill_check: skill="Brawl" dc="3" spend="willpower:1"]
[skill_check: skill="Brawl" dc="3" use="Potence" spend="blood:1"]

resolveRulesetSkillCheck then reads the named entry's mechanics.check, or the ruleset's own resolution.spend, validates the pool has it, applies the effect to the roll it is about to make, and emits the resource change as part of the same result. All-or-nothing, exactly as planRulesetUse already is: a spend the pool cannot cover means the effect does not apply and nothing is deducted.

That also keeps the one property that matters: the model names what the player said they were spending, and the Engine decides what it costs and what it does. The model still never touches the dice.

Worth noting what already works, so this is not rebuilt: the Game Master can already spend for a narrative activation today, both by [sheet: who="X" op="use" name="Potence"] (the Engine looks the entry up by the name on the sheet or the catalog label, reads its mechanics.cost and pays it, refusing when the pool is short, with pool= to pay from a higher pool of the same group) and by [sheet: who="X" op="spend" pool="Willpower" amount="1"]. Only the effect on the roll is missing. Note that use matches rows that came from a catalog, so a hand-typed row has no declared cost to pay.

<!-- gh-comment-id:5747121429 --> @kolacheee commented on GitHub (Sep 20, 2026): One ordering fact for whoever builds this, because it decides the shape. Both halves are read out of the SAME generated reply, in this order (`packages/server/src/routes/generate.routes.ts`): 1. line 8199, `resolveSkillCheckTagsInContent(fullResponse, ...)` rolls the check 2. line 8337, `applyGameRulesetSheetTurn(...)` applies the `[sheet: ...]` ops, which is where `use` pays a cost and `spend` takes a resource So in one turn the dice are already thrown by the time the spend happens. A design that says "the GM spends a point, therefore the roll gains a success" cannot work as two independent tags in one message: the roll would have to be re-resolved after the fact, and the Engine has no notion of an already-rolled check being changed. The way out is for the check tag itself to carry what was spent, so one resolution does both: ``` [skill_check: skill="Brawl" dc="3" spend="willpower:1"] [skill_check: skill="Brawl" dc="3" use="Potence" spend="blood:1"] ``` `resolveRulesetSkillCheck` then reads the named entry's `mechanics.check`, or the ruleset's own `resolution.spend`, validates the pool has it, applies the effect to the roll it is about to make, and emits the resource change as part of the same result. All-or-nothing, exactly as `planRulesetUse` already is: a spend the pool cannot cover means the effect does not apply and nothing is deducted. That also keeps the one property that matters: the model names what the player said they were spending, and the Engine decides what it costs and what it does. The model still never touches the dice. Worth noting what already works, so this is not rebuilt: the Game Master can already spend for a narrative activation today, both by `[sheet: who="X" op="use" name="Potence"]` (the Engine looks the entry up by the name on the sheet or the catalog label, reads its `mechanics.cost` and pays it, refusing when the pool is short, with `pool=` to pay from a higher pool of the same group) and by `[sheet: who="X" op="spend" pool="Willpower" amount="1"]`. Only the effect on the roll is missing. Note that `use` matches rows that came from a catalog, so a hand-typed row has no declared cost to pay.
Author
Owner

@kolacheee commented on GitHub (Sep 20, 2026):

Reframing this, because "the charm does nothing" overstates it and the real ask is smaller.

A dice-pool ruleset already gives the Game Master three levers, all taught in the prompt and all honoured and clamped by the Engine (renderRulesetSkillCheckLine in packages/server/src/services/game/gm-prompts.ts):

  • bonus="+N" / bonus="-N", clamped to the declared resolution.situationalDice range (the Gravewatch example allows -3 to +3)
  • threshold="N", moved inside resolution.target.min..max (Gravewatch: 5 to 9, default 7)
  • dc="N", how many successes are needed

So "I spend a blood point for Potence to intimidate him" can already end in a real mechanical benefit today: the Game Master writes the use tag, the blood is deducted, and it writes [skill_check: skill="Intimidation" dc="3" bonus="+3"]. Three extra dice, rolled by the Engine.

What is missing is fidelity and repeatability, not effect:

  • Three extra d10s at target 7 average about 1.2 successes. Potence prints three GUARANTEED successes. Those are different things, and the second cannot be said at all today.
  • The +3 is the model's judgement, not the rating on the sheet. The same request next turn may get +2, or a lowered threshold instead, or nothing if the model does not think of the lever. A rule the book states as a number becomes a suggestion.
  • A ruleset that declares no situationalDice leaves the Game Master no dice lever at all, only an easier difficulty.

So this issue is really: let the ruleset state the number, and let the Engine apply it, instead of leaving a printed rule to be approximated within bounds. That is also why the spend and the effect must be decided together at roll time, as in the comment above: the lever and the cost are one decision, and today they are two tags resolved in the wrong order.

<!-- gh-comment-id:5747153838 --> @kolacheee commented on GitHub (Sep 20, 2026): Reframing this, because "the charm does nothing" overstates it and the real ask is smaller. A dice-pool ruleset already gives the Game Master three levers, all taught in the prompt and all honoured and clamped by the Engine (`renderRulesetSkillCheckLine` in `packages/server/src/services/game/gm-prompts.ts`): - `bonus="+N"` / `bonus="-N"`, clamped to the declared `resolution.situationalDice` range (the Gravewatch example allows -3 to +3) - `threshold="N"`, moved inside `resolution.target.min`..`max` (Gravewatch: 5 to 9, default 7) - `dc="N"`, how many successes are needed So "I spend a blood point for Potence to intimidate him" can already end in a real mechanical benefit today: the Game Master writes the `use` tag, the blood is deducted, and it writes `[skill_check: skill="Intimidation" dc="3" bonus="+3"]`. Three extra dice, rolled by the Engine. What is missing is **fidelity and repeatability**, not effect: - Three extra d10s at target 7 average about 1.2 successes. Potence prints three GUARANTEED successes. Those are different things, and the second cannot be said at all today. - The `+3` is the model's judgement, not the rating on the sheet. The same request next turn may get `+2`, or a lowered threshold instead, or nothing if the model does not think of the lever. A rule the book states as a number becomes a suggestion. - A ruleset that declares no `situationalDice` leaves the Game Master no dice lever at all, only an easier difficulty. So this issue is really: let the ruleset state the number, and let the Engine apply it, instead of leaving a printed rule to be approximated within bounds. That is also why the spend and the effect must be decided together at roll time, as in the comment above: the lever and the cost are one decision, and today they are two tags resolved in the wrong order.
Author
Owner

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

Implemented and merged into staging in #6416, with integration fixes and regression coverage.

<!-- gh-comment-id:5750152869 --> @SpicyMarinara commented on GitHub (Sep 20, 2026): Implemented and merged into staging in #6416, with integration fixes and regression coverage.
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#3583
No description provided.