使用遊戲中的角色對白進行NPC的情感模擬
Using the dialogues of in-game characters to simulate the emotions of non-player characters
摘要
非玩家角色作為獨立的角色,提供了多樣的功能來協助遊戲環境的建構,然而大多時候非玩家角色在遊戲中的行為是固定且可預測的,對於玩家的行動給出機械化的反應。為改善此情形並帶給遊戲更加多元的玩法,情感模擬即是其中一個被提出的方法,透過模擬非玩家角色的情感變化來達成行為多樣化的目的。過去的研究中有多種模型被提出,但每項研究中作為模型基礎所採用的心理學模型不盡相同,在模型建構的細節上也有所分別,在這樣的情況下,本研究提出一種以機器學習方式進行建模的方法,期望在達成一定效果的同時,也降低模型建構上的繁雜性。
本研究使用遊戲中最常用的情感表達方式之一,即遊戲角色間的對白作為資料集來源,並以遊戲《巫師3》中一位遊戲中的主要非玩家角色為研究對象,分析其對白中的情感資訊來建立資料集,並以隨機森林訓練情感模擬模型。本研究以實例闡述了使用角色對白來建立資料集的優點與缺點,並從資料分布與模型訓練的情形說明了為何隨機森林適用於此項任務。實驗結果發現,隨機森林能夠很好的根據資料集進行建模,但資料集的建立需要使用更加精確的方式或是加入更多特徵,才能讓模型展現研究對象的特色。
本研究使用遊戲中最常用的情感表達方式之一,即遊戲角色間的對白作為資料集來源,並以遊戲《巫師3》中一位遊戲中的主要非玩家角色為研究對象,分析其對白中的情感資訊來建立資料集,並以隨機森林訓練情感模擬模型。本研究以實例闡述了使用角色對白來建立資料集的優點與缺點,並從資料分布與模型訓練的情形說明了為何隨機森林適用於此項任務。實驗結果發現,隨機森林能夠很好的根據資料集進行建模,但資料集的建立需要使用更加精確的方式或是加入更多特徵,才能讓模型展現研究對象的特色。
Serving as independent characters in games, non-player characters (NPCs) provide various functions to assist in constructing the game environment. However, in most cases, the behavior of NPCs is fixed and predictable, resulting in robotic responses to player actions. To improve NPC performance and bring diversity to gameplay, simulating the emotion of NPCs is one of the proposed methods. Previous researches have introduced multiple models, however, there are variations in the psychological models used as the foundation for each study, as well as differences in the details of model construction. As a result, this study proposes a machine learning-based modeling method with the aim of achieving a similar effect to a certain degree while reducing the complexity of the model construction process. This study utilizes dialogues between game characters as the source of data, which is one of the most commonly used forms of emotional expression in games. A major NPC in the game “The Witcher 3” is selected as the research subject. By analyzing its dialogues, the emotional information contained in the dialogues constructs the dataset, and random forest is applied to train the emotion simulation model. We explained the advantages and limitations of using character dialogues to construct a dataset and the suitability of random forest for this task through examples. The experimental results reveal that random forest is capable of modeling, but the construction of the dataset requires more precise methods or the inclusion of additional features to capture the unique characteristics of the research subject NPC.