Abstract
Interactive fictions, or text-adventures, are games in which a player interacts with a world entirely through textual descriptions and text actions. Text-adventure games are typically structured as puzzles or quests wherein the player must execute certain actions in a certain order to succeed. In this paper, we consider the problem of procedurally generating a quest, defined as a series of actions required to progress towards a goal, in a text-adventure game. Quest generation in text environments is challenging because they must be semantically coherent. We present and evaluate two quest generation techniques: (1) a Markov model, and (2) a neural generative model. We specifically look at generating quests about cooking and train our models on recipe data. We evaluate our techniques with human participant studies looking at perceived creativity and coherence.
Introduction
Procedural content generation (PCG) has long been a staple of game development, primarily focused on generating environments like dungeons or planetary terrains. However, generating narrative—the "why" and "how" of a game—remains a significant challenge. In text-adventure games (Interactive Fiction), players interact with the world entirely through natural language. For a computer to generate a quest in this medium, it requires "narrative intelligence."
A generated quest must be semantically coherent to maintain player immersion. For instance, if a system instructs a player to "cook a cake" using "fish and motor oil," or asks them to "fry an egg" without providing a stove, the narrative logic breaks. This paper explores bridging this gap by grounding generated text in structured knowledge to ensure quests are both readable and playable.
Methodology
The proposed framework utilizes a two-step pipeline: Content Generation (creating the quest's plot) and Quest Assembly (translating the plot into a playable game environment).
Content Generation
The researchers evaluated two distinct approaches for generating cooking-themed quests using a dataset of over 20,000 recipes from AllRecipes.com:
- Markov Chains: A weighted "ingredient graph" was constructed from the recipe data. To generate a new recipe, the model performs a probabilistic walk on this graph, selecting ingredients that frequently co-occur (e.g., flour and eggs) while avoiding incoherent pairings.
- Neural Language Model: A GPT-2 (345M) model was fine-tuned on the recipe dataset. An LSTM first generates a list of ingredients, which GPT-2 then uses to generate a title and step-by-step instructions.
Quest Assembly
To ensure playability, the generated text must be grounded in the game world. This is achieved using Knowledge Graphs to define the logical constraints of the environment:
- Object Graphs: These define the spatial hierarchy and locations of items (e.g., "milk is in the fridge").
- Action Graphs: These define the "affordances" of objects, specifying the tools required for certain actions (e.g., "a knife is required to cut a carrot").
This grounding ensures that if a generative model produces a step like "dice the onions," the game engine (using the TextWorld framework) knows to place an onion in a container and a knife in a drawer, making the action executable by the player.
Evaluation and Results
The models were evaluated through human studies with 75 participants, comparing them against human-designed quests and random baselines.
- Coherence and Accomplishment: The Neural Model (LM) outperformed Markov models and was comparable to human-designed quests in simpler, one-room scenarios. Players reported a significantly higher sense of accomplishment when completing quests generated by the Neural Model.
- Originality vs. Coherence: There is a notable trade-off between complexity and coherence. As the game world expands (e.g., from one room to five), players perceive the game as more "original" and "surprising," but the perceived coherence of the quest tends to drop.
- Creativity Threshold: Quests that are too random (the "Random Assignment" baseline) were perceived as having zero creative value, highlighting that internal logic is a prerequisite for perceived creativity.
Conclusion
While currently focused on the cooking domain, this framework demonstrates that grounding statistical text generation in structured knowledge graphs is essential for creating playable narrative content. Future work aims to automate the extraction of "world rules" (Action Graphs) from text corpora to allow the system to generate quests across various genres without manual intervention.
Summary updated