[GH-ISSUE #8637] [Feature]: Faceted sprite selection #8438

Closed
opened 2026-11-07 16:42:57 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @Ghost-Data11 on GitHub (Nov 1, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8637

Originally assigned to: @SpicyMarinara on GitHub.

What problem does this solve?

A nice-to-have capability is more complex sprite selection. My understanding of expression engine is that it currently resolves all sprites with a matching first-token into a single group and then allows the caller to select one at random, so happy_01, happy_02, and happy_blush all effectively become random picks for the happy expression.
What I'd like is for multi-faceted sprite selection so things like happy + pajamas and happy + formalwear are possible based on context. With more selection slots, we can express things like angry_formalwear_soaked_01, where we resolve a sprite based on emotion (happy, sad, shy), wardrobe (pajamas, normal, naked), and physical condition (soaked, burning, dirty).

Proposed solution

The most straight forward implementation would be to expand on expression engine to have the agent evaluate multiple conditions and pick from a collection that does not group by any one explicit slot - We could trim off only variant numbers from the end where they exist and send the entire collection of slot1_slot2_slot3... options to the agent to choose from. This could include any number of conditions, so sprites like kneeling are just as valid as kneeling_happy_armor_wounded and would only be limited by the sprite options that have been uploaded.

For sprite gaps, a priority could be added to the agent instructions for each evaluated slot. For example, outfit > emotion > condition/state, so if the only wounded sprite is in armor but the character is currently in pajamas, priority would dictate that a non-wounded pajama sprite be picked instead.

Alternatives considered

  • Resolve sprites from a folder structure since this system would allow for potentially hundreds of sprites. I don't think it makes much difference to the agent since it will effectively see the same split.
  • Handle this with a custom agent. There are a number of hard checks for agentType "expression" that I think would need to be changed to check customAgentHasCapability. I haven't confirmed if agentType refers strictly to a built in agent id or if it's reusable type that any agent can declare.

Additional context

  • I have not fully analyzed game mode, so I can't yet speculate on how this change would apply to it. From the high level overview, it looks like poses are handled by a basic decision engine, so it might not actually be possible to achieve this without an agent in the game mode pipeline.
  • I had a local agent make changes to my instance to test this capability, and it does seem to work in roleplay mode. After reviewing the code, it is slop not worth PRing. I'm opening this issue to discuss the feasibility with folks more familiar with the repo before implementing a real change.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Ghost-Data11 on GitHub (Nov 1, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8637 Originally assigned to: @SpicyMarinara on GitHub. ## What problem does this solve? A nice-to-have capability is more complex sprite selection. My understanding of expression engine is that it currently resolves all sprites with a matching first-token into a single group and then allows the caller to select one at random, so happy_01, happy_02, and happy_blush all effectively become random picks for the happy expression. What I'd like is for multi-faceted sprite selection so things like happy + pajamas and happy + formalwear are possible based on context. With more selection slots, we can express things like angry_formalwear_soaked_01, where we resolve a sprite based on emotion (happy, sad, shy), wardrobe (pajamas, normal, naked), and physical condition (soaked, burning, dirty). ## Proposed solution The most straight forward implementation would be to expand on expression engine to have the agent evaluate multiple conditions and pick from a collection that does not group by any one explicit slot - We could trim off only variant numbers from the end where they exist and send the entire collection of slot1_slot2_slot3... options to the agent to choose from. This could include any number of conditions, so sprites like kneeling are just as valid as kneeling_happy_armor_wounded and would only be limited by the sprite options that have been uploaded. For sprite gaps, a priority could be added to the agent instructions for each evaluated slot. For example, outfit > emotion > condition/state, so if the only wounded sprite is in armor but the character is currently in pajamas, priority would dictate that a non-wounded pajama sprite be picked instead. ## Alternatives considered - Resolve sprites from a folder structure since this system would allow for potentially hundreds of sprites. I don't think it makes much difference to the agent since it will effectively see the same split. - Handle this with a custom agent. There are a number of hard checks for agentType "expression" that I _think_ would need to be changed to check customAgentHasCapability. I haven't confirmed if agentType refers strictly to a built in agent id or if it's reusable type that any agent can declare. ## Additional context - I have not fully analyzed game mode, so I can't yet speculate on how this change would apply to it. From the high level overview, it looks like poses are handled by a basic decision engine, so it might not actually be possible to achieve this without an agent in the game mode pipeline. - I had a local agent make changes to my instance to test this capability, and it does seem to work in roleplay mode. After reviewing the code, it is slop not worth PRing. I'm opening this issue to discuss the feasibility with folks more familiar with the repo before implementing a real change. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
Author
Owner

@SpicyMarinara commented on GitHub (Nov 1, 2026):

Implemented in #8653, merged into staging: faceted sprite names (happy_pajamas, angry_formalwear_soaked_01) are listed to the Expression Engine and Game Master and resolve by facet, dropping the last facet when no sprite fits. The Expression Engine prompt that teaches the agent to use them is Pasta-Devs/Marinara-Agents#2029.

<!-- gh-comment-id:6562765580 --> @SpicyMarinara commented on GitHub (Nov 1, 2026): Implemented in #8653, merged into `staging`: faceted sprite names (`happy_pajamas`, `angry_formalwear_soaked_01`) are listed to the Expression Engine and Game Master and resolve by facet, dropping the last facet when no sprite fits. The Expression Engine prompt that teaches the agent to use them is Pasta-Devs/Marinara-Agents#2029.
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#8438
No description provided.