top of page
Master Thesis

PANGeA is not just another step in game development; it's a leap towards creating dynamic, engaging, and personalized gaming experiences. By leveraging large language models (LLMs), PANGeA introduces a novel method for generating narrative content that not only adapts to the player's actions but also maintains coherence and depth throughout the gameplay. This system allows for an unprecedented level of interaction between the player and the game's world, where every choice can lead to a unique narrative path, enriched by characters with distinct personalities and evolving story arcs.

Dark Shadow Game Minutes

Framework Introduction

image.png

        The diagram presents an overview of the PANGeA system, a sophisticated framework designed to enrich turn-based role-playing games with procedurally generated narratives. At its foundation lies the interaction between the game designer's criteria—such as setting, time, and the number of NPCs—and player input, which can be a selection from generated options or custom free-form text. This input acts as a directive for the PANGeA Unity Plug-In within the game engine, which constructs JSON prompts that encapsulate the game state and narrative elements informed by the player’s actions and the designer’s foundational criteria.

These prompts are sent via HTTP requests to a dedicated server, which operates as the nerve center of the PANGeA system. It features a REST API that processes the incoming data and interfaces with a Large Language Model (LLM) through the LLM Interface. The LLM, powered by advanced AI, generates narrative content that is both context-sensitive and aligned with the unfolding story.

A crucial component of the server is the Memory System, which retains information about the game's narrative developments and player interactions. This memory allows for a continuity of experience, ensuring that past events influence future narrative possibilities. Additionally, the Validation System assesses both player input and LLM-generated content, ensuring they adhere to the game’s rules and narrative consistency.

The unity of these components—player choices, game designer criteria, game engine processing, and server-side validation and memory—culminates in a dynamic and responsive narrative experience, where each player's journey through the game world is as unique as their decisions, crafting a deeply personalized and engaging RPG adventure.

Server

image.png

        This server is multifaceted, consisting of several interrelated components that work in concert to manage and direct the flow of data, narrative logic, and memory essential for a dynamic and interactive gaming experience.

        At the gateway of the server is the REST API, which acts as the initial receiver and responder to the HTTP requests sent by the game engine. These requests carry vital information regarding player actions and game states that require narrative progression. Once a request is received, the Behavior Handler takes over. This element serves as the operational core of the server, orchestrating the flow of information to and from various utilities and managing the logic that dictates the server's response to different scenarios and inputs.

        The LangChain Utilities and the LLM Interface connect directly to the core artificial intelligence of the system—the Large Language Model (LLM). These utilities enable the parsing, understanding, and generation of language-based content, providing the mechanism through which narrative elements are crafted and refined.

On the other side of the server architecture lies the Game Service, an elaborate structure that houses several crucial systems. Clients interface with the server, likely representing different instances or sessions of gameplay, each requiring a personalized narrative thread.

        Beneath this, we find the Session layer, featuring Persistent Memory, which maintains a continuous and evolving record of the game's state, tracking changes across multiple play sessions. This persistent memory is key to creating a continuous experience for players, remembering their actions and the evolving state of the game world between sessions.


     

Memory System

image.png

MemoryPiece Scheme

         In the PANGeA system, the roles of short-term and long-term memory are crucial for maintaining a coherent and evolving narrative. Short-term memory acts as a simple container, caching a specific amount of recent dialogue history for immediate access. This ensures that the game can reflect the latest player interactions swiftly and accurately.

On the other hand, long-term memory is responsible for storing the entire history of dialogues and events, providing a deep repository of the game's narrative. Each memory fragment is parsed through an embedding model, which enables the system to efficiently retrieve and utilize relevant data to support more complex plot developments and NPC behavioral patterns.

        The utilization of long-term memory allows NPCs to remember and reference past events over an extended timeline, thus offering players a consistent and coherent storytelling experience across multiple gaming sessions. By leveraging this approach, the PANGeA system can create a dynamic and deep game world where the narrative content evolves in response to player decisions.

bottom of page