[PR #7629] [MERGED] feat(rulesets): add dice, guided builders and party sheets #7847

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7629
Author: @kolacheee
Created: 10/14/2026
Status: ✅ Merged
Merged: 10/14/2026
Merged by: @kolacheee

Base: staging ← Head: feat/ruleset-engine-features


📝 Commits (10+)

  • 66586f9 Rulesets: dice, guided builders and party sheets for more tabletop systems (Capability API 1.135-1.164, 1.205-1.220, 1.340)
  • 7655014 fix(rulesets): theme colour for the sheet's draft notice, localized symbol check results
  • cb01925 fix(rulesets): party sheet save hook, item access in the GM prompt, contextual dice and test hygiene
  • 35e7239 Merge remote-tracking branch 'upstream/staging' into up/pr14
  • 39cb0a5 fix(rulesets): load the party sheet's save hook without the game stores
  • b3c6cfa Merge remote-tracking branch 'upstream/staging' into up/pr14
  • eb192fc fix(rulesets): catalog files reach the install gates, pre-rolled dice chain, one daze event
  • 39ce007 Merge remote-tracking branch 'upstream/staging' into up/pr14
  • 09b8e87 fix(rulesets): apply= checks are the Engine's, scaled forecasts keep the damage minimum
  • 1a07655 test(rulesets): keep the earlier and new limits asserted explicitly

📊 Changes

124 files changed (+65710 additions, -6346 deletions)

View changed files

📝 docs/CONFIGURATION.md (+1 -1)
📝 docs/development/game-rulesets-and-sheets-implementation.md (+3 -3)
📝 docs/development/optional-agent-packages.md (+4 -2)
📝 docs/extending/ruleset.schema.json (+41365 -5726)
📝 docs/extending/writing-rulesets.md (+1089 -16)
➕ e2e/game-ruleset-party-sheet.e2e.ts (+91 -0)
📝 e2e/game-ruleset-sheet-builder.e2e.ts (+441 -0)
📝 packages/client/src/components/dice/AnimatedDiceRoll.tsx (+50 -6)
📝 packages/client/src/components/dice/AnimatedSkillCheckResult.tsx (+128 -38)
📝 packages/client/src/components/dice/DiceGlyph.tsx (+6 -2)
➕ packages/client/src/components/game/GameProgressClocks.tsx (+44 -0)
📝 packages/client/src/components/game/GameRulesetSheet.tsx (+97 -3)
📝 packages/client/src/components/game/GameSurface.tsx (+46 -1)
📝 packages/client/src/components/game/StartingGearPicker.tsx (+18 -2)
📝 packages/client/src/components/game/game-narration-format.ts (+2 -2)
📝 packages/client/src/components/rulesets/RulesetSheetBuilder.tsx (+991 -43)
📝 packages/client/src/components/rulesets/RulesetSheetEditor.tsx (+102 -28)
📝 packages/client/src/hooks/use-chats.ts (+2 -0)
📝 packages/client/src/hooks/use-game.ts (+2 -27)
➕ packages/client/src/hooks/use-party-sheet.ts (+46 -0)

...and 80 more files

📄 Description

Linked issue

Part of #7625

This follows #7613 (merged). This branch is up to date with staging and holds the ruleset engine features that let more tabletop systems run as rulesets: Capability API 1.135-1.164, 1.205-1.220 and 1.340, so the supported version is 1.340.

Why this change

  • Many tabletop systems roll differently from d20 checks: dice pools with outcome bands, keep-the-highest dice, rolls against a number on the sheet and narrative symbol dice could not be written in a ruleset, so the Game Master had to adjudicate them as text.
  • Character creation in systems with point-buy dots, priced purchases, creation rolls, starting coins or a shared party sheet could not be expressed in the guided builder.
  • Large rulesets ran into the 256 KB ruleset and 1 MB catalog file limits.

What changed

  • Checks: outcome bands on a check (Capability API 1.135), valued faces, open-ended rolls and unmodified faces (1.136), a pool target from the sheet with stances and exact faces (1.137), keep-the-highest dice (1.138), roll-against checks (1.139), checks that roll their own way (1.140) and narrative symbol dice (1.141).
  • The Game Master: advances the permanent sheet (1.142), makes and ticks progress clocks shown above the game (1.143), and reads a full GM rules reference of up to 16,000 characters that is cut first when the context is full (1.145).
  • Party: a party sheet shared by the whole party (1.144) and shared party creation (1.163).
  • Combat: minimum damage, dazing hits and damage kind by target (1.146-1.148), and light-only outcomes for dark dice with mixed boost and setback (1.149-1.150).
  • Guided builder: counted, limited and conditional choices (1.151), staged dot allocation (1.152), shared point pools and priced purchases (1.153), named rows (1.154), builder legality (1.155), worked-out scores and per-roll applied effects (1.156), starting coins (1.157), starting values and pools (1.158), rows priced from a shared pool (1.159), creation profiles (1.160), list rows that are checks (1.161), ordered creation rolls (1.162), and two-way, owned and traded purchases (1.164).
  • Sheet rows and effects: list sums that count rows or match a cell (1.205), row prices per row (1.206), unpriced spend offers (1.207), up to 240 sheet fields (1.208), creation rolls written to an ability (1.209), worked-out list columns (1.210), partial score increases (1.211), row checks in a stance (1.212), rows applied by an ability (1.213), roll effects that switch off cancelling (1.214), picks that open items without carrying them (1.215), dots funded at creation (1.216), best-rating roll effects (1.217), roll costs that mark a track (1.218), advancement lists up to 64 fields (1.219), and a borrowed entry's granted tiers read in the borrower's tiers (1.220).
  • Sizes (1.340): a ruleset may be up to 512 KB and a catalog file up to 2 MB. A package over the earlier limits must declare 1.340, and the editor's check says so.
  • The ruleset sheet code gets its own client chunk so the game tag parser's chunk stays under the 500 KB budget.
  • docs/extending/writing-rulesets.md, docs/development/game-rulesets-and-sheets-implementation.md, docs/development/optional-agent-packages.md and docs/CONFIGURATION.md cover it, and docs/extending/ruleset.schema.json is regenerated.

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
  • Regression lanes run locally on this head: ruleset, capability and package lanes pass.

Manual verification notes

  • Each feature has its own regression under scripts/regressions/game-ruleset-*.regression.ts, which also checks the install gate at its version.
  • e2e/game-ruleset-party-sheet.e2e.ts (light and dark) and all four cases in e2e/game-ruleset-sheet-builder.e2e.ts pass locally on desktop Chromium.
  • Not checked by a person yet: these features in a live game with a full ruleset.

Changed test expectations

No maintainer asked for these; each follows a change in this PR, and the earlier boundary stays asserted:

  • Supported Capability API 1.339 to 1.340 (capability-package-lifecycle): this PR's versions run to 1.340. 1.339 stays named as supported, and the first unknown minor moves from 1.340 to 1.341.
  • game-ruleset-packages asserts the new limits as literal sizes (512 KB per ruleset, 2 MB per catalog, both 1.340) and that the earlier 256 KB and 1 MB limits are still defined; game-ruleset-caps asserts that a package below 1.340 is still refused one byte over the earlier limits.
  • gm-skill-check-resolution's source checks follow the route passing the regenerated message to the modifier context and reading the live sheet from the shared turn-start snapshot.
  • game-ruleset-strict-starting-gear's icon stub adds the remove icon the picker now uses.
  • game-ruleset-combat-delay and ruleset-combat-screen-client only gain cases (a dazed combatant's skipped turn).
  • e2e/game-ruleset-sheet-builder.e2e.ts only gains cases; its reopen steps wait for the builder to close before clicking the sheet's Edit sheet button.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) 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)
  • The translations are tracked on #7512.

UI evidence (if applicable)

No screenshots attached. The builder, party sheet, clocks and dice result changes are covered by the regressions and e2e specs above.

Summary by CodeRabbit

  • New Features
    • Expanded ruleset checks with additional dice-resolution options, outcome bands, contextual effects, and richer roll results.
    • Added guided character creation, shared party sheets, permanent character advancement, and progress clocks.
    • Added combat support for minimum damage, damage-kind remapping, and dazing.
    • Starting gear can calculate or roll coin amounts using a character’s sheet.
    • Added support for borrowing catalogs from other rulesets and including ruleset-specific GM references.
  • Improvements
    • Increased ruleset file limits to 512 KB and catalog asset limits to 2 MB. Packages exceeding previous limits must meet the updated Capability API requirement.
    • Improved sheet building and editing with clearer guidance, calculated values, flexible allocation and spending, and notices for outdated party-sheet changes.

🔄 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/7629 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 10/14/2026 **Status:** ✅ Merged **Merged:** 10/14/2026 **Merged by:** [@kolacheee](https://github.com/kolacheee) **Base:** `staging` ← **Head:** `feat/ruleset-engine-features` --- ### 📝 Commits (10+) - [`66586f9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/66586f96af99ab6acd902c5950a0c24f045695eb) Rulesets: dice, guided builders and party sheets for more tabletop systems (Capability API 1.135-1.164, 1.205-1.220, 1.340) - [`7655014`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7655014058d730618d0dec6b9d37d55cd992f6b8) fix(rulesets): theme colour for the sheet's draft notice, localized symbol check results - [`cb01925`](https://github.com/Pasta-Devs/Marinara-Engine/commit/cb0192550859532aeee726350351e111c7a9c4cc) fix(rulesets): party sheet save hook, item access in the GM prompt, contextual dice and test hygiene - [`35e7239`](https://github.com/Pasta-Devs/Marinara-Engine/commit/35e72399d825eb362152a7a417a152b7742df945) Merge remote-tracking branch 'upstream/staging' into up/pr14 - [`39cb0a5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/39cb0a5cddb4b78298fe41ee2d6c219e958e2c94) fix(rulesets): load the party sheet's save hook without the game stores - [`b3c6cfa`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b3c6cfa67a7ef7234f242352b706ad104ca72aca) Merge remote-tracking branch 'upstream/staging' into up/pr14 - [`eb192fc`](https://github.com/Pasta-Devs/Marinara-Engine/commit/eb192fc10b64fdb9c3574b3118f3965008d693af) fix(rulesets): catalog files reach the install gates, pre-rolled dice chain, one daze event - [`39ce007`](https://github.com/Pasta-Devs/Marinara-Engine/commit/39ce007b63d34f2e1f3c2204b47aba2d54e4b818) Merge remote-tracking branch 'upstream/staging' into up/pr14 - [`09b8e87`](https://github.com/Pasta-Devs/Marinara-Engine/commit/09b8e873809fcaac73ab711b7df9bfa523606974) fix(rulesets): apply= checks are the Engine's, scaled forecasts keep the damage minimum - [`1a07655`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1a076557f1d931461e2e20efd8027282234158a6) test(rulesets): keep the earlier and new limits asserted explicitly ### 📊 Changes **124 files changed** (+65710 additions, -6346 deletions) <details> <summary>View changed files</summary> 📝 `docs/CONFIGURATION.md` (+1 -1) 📝 `docs/development/game-rulesets-and-sheets-implementation.md` (+3 -3) 📝 `docs/development/optional-agent-packages.md` (+4 -2) 📝 `docs/extending/ruleset.schema.json` (+41365 -5726) 📝 `docs/extending/writing-rulesets.md` (+1089 -16) ➕ `e2e/game-ruleset-party-sheet.e2e.ts` (+91 -0) 📝 `e2e/game-ruleset-sheet-builder.e2e.ts` (+441 -0) 📝 `packages/client/src/components/dice/AnimatedDiceRoll.tsx` (+50 -6) 📝 `packages/client/src/components/dice/AnimatedSkillCheckResult.tsx` (+128 -38) 📝 `packages/client/src/components/dice/DiceGlyph.tsx` (+6 -2) ➕ `packages/client/src/components/game/GameProgressClocks.tsx` (+44 -0) 📝 `packages/client/src/components/game/GameRulesetSheet.tsx` (+97 -3) 📝 `packages/client/src/components/game/GameSurface.tsx` (+46 -1) 📝 `packages/client/src/components/game/StartingGearPicker.tsx` (+18 -2) 📝 `packages/client/src/components/game/game-narration-format.ts` (+2 -2) 📝 `packages/client/src/components/rulesets/RulesetSheetBuilder.tsx` (+991 -43) 📝 `packages/client/src/components/rulesets/RulesetSheetEditor.tsx` (+102 -28) 📝 `packages/client/src/hooks/use-chats.ts` (+2 -0) 📝 `packages/client/src/hooks/use-game.ts` (+2 -27) ➕ `packages/client/src/hooks/use-party-sheet.ts` (+46 -0) _...and 80 more files_ </details> ### 📄 Description ## Linked issue Part of #7625 This follows #7613 (merged). This branch is up to date with staging and holds the ruleset engine features that let more tabletop systems run as rulesets: Capability API 1.135-1.164, 1.205-1.220 and 1.340, so the supported version is 1.340. ## Why this change - Many tabletop systems roll differently from d20 checks: dice pools with outcome bands, keep-the-highest dice, rolls against a number on the sheet and narrative symbol dice could not be written in a ruleset, so the Game Master had to adjudicate them as text. - Character creation in systems with point-buy dots, priced purchases, creation rolls, starting coins or a shared party sheet could not be expressed in the guided builder. - Large rulesets ran into the 256 KB ruleset and 1 MB catalog file limits. ## What changed - **Checks:** outcome bands on a check (Capability API 1.135), valued faces, open-ended rolls and unmodified faces (1.136), a pool target from the sheet with stances and exact faces (1.137), keep-the-highest dice (1.138), roll-against checks (1.139), checks that roll their own way (1.140) and narrative symbol dice (1.141). - **The Game Master:** advances the permanent sheet (1.142), makes and ticks progress clocks shown above the game (1.143), and reads a full GM rules reference of up to 16,000 characters that is cut first when the context is full (1.145). - **Party:** a party sheet shared by the whole party (1.144) and shared party creation (1.163). - **Combat:** minimum damage, dazing hits and damage kind by target (1.146-1.148), and light-only outcomes for dark dice with mixed boost and setback (1.149-1.150). - **Guided builder:** counted, limited and conditional choices (1.151), staged dot allocation (1.152), shared point pools and priced purchases (1.153), named rows (1.154), builder legality (1.155), worked-out scores and per-roll applied effects (1.156), starting coins (1.157), starting values and pools (1.158), rows priced from a shared pool (1.159), creation profiles (1.160), list rows that are checks (1.161), ordered creation rolls (1.162), and two-way, owned and traded purchases (1.164). - **Sheet rows and effects:** list sums that count rows or match a cell (1.205), row prices per row (1.206), unpriced spend offers (1.207), up to 240 sheet fields (1.208), creation rolls written to an ability (1.209), worked-out list columns (1.210), partial score increases (1.211), row checks in a stance (1.212), rows applied by an ability (1.213), roll effects that switch off cancelling (1.214), picks that open items without carrying them (1.215), dots funded at creation (1.216), best-rating roll effects (1.217), roll costs that mark a track (1.218), advancement lists up to 64 fields (1.219), and a borrowed entry's granted tiers read in the borrower's tiers (1.220). - **Sizes (1.340):** a ruleset may be up to 512 KB and a catalog file up to 2 MB. A package over the earlier limits must declare 1.340, and the editor's check says so. - The ruleset sheet code gets its own client chunk so the game tag parser's chunk stays under the 500 KB budget. - `docs/extending/writing-rulesets.md`, `docs/development/game-rulesets-and-sheets-implementation.md`, `docs/development/optional-agent-packages.md` and `docs/CONFIGURATION.md` cover it, and `docs/extending/ruleset.schema.json` is regenerated. ## Validation - [x] `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` - Regression lanes run locally on this head: ruleset, capability and package lanes pass. ### Manual verification notes - Each feature has its own regression under `scripts/regressions/game-ruleset-*.regression.ts`, which also checks the install gate at its version. - `e2e/game-ruleset-party-sheet.e2e.ts` (light and dark) and all four cases in `e2e/game-ruleset-sheet-builder.e2e.ts` pass locally on desktop Chromium. - Not checked by a person yet: these features in a live game with a full ruleset. ### Changed test expectations No maintainer asked for these; each follows a change in this PR, and the earlier boundary stays asserted: - Supported Capability API 1.339 to 1.340 (`capability-package-lifecycle`): this PR's versions run to 1.340. 1.339 stays named as supported, and the first unknown minor moves from 1.340 to 1.341. - `game-ruleset-packages` asserts the new limits as literal sizes (512 KB per ruleset, 2 MB per catalog, both 1.340) and that the earlier 256 KB and 1 MB limits are still defined; `game-ruleset-caps` asserts that a package below 1.340 is still refused one byte over the earlier limits. - `gm-skill-check-resolution`'s source checks follow the route passing the regenerated message to the modifier context and reading the live sheet from the shared turn-start snapshot. - `game-ruleset-strict-starting-gear`'s icon stub adds the remove icon the picker now uses. - `game-ruleset-combat-delay` and `ruleset-combat-screen-client` only gain cases (a dazed combatant's skipped turn). - `e2e/game-ruleset-sheet-builder.e2e.ts` only gains cases; its reopen steps wait for the builder to close before clicking the sheet's Edit sheet button. ## Docs and release impact - [ ] No docs changes needed - [x] Updated docs (README / CONTRIBUTING / android/README) as needed - [x] 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) - The translations are tracked on #7512. ## UI evidence (if applicable) No screenshots attached. The builder, party sheet, clocks and dice result changes are covered by the regressions and e2e specs above. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Expanded ruleset checks with additional dice-resolution options, outcome bands, contextual effects, and richer roll results. * Added guided character creation, shared party sheets, permanent character advancement, and progress clocks. * Added combat support for minimum damage, damage-kind remapping, and dazing. * Starting gear can calculate or roll coin amounts using a character’s sheet. * Added support for borrowing catalogs from other rulesets and including ruleset-specific GM references. * **Improvements** * Increased ruleset file limits to 512 KB and catalog asset limits to 2 MB. Packages exceeding previous limits must meet the updated Capability API requirement. * Improved sheet building and editing with clearer guidance, calculated values, flexible allocation and spending, and notices for outdated party-sheet changes. <!-- 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-24 04:08:06 +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#7847
No description provided.