Table of Contents
Fetching ...

LLM-Driven NPCs: Cross-Platform Dialogue System for Games and Social Platforms

Li Song

TL;DR

This paper tackles the limitation of static NPC dialogue and platform confinement by enabling LLM-driven NPCs to converse across a Unity game and a Discord social environment. It proposes a prototype architecture that uses LeanCloud as a shared memory store and a simple favorability metric to modulate responses. Experiments validate cross-platform memory retention and platform-aware behavior using the DeepSeek-R1 model. The results demonstrate technical feasibility and establish a foundation for integrating emotional modeling and longer-term persistent memory via retrieval-augmented techniques. The approach broadens NPC interaction beyond the game client, laying groundwork for persistent social companions in interactive storytelling.

Abstract

NPCs in traditional games are often limited by static dialogue trees and a single platform for interaction. To overcome these constraints, this study presents a prototype system that enables large language model (LLM)-powered NPCs to communicate with players both in the game en vironment (Unity) and on a social platform (Discord). Dialogue logs are stored in a cloud database (LeanCloud), allowing the system to synchronize memory between platforms and keep conversa tions coherent. Our initial experiments show that cross-platform interaction is technically feasible and suggest a solid foundation for future developments such as emotional modeling and persistent memory support.

LLM-Driven NPCs: Cross-Platform Dialogue System for Games and Social Platforms

TL;DR

This paper tackles the limitation of static NPC dialogue and platform confinement by enabling LLM-driven NPCs to converse across a Unity game and a Discord social environment. It proposes a prototype architecture that uses LeanCloud as a shared memory store and a simple favorability metric to modulate responses. Experiments validate cross-platform memory retention and platform-aware behavior using the DeepSeek-R1 model. The results demonstrate technical feasibility and establish a foundation for integrating emotional modeling and longer-term persistent memory via retrieval-augmented techniques. The approach broadens NPC interaction beyond the game client, laying groundwork for persistent social companions in interactive storytelling.

Abstract

NPCs in traditional games are often limited by static dialogue trees and a single platform for interaction. To overcome these constraints, this study presents a prototype system that enables large language model (LLM)-powered NPCs to communicate with players both in the game en vironment (Unity) and on a social platform (Discord). Dialogue logs are stored in a cloud database (LeanCloud), allowing the system to synchronize memory between platforms and keep conversa tions coherent. Our initial experiments show that cross-platform interaction is technically feasible and suggest a solid foundation for future developments such as emotional modeling and persistent memory support.

Paper Structure

This paper contains 11 sections, 3 figures, 2 tables.

Figures (3)

  • Figure 1: After introducing themselves and asking to see the NPC's appearance in Discord, the player is invited to enter the game. Once in-game, the NPC recalls the player’s name and continues the conversation accordingly. All relevant data—including character, platform, content, user ID, timestamp, and haogandu (a favorability metric used to track the NPC's emotional state toward the player)—is stored in the database for subsequent processing by the LLM.
  • Figure 2: System data flow diagram.
  • Figure 3: After receiving a player message, the system saves it to the database, bundles it with the user’s previous dialogue (based on their ID), and appends a request like “Let’s hug” to form a new prompt for the LLM. The model determines whether the requested action is appropriate for the current platform and responds accordingly.