This research introduces Procedural Artificial Narrative using Generative AI (PANGeA), a structured approach for leveraging large language models (LLMs), guided by a game designer's high-level criteria, to generate narrative content for turn-based role-playing video games (RPGs). Distinct from prior applications of LLMs used for video game design, PANGeA innovates by not only generating game level data (which includes, but is not limited to, setting, key items, and non-playable characters (NPCs)), but by also fostering dynamic, free-form interactions between the player and the environment that align with the procedural game narrative. The NPCs generated by PANGeA are personality-biased and express traits from the Big 5 Personality Model in their generated responses. PANGeA addresses challenges behind ingesting free-form text input, which can prompt LLM responses beyond the scope of the game narrative. A novel validation system that uses the LLM's intelligence evaluates text input and aligns generated responses with the unfolding narrative. Making these interactions possible, PANGeA is supported by a server that hosts a custom memory system that supplies context for augmenting generated responses thus aligning them with the procedural narrative. For its broad application, the server has a REST interface enabling any game engine to integrate directly with PANGeA, as well as an LLM interface adaptable with local or private LLMs. PANGeA's ability to foster dynamic narrative generation by aligning responses with the procedural narrative is demonstrated through an empirical study and ablation test of two versions of a demo game. These are, a custom, browser-based GPT and a Unity demo. As the results show, PANGeA holds potential to assist game designers in using LLMs to generate narrative-consistent content even when provided varied and unpredictable, free-form text input.
翻译:本研究提出了一种名为“基于生成式AI的程序化人工叙事”(PANGeA)的结构化方法,旨在利用大型语言模型(LLMs),在游戏设计师高层级标准的引导下,为回合制角色扮演游戏(RPGs)生成叙事内容。与先前将LLMs应用于电子游戏设计的方法不同,PANGeA的创新之处在于:不仅生成游戏关卡数据(包括但不限于场景设定、关键物品和非玩家角色(NPCs)),还促成了玩家与环境之间与程序化游戏叙事相一致的动态、自由形式交互。PANGeA生成的NPCs具有个性偏向,其生成的回应表达了大五人格模型中的特质。PANGeA解决了处理自由形式文本输入所带来的挑战——这类输入可能引发LLM生成超出游戏叙事范围的回应。通过一套利用LLM智能性的新型验证系统,PANGeA可评估文本输入,并将生成的回应与持续展开的叙事对齐。为实现这些交互,PANGeA由一台服务器支持,该服务器托管自定义记忆系统,为增强生成的回应提供上下文,从而使其与程序化叙事保持一致。为便于广泛应用,该服务器配有REST接口,使任何游戏引擎都能直接与PANGeA集成;同时配备可与本地或私有LLM适配的LLM接口。通过一个实证研究及对两个版本演示游戏(定制浏览器版GPT和Unity演示版)的消融测试,PANGeA通过对齐回应与程序化叙事来促进动态叙事生成的能力得到验证。结果表明,即使在面对多变且不可预测的自由形式文本输入时,PANGeA仍具有潜力,可协助游戏设计师利用LLM生成与叙事一致的内容。