mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #8653] [MERGED] feat(sprites): faceted sprite names let the Expression Engine choose by outfit and condition #8726
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#8726
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8653
Author: @SpicyMarinara
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @SpicyMarinara
Base:
staging← Head:feat/faceted-sprite-selection-8637📝 Commits (4)
11491bafeat(sprites): faceted sprite names let the Expression Engine choose by outfit and condition (#8637)ec013fbfix(sprites): a faceted name never falls back to a talk or blink frame (#8637)dad12f4fix(sprites): the client never shows a talk frame for an outfit with no face of its own (#8637)1c2998bfix(sprites): a faceted name tries its own group before a loose substring match (#8637)📊 Changes
9 files changed (+341 additions, -22 deletions)
View changed files
📝
docs/characters/sprites.md(+2 -0)📝
packages/client/src/components/chat/sprite-display-expression.ts(+4 -0)📝
packages/client/src/features/avatars/renderers/pngtuber/pngtuber-layers.ts(+4 -4)📝
packages/client/src/lib/sprite-expression-match.ts(+32 -4)📝
packages/server/src/routes/generate/expression-agent-utils.ts(+31 -4)📝
packages/server/src/services/avatars/generation/pngtuber-variants.ts(+4 -4)📝
packages/server/src/services/game/sprite.service.ts(+18 -6)📝
packages/shared/src/utils/sprite-labels.ts(+52 -0)➕
scripts/regressions/sprite-expression-facets.regression.ts(+194 -0)📄 Description
Linked issue
Closes #8637
Why this change
happy_pajamas,happy_formalwearandangry_formalwear_soaked_01in a library, the Expression Engine only ever sawhappyandangry. The outfit or condition was left to a random roll, so a character in pajamas could appear in formalwear. The issue asks for the agent to choose by outfit and condition from what's in the scene, using names the user already writes.What changed
buildSpriteExpressionChoicesstill lists each group key. For a group with more than one sprite, it now also lists each sprite's faceted name without its variant number:angry_formalwear_soaked_01addsangry_formalwear_soaked. This list feeds both the Expression Engine's<available_sprites>and the Game Master's sprite list. PNGTuber talk and blink frames are never listed. Libraries with only numbered variants list exactly as before.findSpriteExpressionFacetMatchesinshared/utils/sprite-labels.tstreats the first word as the group key and the words after it as facets, in the order written. A faceted name picks among its own variants. When no sprite has every facet, it drops the last facet and tries again, then falls back to the group key.happy_pajamas_wounded→happy_pajamas→happy.resolveExpression) rolls among a faceted name's variants. A concrete numbered name such ashappy_pajamas_02is used as is. With no facet match, it falls back to its own group before any loose substring match, and never to a talk or blink frame.resolveSpriteExpression) and the sprite overlay pick deterministically, so the overlay shows the most specific match across full-body and portrait sprites.half-smile) still roll over their variants as before.docs/characters/sprites.mdexplains faceted names.scripts/regressions/sprite-expression-facets.regression.tscovers the listing, the facet fallback chain, concrete handles, talk/blink frames on both server and client, hyphenated group keys, legacy variant groups, and the overlay's preference for the most specific match. Each case fails on the code before its fix.Ordering, as a known limit. Facets are read in the order the name is written, with the emotion first. That differs from the issue's suggested "outfit > emotion > condition" priority. Pose-first names like
kneeling_happy_armor_woundedgroup underkneeling. An out-of-order request likehappy_woundeddoesn't matchhappy_formalwear_woundedand falls back tohappy. Supporting either would need a per-character facet schema.Prompt. The Expression Engine's prompt template lives in Marinara-Agents (
packages/expression/agents.json). The matching change, telling the agent about faceted names and to keep outfit and condition until the scene changes them, goes in a separate Agents PR. The Engine side works without it, but the agent only chooses faceted names deliberately once that template lands.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
What the agent ran locally:
node ./scripts/pnpm-runner.mjs checkpasses, after rebasing on staging.sprite-expression-facets,sprite-agent-compatibility,sprite-runtime-compatibility,sprite-folders,sprite-list-security,expression-group-generation,expression-tool-retirement,game-tts-emotion,avatar-2d-main-faces,avatar-director,avatar-generation,avatar-variant-compositeandopen-issues.unhappy_pajamaswhen the library has nohappysprite at all, is the resolver's existing last resort and was left as is. Before this PR,happyandhappy_pajamasboth resolved that way too. Narrowing it would change plain group keys for every library.To verify by hand:
happy_pajamas_01,happy_pajamas_02,happy_formalwearandangry_formalwear_soaked_01. The logged<available_sprites>line should listhappy, happy_pajamas, happy_formalwear, angry, angry_formalwear_soaked, with no_01numbers.happy_pajamas, and also when it returns the unlistedhappy_pajamas_wounded.happy_01,happy_02,happy_blush) still rotates between variants forhappyover several turns.happy_pajamasshows the matching sprite.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)docs/characters/sprites.mdgains one paragraph. A[docs-i18n] docs/characters/sprites.mdfollow-up issue is opened for the translated packs.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.