[PR #369] [MERGED] fix(game): full-body sprite no longer stuck on first pose in Game Mode #4584

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/369
Author: @cha1latte
Created: 5/3/2026
Status: ✅ Merged
Merged: 5/3/2026
Merged by: @SpicyMarinara

Base: main ← Head: fix/game-mode-full-body-sprite-stuck


📝 Commits (1)

  • 67c75ed fix(game): stop facial-expression agent from clobbering full-body pose

📊 Changes

1 file changed (+6 additions, -2 deletions)

View changed files

📝 packages/client/src/components/chat/SpriteOverlay.tsx (+6 -2)

📄 Description

Summary

In Game Mode, the full-body character sprite was stuck on the first
sprite alphabetically and never updated during scenes — the facial
expression sprite worked correctly. This PR restores per-pose updates
for the full-body overlay.

Why

Reported by a user on Discord (Windows 11, .exe installer, ME 1.5.6):

Since the last update, full-body sprites in Game Mode only display
the first one from the list, and never update during scenes. Facial
expressions work perfectly.

The full-body SpriteOverlay (rendered with fullBodyOnly) shares the
same component as the dialogue avatar overlay. Both subscribed to the
expression agent (which emits facial expressions like "happy" /
"angry") and the keyword fallback (which derives the same from message
text). For the full-body overlay, those values don't match any full_*
sprite — so the resolver fell through to the neutral fallback (full_idle
if present, otherwise spriteList[0]), leaving the sprite stuck on a
single image regardless of the pose the dialogue/combat resolver
intended.

Fix

When fullBodyOnly={true}, skip the agent-expression effect and the
keyword fallback effect. The explicit pose passed via spriteExpressions
(set by GameSurface from resolveDialogueFullBodyPose /
resolveCombatFullBodyPose) becomes the sole source of truth for the
full-body overlay's pose state. The dialogue avatar overlay path is
untouched.

Files touched: packages/client/src/components/chat/SpriteOverlay.tsx
(6 lines added, 2 modified — two early-returns and two effect dependency
arrays updated).

Test plan

  • Open a Game Mode chat with a character that has multiple full_*.png sprites (e.g. full_idle, full_attack, full_battle_stance, full_casting, full_defend, full_hurt, full_victory).
  • Confirm during dialogue scenes the full-body sprite shows the idle pose (or battle_stance if idle is missing) — not stuck on the alphabetically-first sprite.
  • Trigger combat with the character as a player party member. Confirm full-body sprite rotates between attack, defend, casting, hurt, victory, and battle_stance as combat phases advance — not stuck on a single image.
  • Confirm the dialogue avatar (small portrait next to the dialogue text) still updates with facial expressions per the expression agent — this overlay should be unaffected.
  • Light + dark mode look correct in the Game Mode dialogue/combat surface.
  • Mobile viewport (~400px wide) — sprite still renders correctly.

Notes

No related issue was opened for this bug AFAIK; happy to file one if reviewers prefer that workflow before merge.

I tested the fix with Prof Mari as my sparring partner and she bled tomato sauce.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue where facial expressions were incorrectly overridden when displaying full-body sprites. The overlay now properly respects full-body-only mode and prevents unwanted expression updates.

🔄 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/369 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 5/3/2026 **Status:** ✅ Merged **Merged:** 5/3/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `main` ← **Head:** `fix/game-mode-full-body-sprite-stuck` --- ### 📝 Commits (1) - [`67c75ed`](https://github.com/Pasta-Devs/Marinara-Engine/commit/67c75ed697345254f2a3e4f3cd741bedbae7753b) fix(game): stop facial-expression agent from clobbering full-body pose ### 📊 Changes **1 file changed** (+6 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/chat/SpriteOverlay.tsx` (+6 -2) </details> ### 📄 Description ## Summary In Game Mode, the full-body character sprite was stuck on the first sprite alphabetically and never updated during scenes — the facial expression sprite worked correctly. This PR restores per-pose updates for the full-body overlay. ## Why Reported by a [user on Discord](https://discord.com/channels/1417099416812392641/1499560895154618368) (Windows 11, .exe installer, ME 1.5.6): > Since the last update, full-body sprites in Game Mode only display > the first one from the list, and never update during scenes. Facial > expressions work perfectly. The full-body `SpriteOverlay` (rendered with `fullBodyOnly`) shares the same component as the dialogue avatar overlay. Both subscribed to the expression agent (which emits facial expressions like `"happy"` / `"angry"`) and the keyword fallback (which derives the same from message text). For the full-body overlay, those values don't match any `full_*` sprite — so the resolver fell through to the neutral fallback (`full_idle` if present, otherwise `spriteList[0]`), leaving the sprite stuck on a single image regardless of the pose the dialogue/combat resolver intended. ## Fix When `fullBodyOnly={true}`, skip the agent-expression effect and the keyword fallback effect. The explicit pose passed via `spriteExpressions` (set by `GameSurface` from `resolveDialogueFullBodyPose` / `resolveCombatFullBodyPose`) becomes the sole source of truth for the full-body overlay's pose state. The dialogue avatar overlay path is untouched. Files touched: `packages/client/src/components/chat/SpriteOverlay.tsx` (6 lines added, 2 modified — two early-returns and two effect dependency arrays updated). ## Test plan - [x] Open a Game Mode chat with a character that has multiple `full_*.png` sprites (e.g. `full_idle`, `full_attack`, `full_battle_stance`, `full_casting`, `full_defend`, `full_hurt`, `full_victory`). - [x] Confirm during dialogue scenes the full-body sprite shows the `idle` pose (or `battle_stance` if `idle` is missing) — not stuck on the alphabetically-first sprite. - [x] Trigger combat with the character as a player party member. Confirm full-body sprite rotates between `attack`, `defend`, `casting`, `hurt`, `victory`, and `battle_stance` as combat phases advance — not stuck on a single image. - [x] Confirm the dialogue avatar (small portrait next to the dialogue text) still updates with facial expressions per the expression agent — this overlay should be unaffected. - [x] Light + dark mode look correct in the Game Mode dialogue/combat surface. - [x] Mobile viewport (~400px wide) — sprite still renders correctly. ## Notes No related issue was opened for this bug AFAIK; happy to file one if reviewers prefer that workflow before merge. I tested the fix with Prof Mari as my sparring partner and she bled tomato sauce. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Fixed an issue where facial expressions were incorrectly overridden when displaying full-body sprites. The overlay now properly respects full-body-only mode and prevents unwanted expression updates. <!-- 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-22 04:08:55 +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#4584
No description provided.