[GH-ISSUE #6361] [Feature]: Game Mode: battles resolved by the ruleset's own math (data-driven combat kinds, design proposal) #3557

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

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

Originally assigned to: @kolacheee on GitHub.

What problem does this solve?

The combat bridge (#6348) lends a ruleset sheet to a battle, but the battle still runs on Marinara's own model: about 60 health, damage as a multiplier on an attack stat, no attack rolls and no saving throws. The sheet's real numbers (8 hit points, Fireball 8d6, a Dexterity save for half, Armor Class 15) only exist outside the fight, and health has to travel as a share of the maximum. People who pick a real system want the fight itself to be that system, with its own numbers on screen.

This is a design proposal that needs the maintainer's answer before anyone builds it, because docs/development/game-combat-rulesets-implementation.md already reserves this ground: a ruleset pin per encounter with a closed id list (engine-legacy | traditional | 5e-2014 | v20), and a 5e-2014 combat adapter written in Engine TypeScript as its slice 5, behind groundwork slices 1 to 4. The sheets plan (§ Relationship to the combat handoff) asked whether that closed registry could be resolution KINDS and combat ADAPTERS instead of ruleset ids, and that question is still open.

Proposed solution

The same principle as checks (dice-sum, dice-pool) and sheets: the Engine knows a small closed set of combat kinds, a ruleset fills one in with data, and a community system gets real combat without code. Nothing is hard-wired to 5e. The first kind, attack-vs-defense:

  • Health is the battle.health pool in the sheet's own numbers. No share conversion: the combatant's hit points are the pool.
  • Turn order: dice plus a value reference (5e: d20 plus the Dexterity modifier).
  • Attack: dice, plus a modifier the ruleset declares from the row's columns and the sheet (the ability named by the row, proficiency when the row says so, the row's bonus), against the target's defense value reference (5e: the ac field). Natural results are declared the way resolution.naturals declares them.
  • Damage: the catalog entry's mechanics.amount dice (or the attack row's damage dice) plus a declared modifier, typed by damageType, with optional resist, vulnerable and immune lists on a stat block.
  • Saves: mechanics.save already names a sheet save and onSuccess: none | half | negates. The difficulty is a value reference (5e: the derived spell save DC), and the defender rolls with the ruleset's own resolution rules.
  • Costs: mechanics.cost spends the real pools through applyRulesetSheetOp DURING the fight, so there is no write-back step: a battle edits live state the way the Game Master's [sheet:] commands do, per turn, with the same rewind behaviour. perCostStep finally means something (paying more for a bigger effect).
  • Later kinds: success-counting pools (needs the dice-pool resolution kind, which is built and waiting for review), roll-under, opposed rolls.

Enemies need stat blocks on the ruleset's scale:

  • A bestiary catalog: a catalog flavour whose entries are stat blocks (health, defense, saves, attacks with bonus, dice and type, a threat tier) instead of sheet rows. The Open5e srd-2014 data the 5e package already builds from (CC-BY-4.0) carries the SRD creatures, so the 5e package can ship them the way it ships spells.
  • The Game Master names creatures and the Engine looks them up. For a creature that is in no bestiary, the model proposes a stat block and the Engine clamps it into a threat tier table the ruleset declares (tier to health range, defense, attack bonus, damage per round), so an invented monster can never be off the scale.

Presentation: Classic and Tactical show the real numbers ("hits AC 15", "8d6 fire, Dexterity save for half: 14"). Tactical converts the ruleset's distance unit to cells with the catalog's units.distance.perCell, which the bridge already does. Reaction entries (Shield, Counterspell) land on the combat director's reaction windows. The interim bridge switches itself off for a ruleset the moment it declares a combat kind.

Suggested slices: C1 the combat block schema and a pure resolver with regressions on 5e and on a second non-d20 example, no UI; C2 the encounter pin, bestiary catalogs, the threat tier clamp and the 5e package's SRD creatures; C3 Classic on real numbers, spending live pools per action; C4 Tactical ranges and areas in the ruleset's unit; C5 conditions, concentration and reactions on the combat director.

What needs an answer before any code:

  1. Is a data-driven combat kind acceptable in place of the handoff's 5e-2014 adapter in TypeScript, or alongside it?
  2. Does the per-encounter pin keep its closed id list, or follow the game's ruleset pin (community ids included)?
  3. Who builds which slices, and in what order relative to the handoff's Traditional ruleset?

Alternatives considered

  • Keep the bridge and convert the numbers for display only. A cosmetic conversion over three combat presentations would show sheet-scale numbers while the math underneath stayed Marinara's, which misleads more than the honest toast the bridge shows today.
  • The handoff's adapter as written, one TypeScript adapter per system. It gives 5e real combat, but every other system, including every community one, waits for an Engine PR of its own, which is the situation rulesets were built to end.
  • Let the model resolve attacks from the sheet block. No added Engine code, but it moves dice and arithmetic back to the model, which is what the ruleset work moved away from.

Additional context

Part of #6314. Builds on #6345 (catalogs and their mechanics block, which already carries kind, range, area, amount, damageType, attackRoll, save, cost, perCostStep, concentration, reaction) and #6348 (the battle block and the bridge). I would build it, slice by slice, once the shape is agreed.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @kolacheee on GitHub (Sep 19, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6361 Originally assigned to: @kolacheee on GitHub. ## What problem does this solve? The combat bridge (#6348) lends a ruleset sheet to a battle, but the battle still runs on Marinara's own model: about 60 health, damage as a multiplier on an attack stat, no attack rolls and no saving throws. The sheet's real numbers (8 hit points, Fireball 8d6, a Dexterity save for half, Armor Class 15) only exist outside the fight, and health has to travel as a share of the maximum. People who pick a real system want the fight itself to be that system, with its own numbers on screen. This is a design proposal that needs the maintainer's answer before anyone builds it, because `docs/development/game-combat-rulesets-implementation.md` already reserves this ground: a ruleset pin per encounter with a closed id list (`engine-legacy | traditional | 5e-2014 | v20`), and a `5e-2014` combat adapter written in Engine TypeScript as its slice 5, behind groundwork slices 1 to 4. The sheets plan (§ Relationship to the combat handoff) asked whether that closed registry could be resolution KINDS and combat ADAPTERS instead of ruleset ids, and that question is still open. ## Proposed solution The same principle as checks (`dice-sum`, `dice-pool`) and sheets: the Engine knows a small closed set of **combat kinds**, a ruleset fills one in with data, and a community system gets real combat without code. Nothing is hard-wired to 5e. The first kind, `attack-vs-defense`: - **Health** is the `battle.health` pool in the sheet's own numbers. No share conversion: the combatant's hit points are the pool. - **Turn order**: dice plus a value reference (5e: d20 plus the Dexterity modifier). - **Attack**: dice, plus a modifier the ruleset declares from the row's columns and the sheet (the ability named by the row, proficiency when the row says so, the row's bonus), against the target's **defense** value reference (5e: the `ac` field). Natural results are declared the way `resolution.naturals` declares them. - **Damage**: the catalog entry's `mechanics.amount` dice (or the attack row's damage dice) plus a declared modifier, typed by `damageType`, with optional resist, vulnerable and immune lists on a stat block. - **Saves**: `mechanics.save` already names a sheet save and `onSuccess: none | half | negates`. The difficulty is a value reference (5e: the derived spell save DC), and the defender rolls with the ruleset's own `resolution` rules. - **Costs**: `mechanics.cost` spends the real pools through `applyRulesetSheetOp` DURING the fight, so there is no write-back step: a battle edits live state the way the Game Master's `[sheet:]` commands do, per turn, with the same rewind behaviour. `perCostStep` finally means something (paying more for a bigger effect). - **Later kinds**: success-counting pools (needs the `dice-pool` resolution kind, which is built and waiting for review), roll-under, opposed rolls. Enemies need stat blocks on the ruleset's scale: - A **bestiary catalog**: a catalog flavour whose entries are stat blocks (health, defense, saves, attacks with bonus, dice and type, a threat tier) instead of sheet rows. The Open5e `srd-2014` data the 5e package already builds from (CC-BY-4.0) carries the SRD creatures, so the 5e package can ship them the way it ships spells. - The Game Master names creatures and the Engine looks them up. For a creature that is in no bestiary, the model proposes a stat block and the Engine clamps it into a **threat tier table the ruleset declares** (tier to health range, defense, attack bonus, damage per round), so an invented monster can never be off the scale. Presentation: Classic and Tactical show the real numbers ("hits AC 15", "8d6 fire, Dexterity save for half: 14"). Tactical converts the ruleset's distance unit to cells with the catalog's `units.distance.perCell`, which the bridge already does. Reaction entries (Shield, Counterspell) land on the combat director's reaction windows. The interim bridge switches itself off for a ruleset the moment it declares a combat kind. Suggested slices: C1 the `combat` block schema and a pure resolver with regressions on 5e and on a second non-d20 example, no UI; C2 the encounter pin, bestiary catalogs, the threat tier clamp and the 5e package's SRD creatures; C3 Classic on real numbers, spending live pools per action; C4 Tactical ranges and areas in the ruleset's unit; C5 conditions, concentration and reactions on the combat director. **What needs an answer before any code:** 1. Is a data-driven combat kind acceptable in place of the handoff's `5e-2014` adapter in TypeScript, or alongside it? 2. Does the per-encounter pin keep its closed id list, or follow the game's ruleset pin (community ids included)? 3. Who builds which slices, and in what order relative to the handoff's Traditional ruleset? ## Alternatives considered - **Keep the bridge and convert the numbers for display only.** A cosmetic conversion over three combat presentations would show sheet-scale numbers while the math underneath stayed Marinara's, which misleads more than the honest toast the bridge shows today. - **The handoff's adapter as written, one TypeScript adapter per system.** It gives 5e real combat, but every other system, including every community one, waits for an Engine PR of its own, which is the situation rulesets were built to end. - **Let the model resolve attacks from the sheet block.** No added Engine code, but it moves dice and arithmetic back to the model, which is what the ruleset work moved away from. ## Additional context Part of #6314. Builds on #6345 (catalogs and their `mechanics` block, which already carries `kind`, `range`, `area`, `amount`, `damageType`, `attackRoll`, `save`, `cost`, `perCostStep`, `concentration`, `reaction`) and #6348 (the `battle` block and the bridge). I would build it, slice by slice, once the shape is agreed. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 06:04:15 +07:00
Author
Owner

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

Decision recorded (kolacheee, 2026-09-19), so the three open questions are settled and work can start:

  1. Data-driven combat kinds replace the TypeScript 5e-2014 adapter reserved by docs/development/game-combat-rulesets-implementation.md. The Engine gets a small closed set of combat kinds; a ruleset fills one in with data. Nothing in the Engine is hard-wired to 5e. The goal for the first kind is the truest 5e combat the Engine can run: initiative, attack rolls against a defense with advantage, disadvantage and critical hits, typed damage with resistances, vulnerabilities and immunities, saving throws against a difficulty, slots and paying more for a bigger effect, concentration, conditions, the action economy (action, bonus action, reaction, movement), opportunity attacks, temporary hit points, death saves, and stat blocks for enemies.
  2. The encounter follows the game's ruleset pin, community rulesets included. There is no closed id list per encounter.
  3. This arc is built here, slice by slice, in the order that makes sense, each slice its own PR. It does not wait for the handoff's Traditional ruleset.

The interim combat bridge (#6348) keeps working for a ruleset until that ruleset declares a combat kind, and then switches itself off for it. A design record comes first, and the plan documents will be updated in the first PR of the arc.

<!-- gh-comment-id:5742952447 --> @kolacheee commented on GitHub (Sep 19, 2026): Decision recorded (kolacheee, 2026-09-19), so the three open questions are settled and work can start: 1. **Data-driven combat kinds replace the TypeScript `5e-2014` adapter** reserved by `docs/development/game-combat-rulesets-implementation.md`. The Engine gets a small closed set of combat kinds; a ruleset fills one in with data. Nothing in the Engine is hard-wired to 5e. The goal for the first kind is the truest 5e combat the Engine can run: initiative, attack rolls against a defense with advantage, disadvantage and critical hits, typed damage with resistances, vulnerabilities and immunities, saving throws against a difficulty, slots and paying more for a bigger effect, concentration, conditions, the action economy (action, bonus action, reaction, movement), opportunity attacks, temporary hit points, death saves, and stat blocks for enemies. 2. **The encounter follows the game's ruleset pin**, community rulesets included. There is no closed id list per encounter. 3. **This arc is built here, slice by slice**, in the order that makes sense, each slice its own PR. It does not wait for the handoff's Traditional ruleset. The interim combat bridge (#6348) keeps working for a ruleset until that ruleset declares a combat kind, and then switches itself off for it. A design record comes first, and the plan documents will be updated in the first PR of the arc.
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#3557
No description provided.