- 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: 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: 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: 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: Percentage of times each category was chosen as a precondition. 30 total items and characters considered, each applied with 3 novel verbs.
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.