← Back to projects
Featured Research ProjectGame AI · LLM Systems

Living World

A research prototype investigating how large language models can integrate with complete game systems rather than functioning as isolated NPC chatbots.

Godot 4GDScriptOllamaMistralPythonFlaskYOLOv11HTTP / JSON
Living World banner describing LLM-aware behavior trees, game-state-aware NPCs, and personalized conversations

01

Research objective

Living World explores a different model for generative AI in games. Instead of attaching a chatbot to an NPC, the game engine constructs verified context from world state, NPC behavior, conversation history, reputation, personality, and player emotion. The LLM receives that context and turns it into natural language.

The prototype game exists to test the mechanic. The research focus is the architecture required to make an LLM part of the game world as a whole.

02

Murat's role

Murat originated the project, designed the core architecture, and completed the primary implementation before the prototype was extended with additional NPC variations for the class group submission.

  • Designed the research direction and system architecture.
  • Built the initial Godot environment and reusable gameplay foundation.
  • Integrated local LLM inference through Ollama and Mistral.
  • Implemented the prompt-building and HTTP/JSON response pipeline.
  • Connected NPC personality, history, intent, and world-state flags to dialogue.
  • Developed the Guard NPC and freeform conversation interface.
  • Directed the extension of the system into additional NPC implementations.

03

Research questions

The prototype was built to investigate architectural questions, not to produce a complete commercial game.

01

Can an LLM respond to verified game state rather than only player dialogue?

02

Can behavior and intent shape generated speech without scripting every line?

03

Can previous world events influence future conversations coherently?

04

Can player emotion become useful conversational context?

05

Can traditional dialogue systems coexist with generative responses?

06

Can this integration pattern transfer across different game genres?

04

Core integration pipeline

The engine owns the facts. The language model renders those facts as character dialogue.

Player input
Game contextPersona · intent · world state · behavior · history · reputation · emotion
Prompt builder
Ollama + Mistral
Parsed NPC dialogue

05

Personality-driven freeform dialogue

The Guard responds without relying on a predefined dialogue line.

Player asking the Guard how he is, followed by an LLM-generated response consistent with a vigilant guard personality
NPC persona and conversational history are added to the prompt so the generated response remains aligned with the character's role.

06

World-state-aware conversation

A sequence of player actions changes the facts supplied to the model, producing different dialogue without manually authored branches.

The player asks the Guard who robbed the lab
1. The Guard discusses the unresolved laboratory robbery.
The player asks whether they are a suspect
2. The Guard evaluates the player against the current state.
The player confesses and the Guard responds with a punishment
3. A confession changes the context and generated response.

07

Authored choices, generated responses

A traditional merchant dialogue option followed by an LLM-generated reaction

Traditional interaction choices remain useful for gameplay structure. The selected action becomes context for an LLM-generated response, allowing authored mechanics and generative dialogue to coexist.

08

Emotion-aware dialogue

A local Python service uses YOLOv11 to classify the player's facial expression. Flask exposes the current emotion through an HTTP endpoint, and Godot adds the result to the NPC prompt before requesting dialogue.

Godot logs showing a detected sad emotion added to the LLM prompt before generating Guard dialogue

The visible log shows the HTTP response, detected emotion, final context, and dialogue-generation sequence.

09

Architecture evolution

A later version formalized the prototype without changing its central research claim. Version 3 introduced a centralized state and event layer, expanded NPC state machines, combat and health systems, recent world-history injection, fallback dialogue, and response caching.

These changes strengthened the separation between deterministic game logic and probabilistic language generation, but remain a supporting evolution rather than the main focus of this case study.

10

Current limitation

The implemented pipeline is primarily one-directional. Game state influences what the LLM says, but generated dialogue does not yet directly execute game actions. A future action layer could require structured model output such as validated intents or tool calls before modifying world state.