Print

发布时间: 2019-09-16
摘要点击次数:
全文下载次数:
DOI: 10.11834/jig.180581
2019 | Volume 24 | Number 9




    虚拟现实和增强现实    




  <<上一篇 




  下一篇>> 





辅助社交训练严肃游戏中虚拟角色行为表现的不确定性模型
expand article info 吴佳佳1, 刘箴1, 刘婷婷2, 王瑾2
1. 宁波大学信息科学与工程学院, 宁波 315211;
2. 宁波大学科学技术学院, 宁波 315211

摘要

目的 建立行为可信的虚拟角色能够使严肃游戏更加有趣,提升用户使用的体验感。尽管严肃游戏的图形渲染技术已经日趋成熟,但现有的虚拟角色行为表现方式多采用确定性模型,很难反映虚拟角色行为表现的多样性。方法 本文构建了符合辅助社交训练的严肃游戏剧情,采用智能体来描述虚拟角色,赋予虚拟角色视觉、听觉双通道感知。基于马斯洛动机理论,采用食物、休息、交流和安全等动机来描述情绪的产生,利用大五(OCEAN)个性模型来描述虚拟角色的不同个性差别。用外部刺激和内部动机需求来计算情绪强度,利用行为树描述虚拟角色的行为。运用正态云模型处理虚拟角色行为表现的不确定性,并以行走方向、社交距离、交流时身体朝向3个典型的行为表现给出了具体处理方法。结果 在所实现的游戏原型系统中,对于虚拟角色的自主行为和行为表现的不确定性进行了用户体验测试。结果表明,在场景探索任务中,虚拟角色的自主行为模型能减少用户探索场景所耗费的时间,并且可以促进用户与虚拟角色交流;在行为表现测试中,本文模型的自然性评价要高于确定性模型。结论 本文虚拟角色行为模型在一定程度上可提升用户的体验感,有望为建立行为可信的虚拟角色提供一种新的途径。

关键词

严肃游戏; 虚拟角色; 辅助社交; 云模型; 行为表现; 不确定性

Uncertainty model to generate virtual characters' behavior in serious games for social training
expand article info Wu Jiajia1, Liu Zhen1, Liu Tingting2, Wang Jin2
1. Faculty of Information Science and Engineering, Ningbo University, Ningbo 315211, China;
2. College of Science and Technology, Ningbo University, Ningbo 315211, China

Abstract

Objective Virtual characters with believable behavior can make serious games more interesting and enhance users' experiences. Although the graphics rendering technology of serious games has become more and more mature, most existing virtual character behavioral models are based on deterministic models, which are difficult to reflect the diversity of virtual characters' behaviors. However, humans' behaviors are generally uncertain. On the one hand, the variables involved in behavior generation are ambiguous; on the other hand, behavioral performance, which is mostly realized through body movements, expressions, and interpersonal interactions, is random. The cloud model, a method proposed by DeyiLi to deal with uncertain information, can be a solution to this problem. The model has been applied in many areas, such as pattern recognition, but its application in serious games has not been reported. Method In the proposed game, the plot is designed according to the needs of social training, and agents are used to describe virtual characters. The proposed framework will generate autonomous behavior includes three layers:sensing layer, decision layer, and action layer. The sensing layer acquires external environment information (including stimuli, events, and other virtual characters in the virtual environment) through visual and auditory channels. Each virtual character has a perceptible area. If an object enters into the perceptible area, it will be perceived by the virtual character. The acquired information will then be stored in the memory of the sensing layer and transferred to the database, which stores a virtual character's identity, personality, initial location information, and animation data. The database information will be updated over time. The decision layer is composed of a motivation module, a behavior module, and an emotion module. The motivation module generates motivation. When the motivation intensity reaches a certain value, it triggers the corresponding behavior and emotional state. Based on Maslow's motivation theory, the motivations of finding food, taking rest, doing communication and keeping safety are used to describe the generation of emotions. The big five (OCEAN) personality model is used to divide the virtual characters into five categories:openness, conscientiousness, extraversion, agreeableness, and neuroticism. The behavior module generates behavior, and the emotion module generates the emotion for the virtual character on the basis of the relevant information transmitted by the sensing layer. The intensity of the emotion is calculated according to the distance from the stimulus and the strength of the current motivation. It determines the intensity of the emotional performance and behavioral performance of the virtual character. The action layer includes a navigation module and an action module, which acquires characters' animation data from the database and renders skeletal animation. The navigation module plans the path according to the final destination selected in the decision layer. It also detects possible collisions that may occur between the virtual character and other virtual characters or obstacles in the environment. The behavioral trees are used to describe virtual characters' behaviors. The normal cloud model is used to deal with the uncertainty of the behavior of virtual characters, and specific design methods are provided for the three typical behaviors during communication, walking direction, social distance, and body orientation. Result In the developed game prototype system, the user experience test is carried out to assess the uncertainty of virtual characters' autonomous behavior and behavioral performance. Five children and eleven adults participants are recruited to test the useful of the proposed behavioral models. The 16 participants are divided equally into two groups:experimental group and control group. Participants in experimental group plays the game with autonomous behavioral model while participants in control group plays the game with script-driven behavioral model. Test results showed that the autonomous behavioral model can reduce the time of exploring the scene, and can promote the user to communicate with the virtual character; To test of the uncertainty of behavior performance, thirteen volunteers are recruited. Game video clips are used to compare the changes in walking direction, social distance, and body orientation. The upper part of the contrasted video is the deterministic model, and the lower part is the uncertainty. Volunteers who are not in turn cannot watch other's operation processes to ensure the authenticity of the experimental results. The naturalness of the three behavior is scored. Conclusion Results showed that the proposed model can generate more natural behavior than the deterministic model and obtain higher recognition from users. The virtual characters under the proposed model are natural and attractive to users, and the method can enhance user experience.

Key words

serious game; virtual character; social assistant; cloud model; behavioral performance; uncertainty

0 引言

严肃游戏是具有教育意义的游戏,它将计算机图形学与人工智能有效地结合,运用寓教于乐的方式来实现学习目标[1-2]。严肃游戏通常需要使用可视化和探索的方式实现教育内容,从而提高用户对游戏主题的兴趣。

人际交往能力对于任何年龄段的人来说都很重要,Tan等人[3]认为个体在社会中不能适应与其社交技能缺失有关,通过游戏训练用户的社交能力,发现训练效果令人欣喜。一些具有社交障碍的用户,通过游戏中的社交训练,可以帮助他们更快融入社会。

现有的虚拟角色行为表现模型大多都是确定性的,不能体现出现实生活中人类行为表现的多变性。日常生活中人类的行为表现具有一定的不确定性,一方面行为产生所涉及的变量适合用模糊集来描述;另一方面,行为表现大多通过身体的动作、表情和人际交互实现的,行为表现存在着随机性。

本文在借鉴以往认知模型研究的基础上[4],建立虚拟角色自主行为模型,提出了虚拟角色行为表现不确定信息处理方法,能够更好地描述虚拟角色情绪和行为产生过程,有助于创建行为可信的虚拟角色,为辅助用户训练社交提供帮助。

1 相关工作

1.1 虚拟角色行为模型

涂晓媛等人[5]提出的人工鱼模型是一种群体智能仿真模型,使虚拟角色的群体行为更加真实;刘东林等人[6]改进了人工鱼群算法,利于全局收敛,更有效进行群体仿真;Nguyen等人[7]使用迭代设计方法为虚拟角色的非语言表现力进行建模,但以上模型都没有考虑到虚拟角色行为的不确定性。

Parenthoen等人[8]利用模糊认知和主动认知的思想为虚拟角色建模,实验验证了在虚拟帆船中的虚拟舵手的可信性行为;Drevs[9]使用刻板印象内容模型为虚拟角色建模,用来模拟可信性、热情和能力程度,帮助病人选择医院,以上两个虚拟角色模型应用场景特殊,不具有普适性。

田尊华等人[10]利用了不确定性函数仿真虚拟角色群体,验证了不确定性在虚拟角色行为建模的重要性;刘渭滨等人[11]构建了虚拟角色自主框架,赋予虚拟角色感知、决策等能力,可以实时创建真实感虚拟角色,在考虑到虚拟角色行为的不确定性的模型中并没有考虑到行为的模糊性。

1.2 严肃游戏中虚拟角色行为模型

严肃游戏中的虚拟角色用于康复训练领域已经很普遍。

刘箴等人[12]研究的虚拟角色情绪认知评价模型,基于OCC(Ortony-Clore-Collins)理论,利用决策规则为严肃游戏中的虚拟角色模拟情绪强度;Pacella等人[13]利用严肃游戏调节用户与虚拟角色在社交中的情绪表现;Milne等人[14]利用逼真的人物头像作为虚拟辅导员来训练用户识别情绪能力、学习谈话技巧,虚拟辅导员与用户进行短暂的互动,然后指导用户采取适当的行为。

综上所述,现有社交严肃游戏中虚拟角色的行为表现比较固定,而运用不确定信息处理技术为虚拟角色行为建模还不常见,如何将不确定信息处理技术引入到虚拟角色的行为建模值得深入研究。

2 社交严肃游戏原型系统

辅助社交训练严肃游戏原型系统主要通过交互规则、虚拟环境、虚拟角色中的感知层、决策层和动作层构建,用户通过交互规则与虚拟环境交互,虚拟环境中包括虚拟角色,虚拟角色通过感知层将感知到的信息传给决策层,决策层决策下一步行为传到动作层执行,最后动作层反馈到用户,如图 1所示。

图 1 辅助社交训练严肃游戏原型系统
Fig. 1 The game prototype system of serious game for social training

3 虚拟角色行为描述

自主的、不确定行为表现的虚拟角色会更加真实、可信。虚拟角色的感知域、身份和个性是确定的,但是虚拟角色的身体状态、动机、行为和情绪都是在不断变化的,进而导致输出的情绪表现、动作也是不确定的。对于不确定信息的处理主要是在决策层和动作层。将图 1中的虚拟角色部分细化,构建如图 2所示虚拟角色自主行为框架。

图 2 虚拟角色自主行为框架图
Fig. 2 The behavior framework diagram of virtual character autonomous

感知层通过视觉、听觉双通道获取外部环境信息,外部环境信息即虚拟环镜中的刺激物、事件、其他虚拟角色等信息,每一个虚拟角色都有一个可感知区域,如果对象进入此区域就认为是可被感知到的,则会存储到感知层的记忆库中,然后传入数据库,数据库中存储着虚拟角色的身份、个性、初始位置信息、动作数据等,并定时更新当前自身状态信息。

决策层由动机模块、情绪模块和行为模块组成,根据感知模块传入的相关信息,基于动机驱动,产生虚拟角色的行为和情绪。动机模块根据自身状态信息激发动机,行为模块实现行为过程,情绪模块根据距离刺激物远近和当前动机强度来计算情绪的强度,情绪强度决定了虚拟角色的情感表现[15],并可以改变虚拟角色的动作表现。

动作层包括导航模块和动作模块,导航模块是根据决策层最终选出的目的地进行路径规划,包括实现与其他虚拟角色以及障碍物的碰撞检测,动作模块从数据库中获取角色动画数据,并实现骨骼动画的渲染。

3.1 感知描述

通过模拟人类的眼睛、耳朵接收信号的范围和角度,设计了视觉模型和椭球听觉模型。

视觉模型是根据人眼的视觉范围和视距设计的,视觉范围是类似于一个四棱锥区域,以虚拟角色中心为坐标原点建立局部坐标系,绘制一个锥形区域,右下角为世界坐标系的原点,图 3(a)—(c)${d_v}$为虚拟角色最远可视距离,$φ$$θ$分别为虚拟角色左侧和右侧视角边界与世界坐标$X$轴正方向夹角,$ξ$$ω$分别为虚拟角色下部和上部视角边界与世界坐标$Y$轴正方向夹角,其中虚拟角色正面朝向$Z$轴的正方向。

图 3 视觉模型
Fig. 3 Visual model((a) perspective view; (b) horizontal decomposition diagram; (c) vertical decomposition diagram)

若满足以下条件,则表示其他对象是可被虚拟角色看见的,即

$ \left\{ \begin{array}{l} \left| {\mathit{\boldsymbol{O}} - \mathit{\boldsymbol{V}}} \right| \le {d_v}\\ \theta \le {A_X}{\left( {\mathit{\boldsymbol{O}} - \mathit{\boldsymbol{V}}} \right)_{XZ}} \le \varphi \\ \omega \le {A_Y}{\left( {\mathit{\boldsymbol{O}} - \mathit{\boldsymbol{V}}} \right)_{ZY}} \le \xi \end{array} \right. $ (1)

式中,$\mathit{\boldsymbol{O}}$表示在世界坐标系下其他对象的向量位置,$\mathit{\boldsymbol{V}}$表示在世界坐标系下虚拟角色的向量位置,$\left| {\mathit{\boldsymbol{O}} - \mathit{\boldsymbol{V}}} \right|$表示取$\mathit{\boldsymbol{O}}$$\mathit{\boldsymbol{V}}$之间的距离,${A_X}{\left({\mathit{\boldsymbol{O}} - \mathit{\boldsymbol{V}}} \right)_{XZ}}$表示取$\mathit{\boldsymbol{V}}$指向$\mathit{\boldsymbol{O}}$的向量在$XZ$平面的投影与$X$轴正方向的夹角,${A_Y}{\left({\mathit{\boldsymbol{O}} - \mathit{\boldsymbol{V}}} \right)_{ZY}}$表示取$\mathit{\boldsymbol{V}}$指向$\mathit{\boldsymbol{O}}$的向量在$ZY$平面的投影与$Y$轴正方向的夹角。

人类的听觉感知在不同方向上存在差异性,将经典的球型听觉模型改进为椭球模型,以虚拟角色中心为坐标原点建立局部坐标系,绘制一个椭球形区域,右下角为世界坐标系的原点,如图 4(a)所示,${d_{h1}}$表示虚拟角色水平方向上长轴听觉半径,${d_{h2}}$表示虚拟角色水平方向上短轴听觉半径,${d_{h3}}$表示虚拟角色垂直方向上长轴听觉半径,其中虚拟角色正面朝向$Z$轴的正方向。

图 4 听觉模型
Fig. 4 Auditory model((a) auditory stereogram; (b) horizontal decomposition diagram; (c) vertical decomposition diagram)

满足以下条件则认为其他对象是可被听见的

$ \frac{{{{({\mathit{\boldsymbol{O}}_x} - {\mathit{\boldsymbol{V}}_x})}^2}}}{{{d_{h1}}^2}} + (\frac{{{\mathit{\boldsymbol{O}}_z} - {\mathit{\boldsymbol{V}}_z}{)^2}}}{{{d_{h2}}^2}} + \frac{{{{({\mathit{\boldsymbol{O}}_y} - {\mathit{\boldsymbol{V}}_y})}^2}}}{{{d_{h3}}^2}} \le 1 $ (2)

式中,$\mathit{\boldsymbol{O}}$的坐标为$({O_x}, {O_y}, {O_z})$$\mathit{\boldsymbol{V}}$的坐标为$({V_x}, {V_y}, {V_z})$

3.2 动机描述

虚拟角色通过感知层感知到外部坏境和自身的状态信息之后,需要决策层对信息进行处理,触发虚拟角色的动机。根据心理学家马斯洛[16]提出的人类的基本动机理论,通过模糊集[17]来描述动机的变化,用隶属函数${M_i}\left(t \right)(i = 1, \ldots, n)$表示动机强度,设${\alpha _i}$${M_i}\left(t \right)$的临界值,取值均为[0, 1],$t$表示时间。

本文实验考虑4种动机,分别为寻找食物、休息、交流和安全动机,具体解释如下:

1) 当${M_i}\left(t \right) < {\alpha _i}$,此时动机不影响行为和情绪。

2) 求助行为触发条件:当外界危险信息(其他虚拟角色的威胁、环境的危险等)与虚拟角色的距离达到一定值时,则${M_4}\left(t \right) \ge {\alpha _4}$,求助行为触发。

3) 寻找食物或休息的行为触发条件:当${M_4}\left(t \right) < {\alpha _4}$成立,${M_1}\left(t \right) \ge {\alpha _1}$${M_2}\left(t \right) \ge {\alpha _2}$至少有一个成立时,取${\rm{max}}[{M_1}\left(t \right), {M_2}\left(t \right)]$,则寻找食物或者休息行为触发。

4) 交流行为触发条件:当${M_1}\left(t \right) < {\alpha _1}$${M_2}\left(t \right) < {\alpha _2}$${M_3}\left(t \right) \ge {\alpha _3}$${M_4}\left(t \right) < {\alpha _4}$都成立,并且与其他虚拟角色的距离达到一定值时,交流行为触发。

3.3 行为描述

行为是将内在动机通过行动、表情外化的过程。行为由动机决定,比如去买食物的行为,首先是虚拟角色感到饥饿,然后产生寻找食物的动机,此时触发某种情绪,然后就会产生前往超市买东西的行为,这时情绪值增强,最后买到食物,情绪强度达到最大值。

行为表示包括情绪表现和动作,情绪表现通过表情符号表示,动作通过角色骨骼动画表现。

3.4 情绪描述

人物个性对于情绪触发具有影响,且情绪对社会关系具有动态影响[18]。用户可以根据个性识别交际对象,不同身份的人会有不同的个性,根据塔佩斯提出的大五人格理论(OCEAN)[19],将游戏中的虚拟角色按身份不同赋予不同的个性,如表 1所示,是一些虚拟角色个性的例子。

表 1 虚拟角色个性与身份
Table 1 Virtual character personality and identity

下载CSV
种类 特性 身份
开放性(openness) 情感丰富程度 玩伴
责任性(conscientiousness) 尽职、谨慎程度 售货员
外倾性(extraversion) 热情程度 理发员、路人
宜人性(agreeableness) 依赖他人程度 动物(猫)
神经质(neuroticism) 脆弱、敏感程度 路人

情绪的变化可以帮助用户在交流中学习人际交往的技巧。模拟情绪过程使用的是OCC模型,这是最早从人工智能角度描述人类情绪的认知结构,为情绪模拟提供了有效的框架[20-21]

产生情绪的条件有两个,一是虚拟角色某种动机占主导地位,二是受到外界信息的刺激。不同个性的虚拟角色触发相同情绪的临界距离会有所区别,当${M_i} \ge {\alpha _i}$时,设${R_j}(j = 1, \ldots, 5)$${D_k}(k = 1, \ldots, 5)$分别为5种个性的虚拟角色产生情绪的最远距离和最近距离,则情绪强度函数为

$ f\left( r \right) = \left\{ \begin{array}{l} {M_i}\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;r > {R_j}\\ {\rm{max}}\left( {\frac{{{R_j} - r}}{{{R_j} - {D_k}}}, {M_i}} \right)\;\;\;\;\;\;\;\;\;\;{D_k} < r \le {R_j}\\ 1\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;r \le {D_k} \end{array} \right. $ (3)

式中,$r$是虚拟角色与刺激物的距离。

举例说明个性与情绪的关系,当两个虚拟角色都通过视觉感知检测到了刺激物,且动机${M_i}$值相同的情况下,神经质的虚拟角色比较敏感,而责任性的虚拟角色比较谨慎、克制,面对刺激物时前者比后者的情绪值更高。

3.5 行为实现

通过行为树[22]实现虚拟角色的行为产生过程。行为树是常用的智能决策算法,在形式上呈树形,行为树中节点类型主要分为4种:顺序节点,顺序执行所属子节点;选择节点,选择其节点下的一子节点执行;条件节点,判断条件是否成立;动作节点,输出行为表现,行为树结构如图 5所示。

图 5 虚拟角色行为树
Fig. 5 Virtual character behavior tree

虚拟角色行为算法步骤如下:

输入:虚拟角色动机${M_i}$的值与$r$${R_j}, {D_k}$

输出:虚拟角色行为表现。

1) 条件节点检测${M_i}$${\alpha _i}$是否成立;

2) 若${M_i}$ < ${\alpha _i}$则返回;

3) 若${M_i}$${\alpha _i}$成立,则根据$r$${R_j}$${D_k}$${M_i}$计算式(3)中的情绪强度函数$f(r)$

4) 选择节点根据$f(r)$的值选择其子条件节点中的一个执行;

5) 执行符合条件节点下的顺序节点,从左到右依次执行动作节点,输出行为表现,包括表情和动作。

4 行为表现的不确定信息处理

4.1 行为表现的不确定信息描述

行为表现是行为的外化,本文重点关注行走方向、社交距离、交流时身体朝向变化3个典型的行为表现。例如,人在行走时,行走轨迹通常不会是一条直线而是曲线,文献[23]中对虚拟角色行走运用的是Perlin噪声模拟,但Perlin噪声只能模拟出虚拟角色行走的随机性,并不能表现出所有虚拟角色的运动特点。正态云模型既能表现单个虚拟角色行走方向的随机性,还能将整体虚拟角色行走方向描述成有规律的正态云形状。

正态云模型是由中国工程院院士李德毅等人[24]提出的概念,正态云模型将概率理论的随机性与模糊理论的不确定性相结合,可以很好地模拟许多自然现象,主要有3个参数进行控制:期望$Ex$、熵$En$、超熵$He$。采用正向隶属云发生器,期望$Ex$表示的是云滴在论域空间分布的期望,是最能够代表定性概念的点,用$Ex$表示虚拟角色的行走方向或社交距离或身体朝向的波动期望值,熵$En$是表示云滴的离散程度,表示虚拟角色之间的差异程度,超熵$He$是熵的不确定性度量,即熵的熵,由熵的随机性和模糊性共同决定,表示每个虚拟角色的差异程度。

${G_g}$($g$=1, 2, 3)分别表示行走方向云、社交距离云和交流身体朝向云,主要算法步骤为:

输入:3个特征值$Ex$$En、He$,云滴数$N$(本文取$N$=1 000);当前时间$t$,时间间隔$m$

输出:${G_g}$

1) 生成以$En$为期望值、$He$为标准差的一个正态随机数$En′$

2) 生成以$Ex$为期望值、$En′$的绝对值为标准差的正态随机数$Gx$,计算确定度$Gy$,即

$ Gy = {\rm{exp}}\left[ {\frac{{ - {{\left( {Gx - Ex} \right)}^2}}}{{2{{\left( {En\prime } \right)}^2}}}} \right] $ (4)

3) 每$m$时间间隔后,重复步骤1)2)直到生成$N$个云滴;

4) 生成${G_g}$

4.2 虚拟角色行走方向的不确定性

模拟行走方向就是模拟虚拟角色的法线方向的指向,从正态云模型中每隔一定时间取出一个点,将其横坐标作为随机偏转的角度,根据观察,假设行走时的偏转波动值在-30°~30°之间,按照假设生成的云滴分布如图 6所示,图 7是虚拟角色的偏转示意图,图中$G{x_1}$为虚拟角色偏转角度的量化值,$G{y_1}$为确定度,给定取值每次实现的$G{y_1}$都不是一个确定的值,而是带有稳定特征的随机波动,从而将随机性与模糊性统一。

图 6 行走方向云${G_1}$ ($Ex$=0,$En$=10,$He$=0.4)
Fig. 6 Walking direction cloud ${G_1}$ ($Ex$=0, $En$=10, $He$=0.4)
图 7 偏转示意图
Fig. 7 Deflection diagram

图 8(a)是未加正态云模型的虚拟角色行走轨迹,可以看出行走方向几乎没有变化,图 8(b)是加入正态云模型的虚拟角色行走轨迹,可以看出行走方向有明显变化(黑线表示虚拟角色行走轨迹)。

图 8 虚拟角色行走轨迹示意图
Fig. 8 Schematic diagram of the virtual character walking track((a) no cloud model; (b) plus cloud model)

4.3 虚拟角色社交距离和朝向的不确定性

人与人交流的过程中会遵循一定的社交距离,但是社交距离会根据人们之间的熟悉度不同而有所变化,假设其在2~3.7 m之间波动,按照假设生成的云滴分布如图 9所示,实现的社交距离效果如图 10所示,图中$G{x_2}$为虚拟角色社交距离的量化值,$G{y_2}$为确定度。

图 9 社交距离云${G_2}$($Ex$=3,$En$=0.3,$He$=0.4)
Fig. 9 Social distance cloud ${G_2}$ ($Ex$=3, $En$=0.3, $He$=0.4)
图 10 虚拟角色社交距离示意图
Fig. 10 Schematic diagram of virtual character social distance ((a) initial state; (b) the first encounter, 3.64 meters apart; (c) the second encounter, 2.10 meters apart)

图 10(a)表示两个虚拟角色未检测到对方的初始状态,图 10(b)是第1次相遇时两个虚拟角色的社交距离为3.64 m,图 10(c)是两个虚拟角色第2次相遇的社交距离为2.10 m。

在交流过程中虚拟角色身体朝向会有轻微的转动,而不是始终面朝对方,假设波动值在-15°~15°之间,按照假设生成的云滴分布如图 11所示,实现的交流过程中身体朝向的效果如图 12所示,图中$G{x_3}$为虚拟角色身体朝向角度的量化值,$G{y_3}$为确定度。

图 11 身体朝向云${G_3}$ ($Ex$=0,$En$=3,$He$=0.4)
Fig. 11 Body facing the cloud ${G_3}$ ($Ex$=0, $En$=3, $He$=0.4)
图 12 虚拟角色交流示意图
Fig. 12 Virtual character exchange diagram ((a) three lines coincide; (b) body orientation change)

图 12(a)表示一开始两虚拟角色中心连线和他们各自方向的指向重合,在一定时间之后,虚拟角色身体朝向都没有发生偏转; 图 12(b)表示在一定时间之后,上方虚拟角色身体向左偏转,而下方虚拟角色向右偏转。

5 实验

5.1 虚拟角色自主行为测试

根据社交需求制作了辅助社交的严肃游戏,游戏操作环境为Windows 10,CPU主频为3.6 GHz,内存容量为12 GB,开发环境是Microsoft Visual Studio 2017和Unity 2017.2.0f3,开发语言是C#。游戏内容如图 13图 14

图 13 女用户游戏过程截图
Fig. 13 Game process screenshot of woman user
图 14 男用户游戏过程截图
Fig. 14 Game process screenshot of man user

邀请5名儿童和11名成人进行测试,将这16名参与者分成两组,实验组8人(儿童3人,成人5人),对照组8人(儿童2人,成人6人),实验组使用的是虚拟角色自主行为模型,对照组使用的是基于脚本驱动的模型,实验遵循未参与者禁止观看参与者操作的原则,保证实验结果的真实性。

游戏平均耗时是指实验结束后统计两组完成场景探索任务消耗时间的平均值,交互平均次数是用户与场景中所有虚拟角色的交互次数的平均值。

首先是实验组中儿童与对照组中儿童的结果对比,如表 2所示。

表 2 游戏平均耗时与交互平均次数对比(儿童)
Table 2 Comparison of the average time-consuming and interactive average times(children)

下载CSV
实验组 对照组
游戏平均耗时/s 293.24 372.94
交互平均次数(取整) 2 0

接下来是实验组中成人与对照组中成人的游戏平均耗时与交互平均次数对比,如表 3所示。

表 3 游戏平均耗时与交互平均次数对比(成人)
Table 3 Comparison of the average time-consuming and interactive average times(adult)

下载CSV
实验组 对照组
游戏平均耗时/s 209.49 247.85
交互平均次数(取整) 5 2

表 2表 3中的数据可以看出,有自主行为的虚拟角色可以帮助减少用户探索场景的时间,并且可以促进用户与虚拟角色的交流,而脚本驱动的虚拟角色则相反。

5.2 虚拟角色行为表现不确定性测试

利用虚拟角色行为表现的确定性模型和不确定性模型构建两种虚拟角色行为表现,制作了游戏视频片段,分别对比虚拟角色行走方向变化、社交距离变化和交流身体朝向变化的自然性,视频的上部为确定性模型,下部为不确定性模型,实验截图如图 15所示。

图 15 交流身体朝向变化对比
Fig. 15 Exchange body orientation change

邀请了13名志愿者参加实验,实验遵循未参与者禁止观看参与者操作的原则,保证实验结果的真实性,在实验之后,参考文献[25]制作了评价量表,参与者分别为3组对比行为表现的自然性打分,0表示差、1表示可以接受,2表示好,根据打分得到如表 4所示的各对比项平均分值。

表 4 各对比项平均分(保留1位小数)
Table 4 Average score of each comparison item(keep a decimal)

下载CSV
确定性模型 不确定性模型
行走方向变化自然性 0.9 1.7
社交距离变化自然性 0.7 1.8
交流身体朝向变化自然性 0.7 1.5

由于最高分为2,最低分为0,所以本文规定大于1.7分为优秀,大于1.5分表示良好,大于1.2分表示合格,小于1.2分表示不合格。

表 4数据可知,在行走方向变化自然性中,确定性模型的虚拟角色得分为不合格,而不确定性模型的虚拟角色得分为优秀;在社交距离变化自然性中,确定性模型的虚拟角色得分为不合格,而不确定性模型为优秀;在交流身体朝向变化自然性中,确定性模型得分为不合格,而不确定性模型为良好。

总体来看,虚拟角色行为表现的不确定性模型比确定性模型更优,且用户认可度更高。

6 结论

虚拟角色的行为建模对于提升严肃游戏的用户体验感至关重要,以往的行为表现大多采用常规的确定性信息处理技术,使得虚拟角色的行为表现较为单一。面向社交训练的严肃游戏需要虚拟角色的行为更加丰富,用于模拟社会情境下的人类交互行为。由于人类行为表现充满不确定性,不适合用传统的确定性处理方法。

本文提出了社交训练严肃游戏中的虚拟角色行为表现的不确定性模型,并测试了此方法的有效性,具体实现了虚拟角色的双通道感知,更真实地模拟出虚拟角色的视觉和听觉,通过行为树算法结合模糊集与正态云模型,对虚拟角色的动机、情绪的强度进行计算,对虚拟角色行走方向、社交距离、交流时身体朝向进行模拟,实现了不确定的行为表现。

本文在虚拟角色行为模型的设计方面存在一些主观判断,如决策层中的动机模块,动机阈值由设计者决定,如果通过机器学习方法,可能会得出更合适的阈值,这方面值得探索。另外,由于实验样本数量有限,得出的结论具有局限性。

参考文献

  • [1] Schuller B W, Dunwell I, Weninger F, et al. Serious gaming for behavior change:the state of play[J]. IEEE Pervasive Computing, 2013, 12(3): 48–55. [DOI:10.1109/MPRV.2013.54]
  • [2] Annetta L A. Video games in education:why they should be used and how they are being used[J]. Theory Into Practice, 2008, 47(3): 229–239. [DOI:10.1080/00405840802153940]
  • [3] Tan J L, Goh D H L, Ang R P, et al. Learning efficacy and user acceptance of a game-based social skills learning environment[J]. International Journal of Child-Computer Interaction, 2016, 9-10: 1–19. [DOI:10.1016/j.ijcci.2016.09.001]
  • [4] Ochs M, Sabouret N, Corruble V. Simulation of the dynamics of nonplayer characters' emotions and social relations in games[J]. IEEE Transactions on Computational Intelligence and AI in Games, 2009, 1(4): 281–297. [DOI:10.1109/TCIAIG.2009.2036247]
  • [5] Tu X Y. Artificial Fish: Artifical Life for Computer Animation Beijing: Tsing hua University Press, 2017: 17-20[M]. [涂晓媛, 著.人工鱼——计算机动画的人工生命方法.北京: 清华大学出版社, 2001: 17-20.]
  • [6] Liu D L, Li L L. New improved artificial fish swarm algorithm[J]. Computer Science, 2017, 44(4): 281–287. [刘东林, 李乐乐. 一种新颖的改进人工鱼群算法[J]. 计算机科学, 2017, 44(4): 281–287. ] [DOI:10.11896/j.issn.1002-137X.2017.04.058]
  • [7] Nguyen T H D, Carstensdottir E, Ngo N, et al. Modeling warmth and competence in virtual characters[C]//Proceedings of the 15th International Conference on Intelligent Virtual Agents. Delft, The Netherlands: Springer, 2015: 167-180.[DOI: 10.1007/978-3-319-21996-7_18]
  • [8] Parenthoen M, Tisseau J, Morineau T. Believable decision for virtual actors[C]//Proceedings of 2002 IEEE International Conference on Systems, Man and Cybernetics. Yasmine Hammamet, Tunisia: IEEE, 2002, 3: 6.[DOI: 10.1109/ICSMC.2002.1176023]
  • [9] Drevs F. How patients choose hospitals:using the stereotypic content model to model trustworthiness, warmth and competence[J]. Health Services Management Research, 2013, 26(2-3): 95–101. [DOI:10.1177/0951484813513246]
  • [10] Tian Z H, Zhao L, Jia Y. Research on modeling action with uncertain results based on probability interval[J]. Computer Science, 2010, 37(1): 201–203, 207. [田尊华, 赵龙, 贾焰. 基于概率区间的不确定性动作建模研究[J]. 计算机科学, 2010, 37(1): 201–203, 207. ] [DOI:10.3969/j.issn.1002-137X.2010.01.047]
  • [11] Liu W B, Zhou L, Xing W W, et al. Modeling realistic behaviors and movements of autonomous virtual humans[J]. Transactions of Beijing Institute of Technology, 2010, 30(10): 1189–1193. [刘渭滨, 周亮, 邢薇薇, 等. 自主虚拟人真实感行为与运动建模的研究[J]. 北京理工大学学报, 2010, 30(10): 1189–1193. ] [DOI:10.15918/j.tbit1001-0645.2010.10.028]
  • [12] Liu Z, He S H, Chai Y J. An emotion cognitive appraisal model for virtual characters[J]. Pattern Recognition and Artificial Intelligence, 2011, 24(2): 160–167. [刘箴, 何少华, 柴艳杰. 一种虚拟角色的情绪认知评价模型[J]. 模式识别与人工智能, 2011, 24(2): 160–167. ] [DOI:10.3969/j.issn.1003-6059.2011.02.002]
  • [13] Pacella D, López-Pérez B. Assessing children's interpersonal emotion regulation with virtual agents:the serious game Emodiscovery[J]. Computers & Education, 2018, 123: 1–12. [DOI:10.1016/j.compedu.2018.04.005]
  • [14] Milne M, Powers D, Leibbrandt R. Development of a software-based social tutor for children with autism spectrum disorders[C]//Proceedings of the 21st Annual Conference of the Australian Computer-Human Interaction Special Interest Group: Design: Open. Melbourne, Australia: ACM, 2009: 265-268.[DOI: 10.1145/1738826.1738870]
  • [15] Wu Y P, Du Y Z, Ye Y D. Real-time emotion-integrated crowd path planning[J]. Journal of Image and Graphics, 2015, 20(9): 1262–1274. [吴云鹏, 杜沅泽, 叶阳东. 融入情绪模型的人群实时路径规划[J]. 中国图象图形学报, 2015, 20(9): 1262–1274. ] [DOI:10.11834/jig.20150914]
  • [16] Liu Z, Pan Z G. Research on motivation-driven based autonomous emotion model for virtual human[J]. Journal of Image and Graphics, 2009, 14(5): 773–781. [刘箴, 潘志庚. 虚拟人动机驱动的自主情绪模型研究[J]. 中国图象图形学报, 2009, 14(5): 773–781. ] [DOI:10.11834/jig.20090504]
  • [17] Zadeh L A. Fuzzy sets[J]. Information and Control, 1965, 8(3): 338–353. [DOI:10.1016/S0019-9958(65)90241-X]
  • [18] Gomes T C S, Falcão T P, de Azevedo Restelli Tedesco P C. Exploring an approach based on digital games for teaching programming concepts to young children[J]. International Journal of Child-Computer Interaction, 2018, 16: 77–84. [DOI:10.1016/j.ijcci.2017.12.005]
  • [19] McCrae R R, John O P. An introduction to the five-factor model and its applications[J]. Journal of Personality, 1992, 60(2): 175–215. [DOI:10.1111/j.1467-6494.1992.tb00970.x]
  • [20] Ortony A, Clore G L, Collins A. The Cognitive Structure of Emotions[M]. Cambridge: Cambridge University Press, 1988.
  • [21] Moerland T M, Broekens J, Jonker C M. Emotion in reinforcement learning agents and robots:a survey[J]. Machine Learning, 2018, 107(2): 443–480. [DOI:10.1007/s10994-017-5666-0]
  • [22] Sekhavat Y A. Behavior trees for computer games[J]. International Journal on Artificial Intelligence Tools, 2017, 26(2): #1730001. [DOI:10.1142/S0218213017300010]
  • [23] Rabin S. Game AI Pro: Collected Wisdom of Game AI Professionals[M]. Fu L X, Jiang A Q, Wang X, et al, trans. Beijing: Publishing House of Electronics Industry, 2017: 42-48. [Rabin S.游戏人工智能[M].付凌霄, 江岸栖, 王迅, 等译.北京: 电子工业出版社, 2017: 42-48.]
  • [24] Li D Y, Liu C Y. Study on the universality of the normal cloud model[J]. Engineering Science, 2004, 6(8): 28–34. [李德毅, 刘常昱. 论正态云模型的普适性[J]. 中国工程科学, 2004, 6(8): 28–34. ] [DOI:10.3969/j.issn.1009-1742.2004.08.006]
  • [25] Feng S, Tan A H. Towards autonomous behavior learning of non-player characters in games[J]. Expert Systems with Applications, 2016, 56: 89–99. [DOI:10.1016/j.eswa.2016.02.043]