Emotion-Aware and Context-Grounded Dialogue Agents for Personalized Video Game Interactions
Authors: Michael Adjeisah, Jin Zhang, Pierluigi Vito Amadori, Ryan Spick, Eshani Kawshika Fernando, Kwame Omono Asamoah, Huiwen Zhao, Jian Jun Zhang, Guy Moss, Jian Chang
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
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
Figure 1: Snippets of ChatNPC responses showing more naturalistic and human-like, with appropriate conversational cues, making it more believable with the SeGent .
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.
Table 1: Sample curated dataset from various games with desired responses for training and testing.
Utterances
Context
Responses
Token counts
148668
156616
497319
Unique words
7815
1758
8248
Train Validation Testing
10,000 3,885 512
Table 2: Statistics of the iGCD Dataset.
Figure 2: The overall architecture of ChatNPC consists of three main modules. The sentinel-guided agent with two different encoding types (an in-game context and emotion encoders), the memory manager to process information between the in-context and the out-of-context window, and the chat planning agent to format the output request.
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
Table 3: Llama 2&3 open-source models, two different roleplay models based on Llama 2&3, and the primary context window length. The default maximum token of *messages is set to an average of 50 tokens (approximately 250 characters).
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
Table 4: The overall model performance is based on Llama base, roleplay, and fine-tuned models. ChatNPC responses are scored against the human-in-the-loop ’gold’ responses.
Figure 3: Ablation study on the in-game context ( with (w) and without (w/o)) on both Llama 2 and 3 70B models.
Figure 4: Snippets of the ChatNPC responses when noticing that the user is distressed and moments of sensation.
Figure 5: Ablation study on the rescale mechanism by iterating the model (Llama 2 70B as the backbone) multiple times to signify previously interacted situations within the game. ROUGE-L ( left ) and ROUGE-WE ( right ).
Figure 6: Distribution of all responses pooled across Q3–Q6 (n = 18 participants × 4 questions = 72 responses)
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
Table 5: Computational analysis of ChatNPC average response time with an LLM agent as an emotion summarizer and our emotion encoder.
Appendix figures & tables9 assets
Supplementary material from the paper’s appendix.
Appendix
Genre
Count
Vehicular Combat
7864
Action
5840
Action-Adventure
406
FPS
287
Appendix
Table 6: Game data distribution by genre.
Figure 7: Characteristics of the iGCD test set (512 rows). Left to right: words per player utterance, per in-game context, and per gold response (dashed line: median; the last bar gathers all longer rows), and the number of contexts by how many test rows share them.
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.
Appendix
Table 7: Scoring rubric used by the LLM judge (context relevance).
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?
Appendix
Table 8: Dimensions and remarks of human-in-the-loop evaluation.
Emotion-aware dialogue generation adapts conversational responses to users’ feelings, context, and interaction goals across text, speech, and multimodal settings.
National Centre for Computer Animation, Bournemouth University, Bournemouth, United Kingdom · Information Hub, The Hong Kong University of Science and Technology (Guangzhou), Guangzhou, China · Key Laboratory of Child Cognition & Behavior Development of Hainan Province, Qiongtai Normal University, Haikou, China +2