Papers
Topics
Authors
Recent
Search
2000 character limit reached

STORY2GAME: Generating (Almost) Everything in an Interactive Fiction Game

Published 6 May 2025 in cs.AI | (2505.03547v1)

Abstract: We introduce STORY2GAME, a novel approach to using LLMs to generate text-based interactive fiction games that starts by generating a story, populates the world, and builds the code for actions in a game engine that enables the story to play out interactively. Whereas a given set of hard-coded actions can artificially constrain story generation, the ability to generate actions means the story generation process can be more open-ended but still allow for experiences that are grounded in a game state. The key to successful action generation is to use LLM-generated preconditions and effects of actions in the stories as guides for what aspects of the game state must be tracked and changed by the game engine when a player performs an action. We also introduce a technique for dynamically generating new actions to accommodate the player's desire to perform actions that they think of that are not part of the story. Dynamic action generation may require on-the-fly updates to the game engine's state representation and revision of previously generated actions. We evaluate the success rate of action code generation with respect to whether a player can interactively play through the entire generated story.

Summary

  • The paper introduces a pipeline that leverages LLMs to dynamically generate interactive narratives, world structures, and corresponding game code.
  • It employs a multi-stage process using graph-based modeling and dynamic action inference to ensure logical story progression and semantic accuracy.
  • Evaluation shows high success in code compilation and narrative adaptation, demonstrating the system's potential for advanced AI-driven game development.

STORY2GAME: Generating (Almost) Everything in an Interactive Fiction Game

Introduction

The paper "STORY2GAME: Generating (Almost) Everything in an Interactive Fiction Game" introduces a system that leverages LLMs to generate interactive fiction games starting from narrative generation, through world population, to action code construction. Unlike traditional methods where a predefined set of user actions guides game development, this approach focuses on creating a more open-ended and immersive interactive fiction experience. The system dynamically generates actions based on player input, addressing the potential divergence between the capabilities of an LLM-based story generator and a rigid game engine.

Game Generation Pipeline

The system employs a multi-staged game generation pipeline where the first stage involves generating a narrative with predetermined preconditions and effects that ensure logical story progression. Preconditions dictate the world state required for an action to occur, whereas effects describe how actions alter the world. An important aspect is utilizing these action specifications to dictate the code's functioning in the game engine, ensuring seamless integration between storylines and gameplay mechanics. Figure 1

Figure 1: Game Generation Pipeline.

The game world is conceptualized as a graph structure wherein nodes correspond to objects, rooms, and characters. This allows the story's dynamic nature to be mirrored in the game engine. Rooms are organized in a grid system linking actions to their narrative-specified locations, while items and characters possess inventories and roles defined by the narrative.

Dynamic Action Generation

In addressing the player's potential deviation from narrative-prescribed actions, the system introduces a dynamic action generation process, which constructs new in-game actions on-the-fly. This process involves inferring preconditions and effects of actions suggested by players that are not initially part of the story. The novelty of this approach lies in its ability to incorporate new objects or attributes into the game to support these player-driven actions, adapting existing game mechanics to maintain consistency with the story's logic. Figure 2

Figure 2: Dynamic Action Generation Pipeline.

Evaluations and Results

The evaluation focuses on the successful initialization of the game engine and the efficacy of dynamic action generation. Of note, is the system's ability to handle the majority of actions in the generated stories, indicating high rates of successful code compilation, and semantic accuracy within the defined logical framework. Figure 3

Figure 3: Average node counts of different types based on story length.

Compilation and semantic success rates demonstrate scalability across varied narrative lengths and increasing complexity. Furthermore, the dynamic action generation exhibits promising results in maintaining coherence, adapting narrative and gameplay seamlessly when new, unforeseen player actions are introduced. Figure 4

Figure 4: Percentage of times each category was chosen as a precondition. 30 total items and characters considered, each applied with 3 novel verbs.

Figure 5

Figure 5: Novel Action Generation Confirmation Percentiles.

Conclusion

The "STORY2GAME" system effectively integrates narrative generation with interactive gameplay elements, setting a precedent for future advancements in AI-driven game development. By employing LLMs not only for storytelling but also for dynamic game engine adaptation, the approach offers considerable flexibility and potential for personalized storytelling experiences. The research provides a foundation for expanding narrative-based gaming, with future directions likely involving refinement of dynamic action integration and exploration into more complex story generation techniques.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Collections

Sign up for free to add this paper to one or more collections.

Tweets

Sign up for free to view the 2 tweets with 0 likes about this paper.