This study explores the use of Large Language Models (LLMs) for implementing personality-driven behavior in Non-Player Characters (NPCs) within games. A companion NPC leverages the OCEAN personality model to guide decision-making through natural language prompts, eliminating the need for traditional scripting or behavior trees. A stateless LLM combined with an automated prompt generator dynamically constructs context-aware prompts based on NPC traits, game states, and environmental factors. Implemented in the roguelike Rudantara RPG game, the companion NPC responds to gameplay conditions with behaviors aligned to its defined personality. The test results show that the system enables flexible and coherent decision-making and lowers the technical barrier to creating personalized behavior by allowing the player to interact using natural language instead of a complex behavior tree and scripting. Furthermore, to evaluate the decision-making process, participants with prior experience in RPG games were invited to play the prototype. Their responses indicated that the system was capable of simulating behavior aligned with the assigned personality traits.
Tarigan et al. (Mon,) studied this question.