[GH-ISSUE #551] [Issue]: Game Mode combat ignores persona/character HP, invents new values #251

Closed
opened 2026-10-20 17:26:48 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Romuromylus on GitHub (May 8, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/551

Summary

When entering combat in Game Mode, the persona's and party characters' configured HP is ignored. The AI generates fresh HP values for everyone (persona + allies + enemies), so a persona configured with e.g. Max HP 1000 can enter combat at 100 HP or some unrelated value.

Expected behavior

When the GM transitions to combat ([state: combat]), party combatants should enter the fight with their configured Max HP from the persona's stat bars / RPG stats and from each ally character card's extensions.rpgStats. Combat should start at full health.

Actual behavior

Party HP and Max HP are both replaced with values made up by the AI. Even with frontier models (so it's not model hallucination — it's a code bug). Affected combatants:

  • Player persona (Max HP and current HP both wrong)
  • Companions / NPCs in the party (same)
  • Enemies (acceptable that these are AI-generated, but the player side shouldn't be)

Steps to reproduce

  1. Configure a persona with personaStats.bars containing an HP bar (or with personaStats.rpgStats.enabled = true and hp.max = N)
  2. Optionally add an ally character with extensions.rpgStats.enabled = true and hp.max = M
  3. Start a Game Mode chat with that persona + ally
  4. Play until the GM emits [state: combat] to enter combat
  5. Open the combat UI — the player and ally have HP/Max HP that don't match the configured values

Environment

  • Marinara Engine version: 1.5.8
  • Install type: source (Docker)
  • OS + version: Linux (EasyPanel container)
  • Browser or app shell: Chromium-based browser

Logs, screenshots, or video

The combat-init AI call was returning "hp": X, "maxHp": X for the player and party with values not matching the configured persona/character HP.

Additional context

Root cause is in packages/server/src/routes/encounter.routes.ts:

  • buildPersonaContext builds the persona block sent to the combat-init AI but skips both personaStats.bars and personaStats.rpgStats, so the AI never sees the user-defined HP.
  • buildCharacterContext likewise skips data.extensions.rpgStats for ally character cards.
  • The init prompt in buildInitPrompt instructs the AI to fill "hp": X, "maxHp": X and only nudges with a vague "Use the player's stats/inventory from the context" — and even tells it to "Ensure HP values are realistic for the setting", which encourages invention.

Without HP context to copy from, the AI is forced to invent values for every combatant on every encounter.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @Romuromylus on GitHub (May 8, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/551 ## Summary When entering combat in Game Mode, the persona's and party characters' configured HP is ignored. The AI generates fresh HP values for everyone (persona + allies + enemies), so a persona configured with e.g. Max HP 1000 can enter combat at 100 HP or some unrelated value. ## Expected behavior When the GM transitions to combat (`[state: combat]`), party combatants should enter the fight with their configured Max HP from the persona's stat bars / RPG stats and from each ally character card's `extensions.rpgStats`. Combat should start at full health. ## Actual behavior Party HP and Max HP are both replaced with values made up by the AI. Even with frontier models (so it's not model hallucination — it's a code bug). Affected combatants: - Player persona (Max HP and current HP both wrong) - Companions / NPCs in the party (same) - Enemies (acceptable that these are AI-generated, but the player side shouldn't be) ## Steps to reproduce 1. Configure a persona with `personaStats.bars` containing an HP bar (or with `personaStats.rpgStats.enabled = true` and `hp.max = N`) 2. Optionally add an ally character with `extensions.rpgStats.enabled = true` and `hp.max = M` 3. Start a Game Mode chat with that persona + ally 4. Play until the GM emits `[state: combat]` to enter combat 5. Open the combat UI — the player and ally have HP/Max HP that don't match the configured values ## Environment - Marinara Engine version: 1.5.8 - Install type: source (Docker) - OS + version: Linux (EasyPanel container) - Browser or app shell: Chromium-based browser ## Logs, screenshots, or video The combat-init AI call was returning `"hp": X, "maxHp": X` for the player and party with values not matching the configured persona/character HP. ## Additional context Root cause is in `packages/server/src/routes/encounter.routes.ts`: - `buildPersonaContext` builds the persona block sent to the combat-init AI but skips both `personaStats.bars` and `personaStats.rpgStats`, so the AI never sees the user-defined HP. - `buildCharacterContext` likewise skips `data.extensions.rpgStats` for ally character cards. - The init prompt in `buildInitPrompt` instructs the AI to fill `"hp": X, "maxHp": X` and only nudges with a vague "Use the player's stats/inventory from the context" — and even tells it to "Ensure HP values are realistic for the setting", which encourages invention. Without HP context to copy from, the AI is forced to invent values for every combatant on every encounter. ## Template check - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-20 17:26:48 +07:00
  • closed this issue
  • added the
    bug
    label
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#251
No description provided.