mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #594] [Issue]: Game Mode combat shows broken-image placeholders for enemies, no enemy portrait pipeline wired #275
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#275
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/594
Originally assigned to: @Romuromylus on GitHub.
Summary
In Game Mode combat, enemy combatants render as broken-image icons. Two related defects: (1) the renderer treats
enemy.spriteas a URL when the LLM is told to emit an emoji or short description, and (2) theenemyImagePromptsportrait-prompt array the encounter LLM is asked to produce is never consumed — there is no client code path that turns those into real portraits.Expected behavior
npcsNeedingAvatarspipeline used for in-scene NPCs. Identical-named enemies (e.g. three Goblins) reuse one portrait.Actual behavior
Each enemy renders as a broken
<img>with the enemy name as alt text. Player party avatars on the same row render fine because they come from the character sheet'savatarUrl(a real URL). Two distinct root causes:Defect 1 — renderer mismatch:
packages/server/src/routes/encounter.routes.ts:340instructs the LLM to populateenemy.spritewith"emoji or brief visual description"— never a URL.packages/client/src/components/game/GameSurface.tsx:492(generatedEnemyToCombatant) forwards that string straight intoCombatant.sprite.packages/client/src/components/game/GameCombatUI.tsxrenders<img src={combatant.sprite} />at four sites (lines ~1336, ~1846, ~2345, ~2487). Whenspriteis an emoji or free-text description the<img>404s.packages/client/src/components/chat/EncounterModal.tsx:98already rendersenemy.spritecorrectly as text content (<div className="text-2xl">{enemy.sprite || "👹"}</div>), confirming the original intent is "this is a glyph/emoji label, not a URL".Defect 2 — pipeline never wired:
packages/server/src/routes/encounter.routes.ts:359asks the LLM to also emitvisuals.enemyImagePrompts: [{name, prompt}], but no code reads that array.packages/client/src/components/game/GameSurface.tsx:4830only consumesvisuals.backgroundPromptandvisuals.illustrationPrompt, gated onvisuals.isBossFight && chatMeta.enableSpriteGeneration. Per-enemy portraits are never requested.npcsNeedingAvatars→generatedNpcAvatarspipeline already exists atpackages/server/src/routes/game.routes.ts:6220(caches by name, reuses character-library matches, persists to chat metadata). Combat just doesn't call it.Steps to reproduce
Tideborn Alpha + Tideborn Drone A + Tideborn Drone Bparty).Environment
Logs, screenshots, or video
Screenshot: enemies "Tideborn Alpha", "Tideborn Drone A", "Tideborn Drone B" all show as broken-image icons with the name leaking through as alt text, while "Sasuke Uchiha", "Emilia", "Barbara" show real portraits underneath.
Additional context
Suggested two-part fix (single PR):
resolveSpriteKindhelper inGameCombatUI.tsxthat classifiescombatant.spriteas URL / emoji glyph / unrenderable, then route to<img>/ span / initials accordingly. Apply to all four sprite sites..then(...)handler inGameSurface.tsx, after hydrating combatants and beforesetCombatEnemies, buildnpcsNeedingAvatarsfrom the deduped enemy list (usingvisuals.enemyImagePrompts[i].promptif present, elseenemy.description, else the name), callrunGameAssetGeneration({ chatId, npcsNeedingAvatars }), and overwrite eachcombatant.spritewith the matchinggeneratedNpcAvatars[i].avatarUrl. Block combat start until done; on any failure (timeout, gen disabled, no image connection) fall through silently and the renderer fix above keeps the UI coherent. No retries.Respects the existing
enableSpriteGenerationgate. Names dedupe so identical-named enemies share one portrait. Capped at the server'snpcsNeedingAvatars.max(10)limit.Template check