mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #592] [Issue]: Game Mode skill checks and Combat init ignore character sheet attributes #274
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#274
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 @Romuromylus on GitHub (May 9, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/592
Originally assigned to: @Romuromylus on GitHub.
Summary
The character sheet's RPG attributes (
STR/DEX/CON/INT/WIS/CHA) are mechanically inert: in Game Mode the AI hallucinates skill-check modifiers instead of applying the sheet's values, and in Combat Mode the encounter-init LLM never even sees the player's character-card attributes when generating combat stat blocks.This came out of investigating #556 (which is about the Roleplay-mode side panel). Filing this separately because the Game Mode and Combat Mode paths are mechanically broken, not just display issues.
Expected behavior
STR 17 (+3)), using the samefloor((score - 10) / 2)formula the server already implements.STR 20should apply a deterministic+5attribute modifier.attack/defense/speed/hpto match the player's intended build (high STR → high attack, etc.).Actual behavior
[skill_check: skill="..." dc="..." rolls="..." modifier="..." total="..." result="..."]with all numbers filled in by the model. Themodifiervalue bears no relation to the player's sheet attributes.routes/game.routes.ts:4714is reachable but rarely runs, and even when it does it reads fromplayerStats.attributeswhich isnullfor every chat — modifier always resolves to0.routes/encounter.routes.ts:208-228would inject the player's attributes as context, but it reads from the sameplayerStats.attributesfield which is null. The LLM generatesattack/defense/hpwithout ever seeing the player's STR/DEX/CON.Steps to reproduce
Game Mode skill checks
Edit Sheet).STRto20(or1for the opposite extreme). Save.[skill_check: ...]tag in the message.modifier=field to the expected+5(or-5).Combat Mode init
attack/defense/hp. They reflect the LLM's defaults rather than the character sheet.Environment
Logs, screenshots, or video
Four converging code paths produce the bug:
PlayerStats.attributesis always null. Every initializer inroutes/generate.routes.ts(e.g. line 6925) androutes/generate/retry-agents-route.ts(line 815) defaultsattributes: null. Nothing in the create/setup/start flow seeds it from the character card'srpgStats.attributes. Soroutes/game.routes.ts:4726always falls into the?? 10branch androutes/encounter.routes.ts:213-228skips the attribute line entirely.services/game/gm-prompts.ts:691,695instructs the GM to emitrolls,modifier,total,resultdirectly. The client atcomponents/game/GameSurface.tsx:3098-3116only falls back to the deterministic server route when those fields are absent — which the prompt makes rare.gameCard.rpgStats.attributes: Array<{name, value}>with free-form names. Engine wantsRPGAttributes: { str, dex, con, int, wis, cha }. No mapper exists between them.routes/encounter.routes.ts:208readsplayerStats.attributesonly — same null source. There is no fallback to the player'sgameCharacterCards[0].rpgStats.attributes, even though the encounter route already has access to chat metadata. The LLM then invents combat stats with no character-build hint.Additional context
A fix should:
GameCharacterSheet.tsx(mirrors the server formula).Array<{name, value}>to strictRPGAttributes, and fall back to the player's character-cardrpgStats.attributesin the/skill-checkroute whenplayerStats.attributesis null. No DB migration needed.[skill_check: skill="..." dc="..."]so the deterministic server path runs. Extend/skill-checkto accept apreRolledD20so a player-submitted[dice:1d20]still gets the modifier applied.routes/encounter.routes.ts, apply the same lazy fallback when building game-state context: whenplayerStats.attributesis null, map and emit the player's character-card attributes so combat init sees them. Add a brief prompt note that the LLM should scaleattack/defense/hpto reflect the player's RPG attributes.Out of scope: HP / AC / saves modifier breakdowns from #556 (no data model for those today); Roleplay-mode changes; persisting
playerStats.attributesserver-side (the lazy fallback is enough for both routes).Template check
@Romuromylus commented on GitHub (May 9, 2026):
Will work on this