[PR #8600] [MERGED] Game Mode: the Engine side of the 5e ruleset and its combat AI #8700

Closed
opened 2026-11-07 17:39:02 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: staging ← Head: feat/5e-ruleset-engine


📝 Commits (10+)

  • a632278 AI: step out of a harming aura, and mend itself when nearly down
  • 8a2df86 AI: every blow says why, and a limited use waits for fair odds
  • 37a37b3 AI: a walk counts the burning areas it crosses
  • 6c13b77 Combat: a fight nothing can change any more breaks off
  • 9fa3742 Merge upstream staging: the player picks their own symbol spends (#8233)
  • 3e73b78 AI: keep flasks at poor odds, no hazards beside brawling friends, fairer stall check
  • 390ec6c Merge upstream staging: health on a plain track that fills up (#8235)
  • bd3186d AI: spare orders read a dice pool's most harm as every die a success
  • e34cf98 AI: fair odds for setup-only uses; spare holds back lethal areas
  • 23a9663 Ruleset combat 1.782: attack rows choose the best of several abilities (abilityChoices)

📊 Changes

745 files changed (+395085 additions, -56707 deletions)

View changed files

📝 docs/development/game-combat-ai-design.md (+100 -63)
📝 docs/development/optional-agent-packages.md (+1 -1)
📝 docs/extending/ruleset.schema.json (+213825 -48135)
📝 docs/extending/writing-rulesets.md (+963 -17)
📝 e2e/agent-lorebook-package-compatibility.e2e.ts (+2 -2)
📝 e2e/chat-control-windows.e2e.ts (+1 -1)
📝 e2e/game-combat-director.e2e.ts (+3 -0)
📝 e2e/game-experience-setup.e2e.ts (+22 -23)
📝 e2e/game-hybrid-terrain.e2e.ts (+36 -7)
📝 e2e/game-ruleset-seller-honesty.e2e.ts (+42 -7)
📝 e2e/game-ruleset-sheet-builder.e2e.ts (+14 -9)
📝 e2e/game-ruleset-starting-gear.e2e.ts (+11 -6)
📝 e2e/game-ruleset-wearing.e2e.ts (+5 -2)
📝 e2e/game-terrain-restore.e2e.ts (+2 -2)
📝 e2e/game-widget-style.e2e.ts (+2 -2)
📝 e2e/multiplayer-guest-isolation.e2e.ts (+11 -0)
📝 e2e/phone-toast-headers.e2e.ts (+1 -1)
📝 e2e/ruleset-sheet-migrations.e2e.ts (+1 -1)
📝 e2e/ruleset-wound-sheet.e2e.ts (+10 -2)
📝 packages/client/src/components/agents/AgentCatalogView.tsx (+17 -6)

...and 80 more files

📄 Description

Linked issue

Closes #8599

Why this change

Before: a ruleset could not express most of 5e (SRD 5.1). Its spells, conditions, creatures, items and the rest had no Engine support. Ruleset fights had no combat AI that played them, and encounters were not held to the party's level.

After: the Engine reads everything the 5e package declares. A ruleset fight plays out on the tactical board, with a combat AI on both sides. Encounters are rated by what foes actually do, and the party gets group checks. Rulesets can ship language packs.

What changed

  • Ruleset capabilities 1.392 to 1.812, each one gated by its Capability API minor. Upstream's own 1.379 to 1.391 keep their numbers.
  • Ruleset combat on the tactical board: actions, spells and slots, concentration, reactions, legendary and lair actions, summons, zones, cover, ammunition, items in a fight, and the end-of-fight cards.
  • A combat AI that plays ruleset fights for foes and for AI-controlled party members, and writes a "why" line for each choice.
  • Strict encounter balance. Foes the GM makes up are rated by what they really do, a boss gets no more legendary points than its tier allows, and a creature far beyond the party sends lesser ones of its kind.
  • Group checks: the party rolls, and it succeeds when at least half pass. Each player sees their own roll line, solo and in rooms.
  • Ruleset language packs (1.811): each language is its own catalog artifact, and the store card shows the translated name and description.
  • Package installs and ruleset language switches have their own rate limits.
  • Fixes from the builder, setup, phone-aiming and multiplayer room playtests.

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

Type checks, lint and the locale checks pass on the head. Every ruleset regression passes (689 files). The full regression run passed 1537 of 1586 in the cloud container. Of the 49 failures, 45 are capability-package, avatar and agent regressions that need upstream's new mmd-parser, which isn't installed there. The other four are container limits (no IPv6 loopback, a dev-watcher exit, a deepmerge prototype check, and a lifecycle runtime snapshot check), and they fail the same way on the head before this merge. pnpm check was run as its parts (format, typecheck, lint, locales).

Manual verification notes

  • Ran solo games and two-player rooms with the 5e package on this branch, and fought ruleset fights against the SRD bestiary: attacks and cover, spell saves, concentration, conditions, reactions, upcasting, magic ammunition and the end-of-fight cards.
  • Group checks pass, both when the party fails and when it succeeds, and each player sees their own line.
  • Updating a game to a newer ruleset version keeps the sheets.
  • Multiplayer e2e passes, 44 of 44.

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)

docs/extending/writing-rulesets.md, the ruleset schema and the combat AI design notes changed. The translated docs follow in #8602.

UI evidence (if applicable)

The ruleset combat board, the cast menu and the group check lines were checked in the playtests above.


🔄 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/8600 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@kolacheee](https://github.com/kolacheee) **Base:** `staging` ← **Head:** `feat/5e-ruleset-engine` --- ### 📝 Commits (10+) - [`a632278`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a632278da9b7f1065b945ed540de658bacf4dcf1) AI: step out of a harming aura, and mend itself when nearly down - [`8a2df86`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8a2df8660784cd36a8db9fb3ddc6c26ab5753302) AI: every blow says why, and a limited use waits for fair odds - [`37a37b3`](https://github.com/Pasta-Devs/Marinara-Engine/commit/37a37b3806b69a2a6f0cb8f9cf60572bf0d46476) AI: a walk counts the burning areas it crosses - [`6c13b77`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6c13b77e9576c38b6d1e666b53f9169c9d0c281d) Combat: a fight nothing can change any more breaks off - [`9fa3742`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9fa3742f79efbf0f8fdc74cf4f7b96574b22b359) Merge upstream staging: the player picks their own symbol spends (#8233) - [`3e73b78`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3e73b78330daa292f33ca11d574768d38d8ef197) AI: keep flasks at poor odds, no hazards beside brawling friends, fairer stall check - [`390ec6c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/390ec6ca839a0766474c9eabb4765de5a97835ee) Merge upstream staging: health on a plain track that fills up (#8235) - [`bd3186d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/bd3186d875086894d6eaec85736f9d55973f9d96) AI: spare orders read a dice pool's most harm as every die a success - [`e34cf98`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e34cf9822edccd2a474ad70ffc8c2f1d51e0650a) AI: fair odds for setup-only uses; spare holds back lethal areas - [`23a9663`](https://github.com/Pasta-Devs/Marinara-Engine/commit/23a96633b0ccab1b55e2742792cdbb32a5b24f42) Ruleset combat 1.782: attack rows choose the best of several abilities (abilityChoices) ### 📊 Changes **745 files changed** (+395085 additions, -56707 deletions) <details> <summary>View changed files</summary> 📝 `docs/development/game-combat-ai-design.md` (+100 -63) 📝 `docs/development/optional-agent-packages.md` (+1 -1) 📝 `docs/extending/ruleset.schema.json` (+213825 -48135) 📝 `docs/extending/writing-rulesets.md` (+963 -17) 📝 `e2e/agent-lorebook-package-compatibility.e2e.ts` (+2 -2) 📝 `e2e/chat-control-windows.e2e.ts` (+1 -1) 📝 `e2e/game-combat-director.e2e.ts` (+3 -0) 📝 `e2e/game-experience-setup.e2e.ts` (+22 -23) 📝 `e2e/game-hybrid-terrain.e2e.ts` (+36 -7) 📝 `e2e/game-ruleset-seller-honesty.e2e.ts` (+42 -7) 📝 `e2e/game-ruleset-sheet-builder.e2e.ts` (+14 -9) 📝 `e2e/game-ruleset-starting-gear.e2e.ts` (+11 -6) 📝 `e2e/game-ruleset-wearing.e2e.ts` (+5 -2) 📝 `e2e/game-terrain-restore.e2e.ts` (+2 -2) 📝 `e2e/game-widget-style.e2e.ts` (+2 -2) 📝 `e2e/multiplayer-guest-isolation.e2e.ts` (+11 -0) 📝 `e2e/phone-toast-headers.e2e.ts` (+1 -1) 📝 `e2e/ruleset-sheet-migrations.e2e.ts` (+1 -1) 📝 `e2e/ruleset-wound-sheet.e2e.ts` (+10 -2) 📝 `packages/client/src/components/agents/AgentCatalogView.tsx` (+17 -6) _...and 80 more files_ </details> ### 📄 Description ## Linked issue Closes #8599 ## Why this change Before: a ruleset could not express most of 5e (SRD 5.1). Its spells, conditions, creatures, items and the rest had no Engine support. Ruleset fights had no combat AI that played them, and encounters were not held to the party's level. After: the Engine reads everything the 5e package declares. A ruleset fight plays out on the tactical board, with a combat AI on both sides. Encounters are rated by what foes actually do, and the party gets group checks. Rulesets can ship language packs. ## What changed - Ruleset capabilities 1.392 to 1.812, each one gated by its Capability API minor. Upstream's own 1.379 to 1.391 keep their numbers. - Ruleset combat on the tactical board: actions, spells and slots, concentration, reactions, legendary and lair actions, summons, zones, cover, ammunition, items in a fight, and the end-of-fight cards. - A combat AI that plays ruleset fights for foes and for AI-controlled party members, and writes a "why" line for each choice. - Strict encounter balance. Foes the GM makes up are rated by what they really do, a boss gets no more legendary points than its tier allows, and a creature far beyond the party sends lesser ones of its kind. - Group checks: the party rolls, and it succeeds when at least half pass. Each player sees their own roll line, solo and in rooms. - Ruleset language packs (1.811): each language is its own catalog artifact, and the store card shows the translated name and description. - Package installs and ruleset language switches have their own rate limits. - Fixes from the builder, setup, phone-aiming and multiplayer room playtests. ## Validation - [x] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` Type checks, lint and the locale checks pass on the head. Every ruleset regression passes (689 files). The full regression run passed 1537 of 1586 in the cloud container. Of the 49 failures, 45 are capability-package, avatar and agent regressions that need upstream's new `mmd-parser`, which isn't installed there. The other four are container limits (no IPv6 loopback, a dev-watcher exit, a deepmerge prototype check, and a lifecycle runtime snapshot check), and they fail the same way on the head before this merge. `pnpm check` was run as its parts (format, typecheck, lint, locales). ### Manual verification notes - Ran solo games and two-player rooms with the 5e package on this branch, and fought ruleset fights against the SRD bestiary: attacks and cover, spell saves, concentration, conditions, reactions, upcasting, magic ammunition and the end-of-fight cards. - Group checks pass, both when the party fails and when it succeeds, and each player sees their own line. - Updating a game to a newer ruleset version keeps the sheets. - Multiplayer e2e passes, 44 of 44. ## 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) `docs/extending/writing-rulesets.md`, the ruleset schema and the combat AI design notes changed. The translated docs follow in #8602. ## UI evidence (if applicable) The ruleset combat board, the cast menu and the group check lines were checked in the playtests above. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 17:39:02 +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#8700
No description provided.