Mood and Non-Verbal
The mood system controls how agents express emotion and non-verbal behaviour during conversations.
Mood states drive long lived animation changes, and can influence automatic camera shot selection.
How mood works
MoodService manages the current mood state for each agent in a conversation. When a mood beat is encountered during playback, the service updates the agent's mood, which triggers downstream presentation changes.
Mood data
Mood states are defined as entries in a mood repository configured through module settings. Each mood entry consists of:
- ID -- a string identifier (e.g. "angry", "happy", "neutral")
- Idle animation -- an
AnimationClipthat plays as the agent's idle when this mood is active
You can add custom moods to the repository to match your narrative needs. Create a mood repository asset at Assets > Create > BardTreeLtd/Dialogue/Non Verbal/Mood and assign it in module settings.
Mood events
MoodEventingService fires events when mood changes occur. External systems can subscribe to these events to trigger additional effects -- for example, changing ambient lighting or adjusting background music during tense conversations.
Non-verbal eventing
NonVerbalEventingService handles broader non-verbal signals beyond mood. This includes things like gesture triggers and posture shifts that accompany dialogue but are not directly tied to a mood state.
Lip sync
The dialogue system supports lip sync through pluggable providers:
- ULipSync -- a lightweight solution with two modes:
- Blend Shape -- drives facial blend shapes from audio analysis
- Jaw Bone -- volume-driven jaw bone rotation (configurable open rotation, smoothing, and volume scale)
- OVRLipSync -- Meta's Oculus lip sync solution
When an audio beat plays, the presentation service starts lip sync on the speaking agent and stops it when the audio ends. The lip sync provider is resolved through the module system, so you can swap implementations without changing dialogue content.
To set up lip sync on an agent, use the editor menu items at BardTreeLtd/Dialogue/Setup/Add uLipSync (Blend Shape) to Selected or BardTreeLtd/Dialogue/Setup/Add uLipSync (Jaw Bone) to Selected.
Mood and camera
Mood states can influence automatic camera shot selection through the MoodDrivenShotRule. A DefaultMoodCameraHintResolver maps moods to shot preferences. For example, an angry mood might prefer close-ups to emphasise intensity, while a neutral mood might use medium framing.
See Camera Shot Rules for details.
Practical advice
Mood beats are most effective when used sparingly at key emotional shifts. A conversation that changes mood every line feels chaotic. Let the mood settle, and change it when the tone genuinely shifts.
Start with neutral and one or two contrasting moods. Expand the mood repository as your narrative complexity grows.
Next step
Continue to UI and Theming.