Emotion-Aware and Context-Grounded Dialogue Agents for Personalized Video Game Interactions
Organizations: National Centre for Computer Animation, Bournemouth University, UK · SIE, London, UK · SIE, San Mateo, USA · Ningbo China Institute for Supply Chain Innovation, MIT Global Scale Network, China
Abstract
We present ChatNPC, a game companion that dynamically personalizes its responses in real time based on players' emotional shifts to enhance user immersion. The model integrates sequential data, leveraging the dynamic nature of streams to benefit from player information, spoken lines, and in-game context. We leverage recent progress in LLMs' tool-calling capabilities to extract vital information from memory and recognize potential constraints for accurate reasoning, thereby tackling the complexity of NPC conversation scenarios. The task is divided into a game sentinel-guided agent (SeGent), a memory capability, and a chat planning tool for reasoning instantiation. The approach uses a lightweight game template as an information framework, with relevant details and a thorough reasoning layout. We conduct extensive experiments on a newly developed game dataset for in-game context NPC dialogue and demonstrate that ChatNPC sequentially captures players' emotional shifts over time; responses are more naturalistic and human-like with appropriate conversational cues, pauses, and sighs; and utterances remain faithful to the dynamics of in-game context and player actions, supporting narrative continuity.
Figures & tables
| Spoken-line: | We need support |
| In-game Context: | Heavy enemy incoming during combat |
| Response: | Roger that, heavy support incoming. Let’s show them what we’ve got! |
| Spoken-line: | That generator might be the distraction I need. |
| In-game Context: | Hangar Mission - Escape hangar interaction prompt |
| Response: | Oh man, you are right! That generator could be exactly what we need to get out of here alive. |
| Utterances | Context | Responses | |
| Token counts | 148668 | 156616 | 497319 |
| Unique words | 7815 | 1758 | 8248 |
| Train Validation Testing | |||
| 10,000 3,885 512 | |||
| Context Window | ||
| Model (Open-source) | Token | * Messages |
| Llama 2 | 4k | 50 |
| Llama 3 | 8k | 50 |
| Mythalion 13B | 4K | 50 |
| Roleplay Llama 3 8B | 8K | 50 |
| ROUGE-L | ROUGE-WE | ||||||
|---|---|---|---|---|---|---|---|
| Model | Precision | Recall | F1 | Precision | Recall | F1 | |
| Base | Llama 2 7B | 0.327 | 0.25 | 0.275 | 0.465 | 0.417 | 0.443 |
| Llama 2 13B | 0.383 | 0.272 | 0.318 | 0.48 | 0.436 | 0.461 | |
| Llama 2 70B | 0.516 | 0.404 | 0.453 | 0.599 | 0.55 | 0.573 | |
| Llama 3 8B | 0.391 | 0.279 | 0.326 | 0.489 | 0.441 | 0.482 | |
| Llama 3 70B | 0.523 | 0.419 | 0.468 | 0.621 | 0.571 | 0.595 | |
| ROUGE-WE | ||||
|---|---|---|---|---|
| ChatNPC | Precision | Recall | F1 | Time (Sec) |
| LLM agent | 0.857 | 0.8051 | 0.839 | 14-20 |
| Ours | 0.855 | 0.805 | 0.83 | 5-8 |
Appendix figures & tables9 assets
Supplementary material from the paper’s appendix.
Appendix
| Genre | Count |
|---|---|
| Vehicular Combat | 7864 |
| Action | 5840 |
| Action-Adventure | 406 |
| FPS | 287 |
| Score | Description |
|---|---|
| 1–2 | Irrelevant or contradictory; ignores the player’s input and/or contradicts the game context. |
| 3–4 | Weak; loosely related but generic, misses the main point of the input, or misreads the game context. |
| 5–6 | Adequate; addresses the input and is broadly consistent with the context, but generic, partially off-target, or misses the player’s emotional cues. |
| 7–8 | Good; clearly addresses the input, makes specific and correct use of the game context, and responds appropriately to the player’s emotion, with only minor issues. |
| 9–10 | Excellent; fully addresses the input, integrates the game context precisely, responds sensitively to the player’s emotion, and stays fully in character. |
| Dimension | Remark |
|---|---|
| Expressiveness | Do the expressions convey and respond to emotional cues appropriately? |
| Coherence | Does the dialogue feel more coherent and meaningful? |
| Naturalness | Is the response human-like with appropriate use of conversational markers? |
| Relevance | Does the interaction feel more personal and relevant? |
| Hyper-parameter | Values | |
|---|---|---|
| steps | 15k | |
| batch size | 16 | |
| Fine-tune | learning rate | 4e-5 |
| lora r | 16 | |
| lora alpha | 32 | |
| lora dropout | 0.1 |
| Questions | VW | QW | Normal | NsG | NaA |
|---|---|---|---|---|---|
| Q3 | 44.4% (8) | 55.6% (10) | 0% | 0% | 0% |
| Q4 | 22.2% (4) | 77.8% (14) | 0% | 0% | 0% |
| Q5 | 50.0% (9) | 50.0% (9) | 0% | 0% | 0% |
| Q6 | 27.8% (5) | 61.1% (11) | 11.1% (2) | 0% | 0% |
Emotion-Aware Dialogue Generation
Emotion-aware dialogue generation adapts conversational responses to users’ feelings, context, and interaction goals across text, speech, and multimodal settings.
See all 56 papers