Abstract
This paper explores the potential for large language models (LLMs), specifically ChatGPT-4o, to engage in role-playing games (RPGs) by making decisions based on predefined belief systems and motivations. Using a text-based dungeon crawler environment, the LLM was assigned structured character profiles incorporating alignments from Dungeons & Dragons and motivations—wealth accumulation, wanderlust, or safety—to guide decision-making. This approach supports player modeling by enabling the creation of non-player characters (NPCs) that reflect diverse player types, facilitating personalized, adaptive serious games. We also introduce a system for evaluating an LLM’s effectiveness in character generation, offering a structured framework for assessing its ability to maintain consistent, motivation-driven behavior. LLMs demonstrated improved decision-making accuracy ranging from 75% to 93% under the structured framework. The lowest performance appeared in chaotic and evil profiles—behavioral patterns often attenuated during pretraining—while the highest accuracy was found in lawful and neutral profiles oriented toward safety. These findings highlight the potential for LLMs to enhance game design through richer NPC interactions and more dynamic, player-adaptive experiences.