登录 EN

添加临时用户

大语言模型驱动的非玩家角色交互设计系统研究与应用

Research and Application of NPCs Interaction Design System Based on Large Language Model

作者:代沐芸
  • 学号
    2021******
  • 学位
    硕士
  • 电子邮箱
    940******com
  • 答辩日期
    2024.05.16
  • 导师
    袁春
  • 学科名
    电子信息
  • 页码
    132
  • 保密级别
    公开
  • 培养单位
    599 国际研究生院
  • 中文关键词
    非玩家角色交互;游戏设计;大型语言模型;检索增强生成;提示设计
  • 英文关键词
    NPC interaction; game design; LLMs; RAG; prompt design

摘要

非玩家角色(NPC)作为强调交互叙事的游戏的关键部分,成为合适的交互代理并承担向用户传递叙事内容的角色。在设计过程中如何快速构造令人信服、且具有足够交互深度的非玩家角色成为了一个研究方向。传统的非玩家角色交互系统需要创作者预先编译对话及脚本,非玩家角色通常不具有自主思考能力来应对更开放的输入,而直接对NPC语料库进行模型训练需要花费大量时间和资源,本文尝试引入大语言模型,构建了一个基于交互叙事理论的非玩家角色交互设计系统(NIDS),它能够帮助创作者快速设计出符合设计需求的NPC而无需逐一编写对话行为脚本,与一些直接接入大语言模型的尝试性实践不同,它还能兼顾创作者意图以避免NPC产生不可信行为,从而提升参与者的能动性、沉浸感。因此,为了使NPC兼具自主思考和传递创作者意图的能力,该系统包含了两个关键部分:一个自适应的人格模型管理器以及一个基于检索增强生成的机制戏剧管理器。人格模型管理器使NPC的对话逻辑更符合人设,并能够根据玩家的操作进行自适应的更新变化。机制戏剧管理器将设计师规定的内容作为NPC对环境的理解,并构建了世界知识库,通过检索增强生成的方法寻找最相关的游戏内允许的信息,使NPC的回复内容与游戏密切相关且更加真实可信。最终结合两个管理器的信息自动编译生成指导大语言模型回答的提示。接着,将设计模块进行封装,实现了一个构建NPC对话的创作工具,利用这个工具实现的NPC,可以根据用户开放式的交互,动态化自适应地生成可信互动叙事内容。并基于这个创作工具设计开发了一个以明朝为历史背景的角色扮演游戏《代号:明》。最后,为了验证设计目的构建了一个评估模型,通过对比实验验证了设计系统的有效性,并用游戏体验量表问卷和半结构化访谈来评估游戏带来的互动体验,即玩家的沉浸感和能动性。本文的主要贡献如下:(1)集成了叙事理论、自然语言处理、知识建模、检索增强生成、提示工程等多种设计与技术方法,提出了一个非玩家角色交互设计系统。(2)该设计系统通过检索增强生成与大语言模型的结合,兼顾了NPC自主思考能力和创作者控制权,可根据设计需求扩展应用到各种互动叙事作品设计中,以提升玩家的能动性和沉浸感。

Non-Player Characters (NPCs), essential in games that emphasize interactive narratives, serve as suitable interactive agents and play a crucial role in delivering narrative content to users. A significant research direction is the rapid construction of convincing NPCs with sufficient interactive depth. Traditional NPC interaction systems rely on creators to pre-compose dialogues and scripts, with NPCs typically lacking the autonomy to adapt to more open-ended inputs. Training models directly on NPC corpora is time and resource-intensive. This paper introduces the integration of large language models, establishing an NPC Interaction Design System (NIDS) grounded in interactive narrative theory. It enables creators to quickly design NPCs meeting specific design criteria without individually scripting dialogue actions. Unlike direct integrations of large language models, this system also maintains creator intent, preventing untrustworthy NPC behavior and thus enhancing participant engagement and immersion.The system incorporates two critical components for NPC autonomy and narrative delivery: an adaptive personality model manager and a mechanism drama manager based on Retrieval-Augmented Generation. The adaptive personality model manager ensures NPC dialogues are consistent with their character profiles and adaptively evolves based on player interactions. The mechanism drama manager uses the designer-defined content to shape NPCs‘ environmental understanding and constructs a world knowledge base. By employing retrieval-augmented generative methods, it ensures NPC responses are closely tied to the game narrative and are more authentic. These components work in tandem to automatically generate cues that guide large language model responses.Further, the design modules are encapsulated into a tool for developing NPC dialogues, allowing the creation of NPCs that dynamically and credibly interact in narrative contexts based on open-ended user interactions. Utilizing this tool, a role-playing game named "Code: Ming" set in the Ming Dynasty was developed. To validate the design objectives, an evaluation model was employed, using comparative experiments to demonstrate the system‘s effectiveness. The game‘s interactive experience, particularly in terms of player immersion and agency, was assessed through game experience questionnaires and semi-structured interviews.The primary contributions of this paper are as follow:(1) The novel proposal of an NPC Interaction Design System, integrating narrative theory, natural language processing, knowledge modeling, retrieval-augmented generation, and prompt engineering.(2) The design system, combining retrieval-augmented generation with large language models, maintains a balance between NPC autonomy and creator control. It is scalable for diverse interactive narrative designs, aiming to enhance player agency and immersion.