[PR #7692] [MERGED] feat(avatars): talking head faces for all 28 detected feelings #7883

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7692
Author: @SpicyMarinara
Created: 10/15/2026
Status: ✅ Merged
Merged: 10/15/2026
Merged by: @SpicyMarinara

Base: staging ← Head: feat/avatar-28-feelings


📝 Commits (4)

  • e777276 feat(avatars): shared list of the 28 detected feelings and the 23 extra faces
  • d379e09 feat(avatars): read a more specific feeling while a reply streams
  • 8e41884 feat(avatars): optional faces for 23 more feelings on the talking head
  • 59d3064 fix(avatars): feeling faces follow the reply, not stale picks or mixed sprite names

📊 Changes

20 files changed (+1297 additions, -134 deletions)

View changed files

📝 docs/agents/avatars.md (+5 -2)
📝 e2e/avatar-2d.e2e.ts (+81 -1)
📝 packages/client/src/features/avatars/director/avatar-director.ts (+63 -18)
📝 packages/client/src/features/avatars/generation/PngtuberVariantsSection.tsx (+7 -2)
📝 packages/client/src/features/avatars/renderers/pngtuber/PngtuberSetupPanel.tsx (+74 -13)
📝 packages/client/src/features/avatars/renderers/pngtuber/pngtuber-layers.ts (+81 -24)
📝 packages/client/src/features/avatars/setup/AvatarSetupPreview.tsx (+36 -7)
📝 packages/client/src/localization/locales/en.json (+26 -0)
📝 packages/server/src/services/avatars/emotion-classifier.ts (+77 -39)
📝 packages/server/src/services/avatars/formats/pngtuber.ts (+36 -8)
📝 packages/server/src/services/avatars/generation/pngtuber-variants.ts (+31 -10)
📝 packages/shared/src/schemas/avatars.schema.ts (+14 -0)
📝 packages/shared/src/types/avatars.ts (+211 -1)
📝 packages/shared/src/utils/expression-keywords.ts (+14 -3)
📝 scripts/regressions/avatar-2d-importers.regression.ts (+24 -1)
📝 scripts/regressions/avatar-2d-renderers.regression.ts (+86 -1)
📝 scripts/regressions/avatar-classifier.regression.ts (+67 -0)
📝 scripts/regressions/avatar-contract.regression.ts (+168 -2)
📝 scripts/regressions/avatar-director.regression.ts (+165 -0)
📝 scripts/regressions/avatar-generation.regression.ts (+31 -2)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Part of #7691: the runtime half. The face maker half is #7696, which merges after this one.

Why this change

Mari: "If it supports 28 emotions, we should allow users to provide all 28 of those. And generate those, too. If someone wants less, that's fine, but we should also allow all of them."

The streaming emotion classifier scores 28 feelings, but the talking head could only show six faces. Fear and confusion both showed the surprised face, embarrassment showed happy, and disgust showed angry.

What changed

  • Shared contract:
    • The 28 detected feelings, each with the emotion it belongs to (one source, moved from the classifier).
    • The 23 extra faces grouped under the six main faces.
    • An optional, strict feelingMap on PNGTuber setups.
    • feeling on classifier results and avatar frames.
    • VRM and mesh avatars stay six-only. No storage or config version bump: avatars have not shipped in a release, and the field is optional and outside the file-backed store.
  • Sprite names → feelings: whole-word matching, never part of a word, using each feeling's name and common synonyms (crying → grief, blushing → embarrassment, scared → fear…).
    • A mixed name such as crying_laughing gets no feeling.
    • Names like "pride" or "gratitude" now count toward their main feeling instead of neutral.
    • Every suggested sprite label keeps its old result (pinned).
  • Classifier: besides the main emotion, it reports the strongest specific feeling inside that emotion (model tier, above the model's own threshold) or the matched keyword (keyword tier).
  • Director: feeling changes have their own 2 s hold, so main-emotion timing, and with it 3D and mesh avatars, is unchanged.
    • A new feeling inside the same emotion clears a label left over from an earlier Expression Engine or Game Master pick.
    • Those picks map to a feeling too.
  • Renderer: exact label, then the feeling's face (only inside the frame's emotion), then the main face.
  • Setup:
    • Face for each feeling → More feelings (collapsed): one select per extra feeling, defaulting to "Uses 's face".
    • "Update from sprites" keeps your picks.
    • Saving blink/talk pictures keeps the feeling faces.
    • The PNGTuber Plus import binds costumes to feelings by sprite name.
    • Blink and talk rows include the extra faces, and the preview can try them.
  • Docs: docs/agents/avatars.md. The translations are tracked in #7638 (comment).
  • Tests: regressions for the contract, classifier, director, 2D renderer, generation merge and importer. The avatar-2d e2e covers the feeling face, the More feelings save and the refresh keeping picks.

Review: a 3-lens adversarial review raised 8 findings; skeptics confirmed 7 and refuted 1. All 7 are fixed in 59d306432, each with a regression that fails without the fix. The face maker half is #7696.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Manually verify in a Roleplay chat with 2D Avatars and the local emotion model: lines like "Thank you so much" and "That's disgusting" show the gratitude and disgust faces when the avatar has them, and the main face otherwise.
  • Manually verify More feelings at phone width: pick a face for Fear, save, reload, and check it stays.
  • Manually verify that a 3D (VRM) avatar behaves exactly as before.
  • Manually verify that saving blink/talk pictures keeps your More feelings picks.

Agent-run validation:

  • shared, server, client and e2e tsc; eslint; prettier; check-locales; localization:check; impeccable:check
  • 19 regressions, including all avatar-*
  • Playwright avatar-2d (26/26), avatar-setup, avatar-generation, avatar-preview on desktop and mobile chromium
  • The core-flows test "Character and Persona avatar actions stay separated…" fails on this branch too. It expects 10 editor section buttons and finds 11, from an editor change on staging that this PR doesn't touch.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

A phone-width screenshot of More feelings was taken during the build; none is attached here.


🔄 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/7692 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/15/2026 **Status:** ✅ Merged **Merged:** 10/15/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feat/avatar-28-feelings` --- ### 📝 Commits (4) - [`e777276`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e77727637cb569f104aa0e982e1438d8c626f159) feat(avatars): shared list of the 28 detected feelings and the 23 extra faces - [`d379e09`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d379e09f393684dc3d42a13fa5e6273a6aeb31f2) feat(avatars): read a more specific feeling while a reply streams - [`8e41884`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8e4188410d322cc7f5e2f959897d9e03678d78c3) feat(avatars): optional faces for 23 more feelings on the talking head - [`59d3064`](https://github.com/Pasta-Devs/Marinara-Engine/commit/59d3064327f702ef7887d2ebda1d37141f33c9c0) fix(avatars): feeling faces follow the reply, not stale picks or mixed sprite names ### 📊 Changes **20 files changed** (+1297 additions, -134 deletions) <details> <summary>View changed files</summary> 📝 `docs/agents/avatars.md` (+5 -2) 📝 `e2e/avatar-2d.e2e.ts` (+81 -1) 📝 `packages/client/src/features/avatars/director/avatar-director.ts` (+63 -18) 📝 `packages/client/src/features/avatars/generation/PngtuberVariantsSection.tsx` (+7 -2) 📝 `packages/client/src/features/avatars/renderers/pngtuber/PngtuberSetupPanel.tsx` (+74 -13) 📝 `packages/client/src/features/avatars/renderers/pngtuber/pngtuber-layers.ts` (+81 -24) 📝 `packages/client/src/features/avatars/setup/AvatarSetupPreview.tsx` (+36 -7) 📝 `packages/client/src/localization/locales/en.json` (+26 -0) 📝 `packages/server/src/services/avatars/emotion-classifier.ts` (+77 -39) 📝 `packages/server/src/services/avatars/formats/pngtuber.ts` (+36 -8) 📝 `packages/server/src/services/avatars/generation/pngtuber-variants.ts` (+31 -10) 📝 `packages/shared/src/schemas/avatars.schema.ts` (+14 -0) 📝 `packages/shared/src/types/avatars.ts` (+211 -1) 📝 `packages/shared/src/utils/expression-keywords.ts` (+14 -3) 📝 `scripts/regressions/avatar-2d-importers.regression.ts` (+24 -1) 📝 `scripts/regressions/avatar-2d-renderers.regression.ts` (+86 -1) 📝 `scripts/regressions/avatar-classifier.regression.ts` (+67 -0) 📝 `scripts/regressions/avatar-contract.regression.ts` (+168 -2) 📝 `scripts/regressions/avatar-director.regression.ts` (+165 -0) 📝 `scripts/regressions/avatar-generation.regression.ts` (+31 -2) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Part of #7691: the runtime half. The face maker half is #7696, which merges after this one. ## Why this change Mari: "If it supports 28 emotions, we should allow users to provide all 28 of those. And generate those, too. If someone wants less, that's fine, but we should also allow all of them." The streaming emotion classifier scores 28 feelings, but the talking head could only show six faces. Fear and confusion both showed the surprised face, embarrassment showed happy, and disgust showed angry. ## What changed - **Shared contract:** - The 28 detected feelings, each with the emotion it belongs to (one source, moved from the classifier). - The 23 extra faces grouped under the six main faces. - An optional, strict `feelingMap` on PNGTuber setups. - `feeling` on classifier results and avatar frames. - VRM and mesh avatars stay six-only. No storage or config version bump: avatars have not shipped in a release, and the field is optional and outside the file-backed store. - **Sprite names → feelings:** whole-word matching, never part of a word, using each feeling's name and common synonyms (crying → grief, blushing → embarrassment, scared → fear…). - A mixed name such as `crying_laughing` gets no feeling. - Names like "pride" or "gratitude" now count toward their main feeling instead of neutral. - Every suggested sprite label keeps its old result (pinned). - **Classifier:** besides the main emotion, it reports the strongest specific feeling inside that emotion (model tier, above the model's own threshold) or the matched keyword (keyword tier). - **Director:** feeling changes have their own 2 s hold, so main-emotion timing, and with it 3D and mesh avatars, is unchanged. - A new feeling inside the same emotion clears a label left over from an earlier Expression Engine or Game Master pick. - Those picks map to a feeling too. - **Renderer:** exact label, then the feeling's face (only inside the frame's emotion), then the main face. - **Setup:** - **Face for each feeling → More feelings** (collapsed): one select per extra feeling, defaulting to "Uses <main>'s face". - "Update from sprites" keeps your picks. - Saving blink/talk pictures keeps the feeling faces. - The PNGTuber Plus import binds costumes to feelings by sprite name. - Blink and talk rows include the extra faces, and the preview can try them. - **Docs:** `docs/agents/avatars.md`. The translations are tracked in #7638 ([comment](https://github.com/Pasta-Devs/Marinara-Engine/issues/7638#issuecomment-6198943720)). - **Tests:** regressions for the contract, classifier, director, 2D renderer, generation merge and importer. The `avatar-2d` e2e covers the feeling face, the More feelings save and the refresh keeping picks. **Review:** a 3-lens adversarial review raised 8 findings; skeptics confirmed 7 and refuted 1. All 7 are fixed in 59d306432, each with a regression that fails without the fix. The face maker half is #7696. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes - Manually verify in a Roleplay chat with 2D Avatars and the local emotion model: lines like "Thank you so much" and "That's disgusting" show the gratitude and disgust faces when the avatar has them, and the main face otherwise. - Manually verify **More feelings** at phone width: pick a face for Fear, save, reload, and check it stays. - Manually verify that a 3D (VRM) avatar behaves exactly as before. - Manually verify that saving blink/talk pictures keeps your More feelings picks. Agent-run validation: - shared, server, client and e2e `tsc`; eslint; prettier; `check-locales`; `localization:check`; `impeccable:check` - 19 regressions, including all `avatar-*` - Playwright `avatar-2d` (26/26), `avatar-setup`, `avatar-generation`, `avatar-preview` on desktop and mobile chromium - The core-flows test "Character and Persona avatar actions stay separated…" fails on this branch too. It expects 10 editor section buttons and finds 11, from an editor change on staging that this PR doesn't touch. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) A phone-width screenshot of More feelings was taken during the build; none is attached here. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:08:27 +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#7883
No description provided.