Formatting Instructions for Authors - limsi

0 downloads 0 Views 351KB Size Report
Following (DuyBui, 2004; Sehaba et al., 2007), three .... type of emotion, the solidarity decreases (Figure 3). ... policeman and the Burglar triggered emotions. 1.
Modeling the Dynamics of Non-Player Characters' Social Relations in Video Games

Magalie Ochs, Nicolas Sabouret and Vincent Corruble

LIP6 - Université Pierre & Marie Curie, France

Abstract

player.

Building credible Non-Playing Characters (NPCs) in games requires not only to enhance the graphic animation but also the behavioral model. This paper tackles the problem of the dynamics of NPCs social relations depending on their emotional interactions. First, we discuss the need for a dynamic model of social relations. Then, we present our model of social relations for NPCs and we give a qualitative model of the inuence of emotions on social relations. We describe the implementation of this model and we briey illustrate its features on a simple scene.

In many games, this is done to some extent

through some relatively simple means. an alignment (good vs.

evil, loyal vs.

For example, chaotic) can

constrain available actions and induce specic types of reactions from NPCs (for example in Baldur's Gate). In other games, the Player Character's actions change its reputation in the virtual world, aecting indirectly the attitude of NPCs such as guards or merchants, up to a point where, respectively, after enough misdeeds, he/she could be attacked at rst sight, or be oered less favorable deals.

Though interesting, these means re-

mains relatively crude from the cognitive science standpoint. Various results from psychology can be used to elaborate a ner representation of social relations. However, most of the models available in the literature are

Introduction

static in nature. In this paper we propose a model of

One of the main drives for the Game AI community has

social relations between synthetic characters that is dy-

been to develop synthetic characters, including Non-

namic  social relations will evolve over time  and

Player Characters (NPCs), that are more credible and

connected to an emotional model. The methodology is

engaging. Beyond the physical dimension (graphics, an-

to infer as much as possible from the psychology liter-

imation, etc.), the emotional dimension of NPCs is usu-

ature so that the implementation of the model requires

ally seen as key to preserve the immersive quality of a

only a small number of parameters to be set. The ap-

virtual world. Though many aspects of the game can

proach can be used to compute the evolution of social

be scripted, the player's actions cannot and therefore

relations over an entire scenario, or also within a single

they (or rather the Player Character's actions) need to

scene such as a dialog.

have visible and believable impacts on the other NPC's actions, through the emotions they generate.

Model-

This paper is organized as follows. cus related work.

First, we dis-

Secondly, we introduce a computa-

ing emotions credibly leads to NPCs who appear more

tional representation of Non-Player Characters' social

responsive, reactive to the player's playstyle.

How-

relations. Thirdly, we describe an emotion-based model

ever, NPC's emotional reactions should follow their own

of the dynamics of NPC's social relations. To conclude,

logic, which is in part character dependent.

we present the implementation of the proposed model

For in-

stance, a character's emotional reaction should vary de-

and test it with a single dialog.

pending on the character's personality. This line of research has been explored in previous work, including in (Sehaba et al., 2007). Another important issue is the impact of social relations on the NPCs emotional reactions. This also is key since in many games, especially role-playing games and adventure games, the player has to impersonate a specic role in a complex story. Social relations are therefore somewhat pre-dened by the scenario, but the evolution of the story and of social relations needs to take into account the choices of the

c 2008, Association for the Advancement of ArCopyright ticial Intelligence (www.aaai.org). All rights reserved.

Related work

Several researchers have proposed to model the social context of virtual characters to increase their believability. For instance, (Rousseau and Hayes-Roth, 1998) suggest a social-psychological model including personality, emotions, and attitudes. The character's behavior is computed based on its personality and attitudes. In (Walker et al., 1997) and (André et al., 2004), the linguistic style of dialog between virtual character is determined according to social variables (social distance and power) (Walker et al., 1997) and user's emotions (An-

dré et al., 2004). (Gratch, 2000) proposes a social layer

2001). Based on this literature, in our model, we con-

that manages communication and biases plan genera-

sider these four social variables to represent a social

tion and execution in accordance with a social context.

relation.

In (Prendinger and Ishizuka, 2001), social lter pro-

Note that social relations are directed and not neces-

grams are proposed to constrain a character's expres-

sarily symetric. For instance, the fact that a character

sion of emotion depending on the social context (rep-

i

resented through social power and social distance), the

that

virtual character's personality, and its emotions. (Bick-

Ishizuka, 2001; Bickmore and Cassell, 2001), the social

more and Cassell, 2001) propose to use the character's

relations are dened from the point of view of a given

social relations with the user to identify the appropriate

virtual character.

likes another character

j

likes

i.

j

does not necessarily mean

In our model, like in (Prendinger and

subject to discuss with the user. As it turns out, the models of social context in existing work are generally

static.

Researchers have mainly

Representation of NPC's social relation

In our dynamic model of social relations, the relation

focused on the impact of social context on virtual char-

of a NPC

acter's behavior.

of

Few researchers propose a model of

i,

i

at time

with a character

t

j,

from the point of view

is formally represented as follows:

the dynamics of social context. (Prendinger et al., 2002) propose functions to model the dynamics of a character's attitude and familiarity toward another character according to the valence of emotions triggered during the interaction, i.e. their positive (e.g. joy) or negative (e.g. fear) aspect. However, this model does not take into account the distinct impacts of dierent types of emotions.

Research shows that emotions of same va-

lence but dierent types (like shame and distress) may have dierent impacts on social relations (Shiota et al., 2004; de Rivera and Grinkis, 1986). In this paper, we go further by proposing a model of the dynamics of character's social relations based on emotions, in checking those of the character and those expressed by its interlocutor.

 likingi,j (t)  dominancei,j (t)  social_relationi,j (t) =  f amiliarityi,j (t)  solidarityi,j (t) 

with:

• likingi,j (t) ∈ [−1, 1] represents the degree of liking i has for j at time t. The closer the value is to −1 (resp. 1), the more i dislikes (resp. likes) j ; • dominancei,j (t) ∈ [−1, 1] corresponds to the power that i thinks it can exert on j at time t. The closer this value is to −1 (resp. 1), the more i feels submissive to (resp. dominant on) j ; • f amiliarityi,j (t) ∈ [0, 1]

Non-Player Characters' Social Relations

In computational models of social characters, social relations are generally represented by a nite set of variables. Each of them characterizes a specic dimension of a social relation between two agents (virtual or human). No consensus exists on the type and number of variables required to model social relations. However, the literature seems to outline four main social vari-

degree of liking

(Isbister, 2006; Rousseau

and Hayes-Roth, 1998; Prendinger and Ishizuka, 2001)

1

one has for another ; the Rousseau

and

dominance

Hayes-Roth,

1998;

(Isbister, 2006;

Prendinger

and

Ishizuka, 2001), i.e. the power that an agent can exert on another agent; the sell, 2001), a.k.a.

solidarity

(Bickmore and Cas-

social distance (Brown and Levin-

son, 1987), is sometimes used (Walker et al., 1997; André et al., 2004), which can be dened as the degree of like-mindedness or having similar behavior dispositions (e.g.

i of the information that i j . A value close to 1 means that i feels familiar with j (in terms of condentiality of the information transmitted). If i feels unfamiliar with j , the value is equal to 0; has transmitted to

Background

ables: the

represents the average de-

gree of condentiality for

similar political membership, family, re-

ligions, profession, gender, etc.) sell, 2001); the

(Bickmore and Cas-

f amiliarity may be used to characterize

• solidarityi,j (t) ∈ [0, 1]

represents the degree of like-

mindedness or having similar behavioral dispositions

i thinks to have with j . The closer the value 1, the more i thinks to share equivalent goals, beliefs, and values. The value 0 represents a situation in which i does not think to share same goals, beliefs or values with j . that

is to

As stated above, social relations are not necessarily symmetric, i.e. :

∃i, j social_relationi,j (t) 6= social_relationj,i (t) The next section presents our emotion-based model of the dynamics of social relation. The Emotion-based Dynamics of Social Relations

the type (private or public) and number of information

Research shows that, during an interaction, one's emo-

exchanged between two agents (Bickmore and Cassell,

tions and those of his interlocutor may lead to a change

1

The term attitude is sometimes used to refer to the degree of liking.

in their social relations (Ortony, 1991; de Rivera and Grinkis, 1986; Shiota et al., 2004). In this paper, we do not focus on the emotion model, which has been widely

studied in the litterature, but rather on the dynamics of the social relations. Thus, we use the well-known OCC model (Ortony, 2002) to represent the NPC's emotional state, which considers the following pairs of emo-

joy/distress, hope/f ear, admiration/reproach, pride/shame. Each pair can be represented by a variable whose value is in [−1, 1]. Thus, an emotion is rep4 resented by a vector V ∈ ([−1, 1]) . tions:

Following (DuyBui, 2004; Sehaba et al., 2007), three

Figure 1: Impacts of emotions on liking

dierent emotional vectors are dened in our model:



the emotions triggered by an event (whose values depend on both the triggering event and the NPC's personality);

• •

1996), anger is associated with a high degree of dominance, and distress and fear to a low degree. Consequently, we can model that emotion of pride or reproach

the emotional state of the NPC (which depends on

of

the entire aective experience of the character);

value that

2 the emotions expressed by the NPC . They can dier

tion of fear, distress, admiration, or shame of

from the emotional state since a character may decide to display an emotion dierent from its felt emotions (Prendinger and Ishizuka, 2001).

j

i

j

induces an increase in the dominance

thought to have on

j.

Conversely, an emo-

infers a decrease in the dominance

have on

i

i

caused

thought to

j.

In (Knutson, 1996), expression of sadness or fear reanger a high value. Finally, some types of emotions expressed by someone aect the dominance value of the

In the following, we analyze separately the dynamics of each variables of a social relation of a NPC

j

by

caused by

ects a low value of dominance and the expression of

Impacts of emotions on social relations

interaction with a character

i

i

during an

according to their emo-

person who perceives it. pression by

j

We can model that the ex-

of an emotion of fear or distress induces

an increase in the dominance of

i. Consequently, if the i and j with the same j will not change (Fig-

tions. If no event occurred, we suppose that the social

event triggers fear or distress for

relation does not evolve. In the contrary case, the in-

intensity the dominance of

tensities of the emotions triggered by the event are used

ure 2).

i

on

to update the social variables.

Liking.

(Ortony, 1991) shows that the degree of liking

one has for another depends on the emotions induced by the latter. Therefore, one's positive emotions triggered during an interaction with someone else may induce an increase in the degree of liking the former has for the latter. Conversely, negative emotions caused by another one may generate a decrease in the degree of liking (Ortony, 1991). However, an emotion triggered during an interaction with another person but not caused

Figure 2: Impacts of emotions on dominance

by the latter is supposed to have no impact on the degree of liking. For instance, let's imagine a situation in which Jack informs John about a very sad event, John will not necessarily like John less than before. Thus, we model that a positive emotion of

i

an increase in the degree of liking versely, negative emotion of

i

i

has

caused by

decrease in the degree of liking

i

j induces for j . Con-

caused by

has for

j generates a j (Figure 1).

Solidarity.

According

to

(de

Rivera

and

Grinkis,

1986), negative emotions caused by another person leads to a desire to reject him.

In other words, one's

negative emotion caused by someone else induces a decrease in the solidarity value that the former had with the latter. However, the triggering of positive emotions does not modify the solidarity value.

Indeed, the at-

traction resulting from a positive emotion corresponds According to (Shiota et al., 2004; Kelt-

to a desire to give to the other (such as tenderness) or

ner and Haidt, 2001), pride emotion reects dominance

to have something the other has (such envy) (de Rivera

whereas shame corresponds to an inferior status. Given

and Grinkis, 1986).

the denition of the combined emotion of anger in the

tion of

OCC model (Ortony et al., 1988), reproach appears

solidarity that

Dominance.

to reect dominance. In the PAD model (Mehrabian,

2

A character may express several emotions at the same time.

i

caused by

i

j

We model that a negative emoinduces a decrease in the value of

thought to have with

j

(Figure 3).

As highlighted in (Keltner and Haidt, 2001), during interpersonal relations, expressed emotions reect an individual's mental state (goals, beliefs, expectations, plan, etc).

Consequently, after the occurrence

of an event, a person perceiving another one's expression of emotion similar to her own triggered emotion, may imagine that they share similar goals or values. Conversely, opposite types of emotion may reect conicting goals or values. For instance, if an event triggers joy for a person because he had the goal that this event occurred and if, following this event, his interlocutor expresses distress, he may think that the latter had the opposite goal.

Finally, we model that the congruence

between one's triggered emotion and the emotion expressed by his interlocutor will inuence the solidarity variable. An incongruence (resp. congruence) may lead

Implementation

The

of

social

relations

presented

Let

Eti (evt)

above

is

In order to make it operational,

we have dened the update function

ϕ described below.

be the vector representing the intensities

i triggered by an event Exj (t) the vector of the intensities of the emotions expressed by the character j at time t. • We rst dene the function f : of the emotions of the character

evt

occurred at time

t,

and

f : (Eti (evt), Exj (t)) → ∆SocialRelationi,j (t)

to a decrease (resp. increase) in solidarity. If the triggered emotion of

model

semi-quantitative.

i is joy or hope (and is not caused by j )

This function takes as input the NPC's triggered

j expressed emotion of the same type, the solidarity increases. On the contrary, if j expresses an opposite and

type of emotion, the solidarity decreases (Figure 3).

emotions

and

tor,

returns

and

those a

expressed vector

by

its

representing

interlocuthe

vari-

ation of the social relation given these emotions (∆SocialRelationi,j (t)).

f is increasing for each ∆SocialRelationi,j (t) with respect to each dimension of the emotional vectors Eti (evt) and Exj (t) (except for the solidarity which increases dimension of

when the emotion values are close).

This function

returns the null-vector when the emotion vectors are null.



We then dene the function

g:

g : (social_relationi,j (t), ∆SocialRelationi,j (t)) → social_relationi,j (t + 1) This function takes as input the current social relation

social_relationi,j (t)

interlocutor

and

the

of

vector

the of

NPC

the

with

social

its

rela-

tion's variation returned by the previous function Figure 3: Impacts of emotions on solidarity

(∆SocialRelationi,j (t)). cial relation. and

Moreover, research shows that solidarity inuences liking.

i

pose the an increase in solidarity of increase in the degree of liking

i

with

has for

j

induces an

g

f

returns the updated so-

is increasing and has a low slope on

1

to represent the fact that the social relation

is hard to alter when on the extremes. For instance,

Indeed, it appears that one likes more similar

persons (Smith and Mackie, 2007). Then, we can sup-

−1

g

a sinus-based function can be used.



Finally, the function

j.

ϕ

is dened as follows:

ϕ : (social_relationi,j (t), Eti (evt), Exj (t)) → social_relationi,j (t + 1) This function takes as input three vectors represent-

F amiliarity.

In the literature, emotions seem to not

have a direct impact on the familiarity (i.e.

ing respectively the current social relation of the

on the

NPC with its interlocutor, its triggered emotions, and

degree of condentiality of the information transmitted

those expressed by its interlocutor. It returns the up-

by a person).

dated social relation.

However,

research shows that one

condes more in another when the former likes the latter (Collins and Miller, 1994). Therefore, we model that the more the character likes another one the more it will transfer a condential information to it. other words,

In

the familiarity is indirectly connected

to the liking variable.

Indeed,

an increase in the

condentiality of the information transferred leads to an increase in the familiarity value.

ϕ(social_relationi,j (t), Eti (evt), Exj (t)) = g(social_relationi,j (t), f (Eti (evt), Exj (t))) Note that in our model, the triggered and expressed emotions have to be provided.

Methods to compute

triggered emotions and to update a virtual character's emotional state consistently with its personality have been proposed in previous work (Prendinger et al., 2002; Sehaba et al., 2007). Dierent existing tools could

In the next section, we present an implementation of

be used to identify the emotions expressed by the char-

the model introduced above and illustrates it through

acter's interlocutor (both human and virtual) (Picard,

an example of interaction between two characters.

1997).

Illustrative example.

To illustrate the dynamics of a

triggers hope (here, the burglar would appreciate both

NPC's social relation, we have implemented the model

to face a comprehensive policeman and to drink a cof-

and tested it with the scene described in Table 1. The

fee).

context of the scene is a police interrogation (a burglar

the probability of the event and its desirability. For in-

facing a policeman) at the police station. After a break-

stance, in the fourth sentence, receiving a cup of coee

in in a jewelery, the police arrested the burglar but the

only triggers joy with a low intensity (0.2) whereas the

loot is missing.

8th sentence triggers both joy and hope with higher in-

The policeman wants the burglar to

confess where the money and the jewels are hidden.

The intensity of the emotion depends on both

tensities. On the contrary, the recall of an undesirable past event triggers distress (e.g. in the 7th sentence, the

0

Dialog between the Burglar s policeman and the Burglar triggered emotions 1.P oliceman: The facts are

not in your favor, you know. Ten people saw you threaten the manager with a weapon 2.Burglar: So, what do you want? 3.P oliceman: You know, I'm not a bad guy...(the policeman is preparing a cup of coffee) 4.P oliceman: Do you want some coee? (the policeman oers a cup of coee to the Burglar) 5.P oliceman: ...I know that your child has been kidnapped. Same thing happened to me last year, I had to negotiate with those b*** I know what it is (expression of distress) 6.P oliceman: I want to help

you. Just tell me where you hid the money 7.Burglar: I need this money to save my child! 8.P oliceman: We have received new information about the kidnappers. We know where your kid is being kept 9.P oliceman: Tell me everything and I'm sure I can nd a solution to avoid you going to jail 10.Burglar: Ok, I'm going to tell you what really happened...

Fear=0.9

policeman speaks about the kidnapping of the burglar's child). At the beginning of the interaction,

we suppose

that the burglar is submissive related to the policeman (dominance

= −0.3)

and dislikes him (liking

= −0.5).

Figure 4 illustrates the dynamics of the burglar's social relation with the policeman.

Hope=0.2

Joy=0.2

Distress=0.7

Hope=0.6

Figure 4: Dynamics of the burglar's social relation with the policeman Let us consider for instance the third utterance (hope with intensity 0.2).

Joy=0.6, Hope=0.8

As presented in the previous sec-

tion (see Figure 1), the emotion of hope triggered by the policeman increases the degree of liking the burglar has for the policeman. Since the intensity of the emotion is rather low and since it is the only positive emotion in

Hope=0.8

Table 1: Scene between a burglar and a policeman

this event, the impact will however stay low and no signicative change will happen. On the contrary, on the 5th interaction (distress with high intensity), since the policeman is not responsible for the negative emotion (he is not the kidnapper), the event has no impact on the degree of liking. Moreover, we have a congruence of the triggered emotion and the emotion expressed by the policeman.

As shown on Figure 3, this increases

the solidarity and, by side eect, the degree of liking. In this example, the values of social relation will

The left column in Table 1 show the dialogue between the policeman and the burglar. For each action or utterance of the policeman, the right column gives the triggered emotion of the burglar and its intensity, whose computation is based on the OCC model (Ortony et al., 1988).

For instance, let us consider the third

be used to determine which information the character transfers to its interlocutor. Since the degree of liking, dominance and familiarity reach given thresholds, the burglar will nally confess where the money and the jewel are.

sentence when the policeman reassures the burglar and

Conclusion

prepares some coee. According to OCC, the prospect

In this paper, we have presented a model of the dy-

of an event that would increase the NPC's satisfaction

namics of NPC's social relations taking as inputs the

emotions triggered by the scenario and other charac-

Fall Symposium on Socially Intelligent Agents - The

ters' actions.

Human in the Loop, North Falmouth.

Our approach takes into account vari-

ous results from cognitive science and psychology, and is then implemented in a social engine that computes and updates automatically the numeric variables describing the status of social relations. One motivation behind our design choices has been to limit the complexity (number of parameters, etc.) of our engine so that, though richer than most tools currently used by the game industry, it remains usable by game designers who are not trained in psychology and work on tight development schedules. Though we have only illustrated our work on a small, short dialog corresponding to a single scene in a game, we believe that this model and the corresponding social engine as a wide applicability for video games where the social credibility of NPCs actions is key (this includes notably role-playing games and adventure games). In

Isbister, K. (2006).

Better Game Characters by De-

sign: A Psychological Approach (The Morgan Kaufmann Series in Interactive 3D Technology).

Morgan

Kaufmann Publishers Inc., San Francisco, CA, USA. Keltner, D. and Haidt, J. (2001). Social functions of emotions. In Mayne, T. J. and Bonanno, G. A., editors, Emotions: Current issues and Future Directions, pages 192213. The Guilford Press. Knutson, B. (1996). Facial expressions of emotion inuence interpersonal trait inferences. Journal of Nonverbal Behavior, 20:165182. Mehrabian, A. (1996). Pleasure-arousal-dominance: A general framework for describing and measuring individual dierences in temperament. chology:

Current Psy-

Developmental, Learning, Personality, So-

the short term, we plan to incorporate this model in

cial, 14:261292.

game AI engine, currently being developed in collab-

Ortony, A. (1991). Memories, thoughts, and emotions:

oration with industry partners, so as to enhance the

Essays in honor of George Mandler, chapter Value and

quality of dialogs with NPCs in adventure games.

emotion. Hillsdale, NJ : Erlbaum.

In

the long term, our model can serve as a support for in-

Ortony, A. (2002).

teractive storytelling. Although the example presented

agents believable. In Trappl, R., Petta, P., and Payr,

here is very simple, it contains a number of dramatic

S., editors, Emotions in Humans and Artifacts, pages

elements that are explicitely described by the game pro-

189211. MIT Press.

grammer as emotional events in our model. In previous work (Sehaba et al., 2007), we presented an emotional model and engine that computes and updates a character's emotional state taking into account the character's personality and scenario events. We believe that the combination of all these elements will provide game developers with a tool that will greatly help the design of credible NPC's in immersive environments.

On making believable emotional

Ortony, A., Clore, G., and Collins, A. (1988). Press, United Kingdom.

Picard, R. (1997). Aective Computing. MIT Press. Prendinger, (2002).

H.,

Descamps,

S.,

and

Ishizuka,

M.

Scripting aective communication with life-

like characters in web-based interaction systems. Applied Articial Intelligence Journal, 16(7-8):519553. Prendinger, H. and Ishizuka, M. (2001).

Social role

awareness in animated agents. In AAMAS, pages 270

References

277, Montréal, Canada. ACM press.

André, E., Rehm, M., Minker, W., and Bühler, D. (2004). Endowing spoken language dialogue systems with emotional intelligence. In Aective Dialogue Systems, pages 178187. Bickmore, T. W. and Cassell, J. (2001).

The

cognitive structure of emotions. Cambridge University

Rousseau, D. and Hayes-Roth, B. (1998). psychological model for synthetic actors.

A socialIn Sycara,

K. P. and Wooldridge, M., editors, International Conference on Autonomous Agents, pages 165172, New

Relational

York. ACM Press.

agents: a model and implementation of building user

Sehaba, K., Sabouret, N., and Corruble, C. (2007). An

trust. In CHI, pages 396403.

emotional model for synthetic characters with person-

Brown, P. and Levinson, S. (1987). Politeness: Some

ality. In ACII Conference.

Universals in Language Usage. Cambridge University

Shiota, M., Campos, B., Keltner, D., and Hertenstein,

Press.

M. (2004). The Regulation of Emotion, chapter Posi-

Collins, N. and Miller, L. (1994). Self-disclosure and liking: A meta-analytic review. Psychological Bulletin, 116:457475. de Rivera, J. and Grinkis, C. (1986). Emotion as relationships. Motivation and Emotion, 10:351369. DuyBui, T. (2004). Creating emotions and facial expressions for embodied agents. PhD thesis, University of Twente. Gratch, J. (2000). Socially situated planning. In AAAI

tive Emotion and the Regulation of Interpersonal Relationships, pages 127155. Lawrence Erlbaum Associates. Smith, E. and Mackie, D. (2007). Social Psychology, chapter Liking and Loving, pages 393436. Psychology Press. Walker, M. A., Cahn, J. E., and Whittaker, S. J. (1997). Improvising linguistic style: Social and aective bases for agent personality. In First international conference on Autonomous Agents, pages 96105.