PANGeA: Procedural Artificial Narrative using Generative AI for Turn-Based Video Games

Steph Buongiorno,Lawrence Jake Klinkert,Tanishq Chawla,Zixin Zhuang,Corey Clark
2024-07-10
Abstract:This research introduces Procedural Artificial Narrative using Generative AI (PANGeA), a structured approach for leveraging large language models (LLMs), guided by a game designer's high-level criteria, to generate narrative content for turn-based role-playing video games (RPGs). Distinct from prior applications of LLMs used for video game design, PANGeA innovates by not only generating game level data (which includes, but is not limited to, setting, key items, and non-playable characters (NPCs)), but by also fostering dynamic, free-form interactions between the player and the environment that align with the procedural game narrative. The NPCs generated by PANGeA are personality-biased and express traits from the Big 5 Personality Model in their generated responses. PANGeA addresses challenges behind ingesting free-form text input, which can prompt LLM responses beyond the scope of the game narrative. A novel validation system that uses the LLM's intelligence evaluates text input and aligns generated responses with the unfolding narrative. Making these interactions possible, PANGeA is supported by a server that hosts a custom memory system that supplies context for augmenting generated responses thus aligning them with the procedural narrative. For its broad application, the server has a REST interface enabling any game engine to integrate directly with PANGeA, as well as an LLM interface adaptable with local or private LLMs. PANGeA's ability to foster dynamic narrative generation by aligning responses with the procedural narrative is demonstrated through an empirical study and ablation test of two versions of a demo game. These are, a custom, browser-based GPT and a Unity demo. As the results show, PANGeA holds potential to assist game designers in using LLMs to generate narrative-consistent content even when provided varied and unpredictable, free-form text input.
Artificial Intelligence,Computation and Language
What problem does this paper attempt to address?
The paper aims to address the challenges encountered when generating narrative content based on large language models (LLMs) in video games, particularly how to handle free-form text input while maintaining narrative consistency. Specifically: 1. **Dynamic Narrative Generation**: Utilizing large language models to generate game storylines that can change with player input, enhancing the realism and interactivity of the gaming experience. 2. **Challenges of Free-Form Text Input**: When players or developers provide free-form text input, these inputs may lead to LLMs generating content that exceeds the expected narrative scope, thereby disrupting the story's consistency. 3. **Balancing Narrative Consistency and Player Freedom**: Ensuring that the generated content aligns with the game designers' intentions while encouraging players to freely explore and interact. To address these issues, the paper introduces a system called PANGeA (Procedural Artificial Narrative using Generative AI), which achieves its goals through the following methods: - Using a memory system to store game data, including characters' memories; - Introducing a validation system to ensure that free-form text input complies with game rules; - Utilizing the Big Five personality model to shape the reactions of non-player characters (NPCs), enhancing the quality of interactions between players and NPCs; - Providing a Unity game engine plugin and a RESTful interface to facilitate integration with other game engines. Through these methods, PANGeA not only generates content that aligns with the narrative context but also supports dynamic interaction in real-time gameplay, ensuring consistency and coherence of the content.