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.
翻译:本研究提出了基于生成式人工智能的程序化人工叙事生成系统(PANGeA),该方法通过游戏设计师提供的高层设计准则引导大型语言模型(LLM),为回合制角色扮演游戏(RPG)生成叙事内容。与以往将LLM应用于视频游戏设计的研究不同,PANGeA的创新性不仅体现在生成游戏关卡数据(包括但不限于场景设定、关键道具与非玩家角色(NPC)),更在于促成玩家与游戏环境之间符合程序化叙事的动态自由交互。PANGeA生成的NPC具有人格偏向性,其生成回应会体现大五人格模型的特质。针对自由文本输入可能引发LLM生成超出游戏叙事范畴回应的问题,PANGeA提出了一种基于LLM智能的新型验证系统,用于评估文本输入并使生成回应与展开的叙事保持一致。为实现这些交互,PANGeA由搭载定制记忆系统的服务器支持,该系统通过提供上下文增强生成回应,使其与程序化叙事相协调。为提升普适性,该服务器设有REST接口支持任何游戏引擎直接集成PANGeA,同时提供可适配本地或私有LLM的接口。通过两个演示游戏版本(定制浏览器端GPT演示与Unity演示)的实证研究与消融测试,验证了PANGeA通过使生成回应与程序化叙事对齐来实现动态叙事生成的能力。结果表明,即使在面对多样且不可预测的自由文本输入时,PANGeA仍具备协助游戏设计师运用LLM生成叙事一致性内容的潜力。