Abstract
Large Language Models (LLMs) offer the potential for dynamic narrative in video games, yet evaluating their performance in complex, grounded environments remains a challenge. This paper presents a framework for evaluating LLM-generated dialogue within the context of the critically acclaimed RPG Disco Elysium. By linearizing complex game states into masked Lua scripts and employing a two-stage human evaluation interface, we compare GPT-4's outputs against professional designer-written prose. Our results indicate that while LLMs excel at persona-driven style transfer, human writers are significantly preferred for maintaining logical consistency and narrative grounding.
Introduction
The integration of Large Language Models (LLMs) into video games promises a future of "endless variety" and reactive storytelling. However, the industry faces a significant hurdle: traditional NLP metrics like BLEU scores or perplexity fail to capture the nuance of a game's "vibe" or the logical consistency required by complex narrative structures. In a role-playing game (RPG), dialogue is not just text; it is a reflection of the player's past choices, inventory, and character persona. This research addresses the "grounding" problem—ensuring AI dialogue respects the intricate game state—and provides a principled methodology to measure player perception within high-stakes narrative environments.
Methodology: Constrained Dialogue Infilling
Instead of tasking an LLM with open-ended story generation, the authors introduced a constrained dialogue infilling task. This approach provides the model with existing human-written dialogue and asks it to modify specific lines to match a different game state (e.g., shifting a neutral response to a "communist" or "fascist" persona).
A key technical challenge was representing the game's complex logic to the model. The researchers utilized a process called Linearization, converting the game’s dialogue trees and Lua-based logic into a "masked Lua script." This format allows GPT-4 to process a hybrid of code and natural language, maintaining the context of variables and branching paths.
Evaluation Framework
To ensure high-fidelity feedback, the team developed a custom web application that recreated the aesthetic and functional feel of Disco Elysium. This allowed participants to experience dialogue in its intended context rather than as isolated snippets.
The study employed a unique Two-Stage Annotation process. Players first selected their preferred response from a set of options. Subsequently, they were shown the next line of dialogue in the game and asked if they wished to revise their choice. This "hindsight check" was designed to reveal whether AI-generated responses maintained long-term narrative coherence or merely sounded plausible in the moment.
Key Insights
The evaluation, involving 28 "super-fans" from the r/DiscoElysium community, yielded several critical findings:
- The "Illogical in Hindsight" Trap: Approximately 32% of GPT-4’s generations were deemed "illogical" once the player saw the subsequent turn. While the AI can produce engaging prose in isolation, it often fails to set up the next beat of the story correctly.
- Persona vs. Context: GPT-4 demonstrated high proficiency in "style transfer," successfully mimicking specific political or character personas. However, it frequently missed subtle environmental cues, such as the presence of specific NPCs or environmental details.
- The Interest Gap: While human writers outperformed the LLM on most metrics, the gap was narrowest in "providing interesting dialogue options." Players found LLM-generated choices nearly as engaging as professional ones, suggesting a role for LLMs as brainstorming tools for designers.
Results
Quantitative results showed a clear preference for human-written content. Players preferred human dialogue 61% of the time, compared to 28% for GPT-4. The disparity was most pronounced in "Logical Flow," where humans were preferred 67% to 21%. GPT-4's strongest performance was in "advancing player goals" (33% vs. 57%) and "interesting options" (36% vs. 47%).
Conclusion and Future Work
The study concludes that "grounding" remains the primary challenge for AI in narrative games. Professional writers do more than write lines; they construct the "connective tissue" of the world. Future research should explore "collaborative human-LLM writing," where AI suggests variations while human designers maintain logical anchors. Additionally, increasing the LLM's context window to include the entire game history may help mitigate the hindsight logic problem.
Summary updated