Abstract
Interactive narrative environments require real-time adaptation to player intent to maintain immersion. This paper explores probabilistic models for "keyhole" goal recognition—inferring player objectives solely through observed actions and locations. By comparing N-gram models and Bayesian networks within the CRYSTAL ISLAND environment, the research demonstrates that narrative context significantly enhances prediction accuracy and convergence speed, enabling AI directors to respond dynamically to player behavior.
Introduction
In traditional media, narratives follow a linear path. Interactive narratives, however, aim to provide a living story that reacts to user agency. A central challenge for the "narrative planner"—the AI system managing the story—is understanding the player's intent without explicit queries. This process, known as keyhole goal recognition, must occur in real-time to preserve the "suspension of disbelief." If the AI misinterprets a player's actions (e.g., mistaking the preparation of a poison for making tea), the narrative coherence collapses.
Methodology
The study evaluates two primary probabilistic approaches for goal recognition:
- N-gram Models: Borrowed from natural language processing, these models calculate the probability of a goal based on the current action (Unigrams) or the sequence of the current and preceding action (Bigrams).
- Bayesian Networks: This approach models the causal dependencies between the narrative state, user location, and user actions to infer the most likely goal.
Unlike hand-coded systems, these models were induced from empirical player data, making them resilient to the non-linear and often unpredictable nature of human gameplay.
Experimental Setup
The models were tested using CRYSTAL ISLAND, a 3D microbiology mystery built on Valve’s Source engine. The dataset comprised 15 hours of gameplay from 40 subjects, resulting in over 20,000 training records. The environment featured 20 possible goals, 300 unique actions, and 50 distinct locations, providing a complex testbed for intent recognition.
Results
The performance of the models was measured against their ability to correctly identify one of 20 candidate goals.
Key findings include:
- Accuracy: All models achieved between 51.5% and 54.8% accuracy. While seemingly low, this is over ten times the baseline of random chance (5%).
- Convergence: The Unigram model successfully converged on the correct goal in 83.7% of cases before the task was completed.
- Efficiency: On average, the models identified the correct goal by the midpoint of the action sequence (43.9% to 50.5% convergence point).
- Computational Overhead: All models met real-time requirements, processing observations in milliseconds.
Discussion and Conclusion
The research highlights that narrative context is king. The current "chapter" or state of the story acts as a critical filter, narrowing the space of possible goals. Furthermore, the study suggests that simpler models, like Unigrams, are surprisingly effective and computationally efficient for real-time applications.
Future work aims to address the "single goal" assumption, as players often multitask or explore aimlessly. Additionally, transitioning from goal recognition to full "plan recognition"—understanding how a player intends to achieve a goal—remains a significant frontier for interactive storytelling.
Summary updated