[ieee 2010 brazilian symposium on games and digital entertainment (sbgames) - florianpolis, santa...

11
Increasing the Efficiency of NPCs using a Focus of Attention based on Emotions and Personality Alberto Signoretti * , Antonino Feitosa , Andr´ e M. Campos , Anne M. Canuto and Sergio V. Fialho * Computer Science Dept. - DI UERN, Natal-RN-Brazil [email protected] Computer Science and Applied Mathematics Dept.- DIMAp UFRN, Natal-RN-Brazil [email protected]; {andre,anne}@dimap.ufrn.br Automation and Computer Engineering Dept. - DCA UFRN, Natal-RN-Brazil [email protected] Abstract —Several games nowadays try to improve the player immersion by representing human behav- ior as real as possible, generally using agent technolo- gies to model non-player characters (NPCs). How- ever, agent-based behavioral models representing the existing complexity of, for instance, a decision-making for a real life situation can become a very intensive computing task. For this reason, real-time simulation- based games may benefit from optimizations pro- duced on how NPCs react to changes in the simu- lated game world. This paper presents an approach for speeding up the decision-making of autonomous agents representing NPCs of a game. The optimiza- tion is reached by bounding the agent perception to a subset of all agent surrounding elements, which contains only the most important elements for the agent at current time. In other words, the agent is modeled as having“focus of attention”. The attention focus represented in this work is based on theories of emotions and personality. Keywords -Real-time Strategy; Agents; Human be- havior emulation; Emotional characters I. Introduction In the last years, the use of models of emotions and personality has been largely explored in games using agent technologies to model game characters. Most of the works on this subject aim to make them more believable [1], making them able to exhibit realistic behaviors or human-like emotional expressions. Most of these works have dealt with the concepts of emotions and personality as a way to improve or to better represent the NPC believability and decision-making process, i.e. they have been focused on how an agent can trigger an action (or an expression) based on its current emotional state and/or its personality profile. However, emotions and personality do not impact only on how individuals make a decision. They also impact on the whole cognitive system of individuals, starting from their perception mechanism. Emotions and personality make people to get different perceptions from the same situation. Also, emotions also make an individual to get different percep- tions when facing the same situation at different times. The ability of a NPC to answer differently according to its traits and/or current state is one of the major feature in advanced games. For instance, the FIFA Soccer game has provided this feature since its beginning version. However, the traits modeled in FIFA game impact specifically on the quality of the NPC’s actions (for instance, the quality of a hit to the goal), but not on how they reason. Consider now a game with goal-oriented NPCs, referred hereafter as agents, able to dynamically construct their plans, as the game F.E.A.R does [2], and the need of introducing the ability of different agents to answer differently for a same situation. In this case, agents characteristics would drive not only the quality of their actions but also the planning path used to find them. Depending on how the latter is modeled, the number of possibilities can quickly explode, compromis- ing the capacity of the game to answer at real-time. The current work tries to optimize this issue without changing the reasoning/planning procedure. It just put a filter before the NPC planning process, where the game elements surrounding the NPC are filtered according to its individual characteristics, i.e. we endow the agent of attention focus. Thus, the current paper presents a perception-filtering strategy useful for goal-oriented agents and how it can interact within a game environment. Our approach is based on the fact that human perception does not take into consideration all the information that is available in a complex environment. On the contrary, part of it is left aside and forgotten, and the attention is focused on what is considered important. Our hypothesis is that, when the agent attention is focused on only some aspects, the efficiency of its planning process improves. The proposed mechanism uses emotions and personality as parameters 2010 Brazilian Symposium on Computer Games and Digital Entertainment 978-0-7695-4359-8/10 $26.00 © 2010 IEEE DOI 10.1109/SBGAMES.2010.27 171 2010 Brazilian Symposium on Games and Digital Entertainment 978-0-7695-4359-8/10 $26.00 © 2010 IEEE DOI 10.1109/SBGAMES.2010.27 171

Upload: sergio-v

Post on 14-Mar-2017

215 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: [IEEE 2010 Brazilian Symposium on Games and Digital Entertainment (SBGAMES) - Florianpolis, Santa Catarina, TBD, Brazil (2010.11.8-2010.11.10)] 2010 Brazilian Symposium on Games and

Increasing the Efficiency of NPCs using a Focus of Attentionbased on Emotions and Personality

Alberto Signoretti∗, Antonino Feitosa†, Andre M. Campos†, Anne M. Canuto† and Sergio V. Fialho‡∗Computer Science Dept. - DI

UERN, [email protected]

†Computer Science and Applied Mathematics Dept.- DIMApUFRN, Natal-RN-Brazil

[email protected]; {andre,anne}@dimap.ufrn.br‡Automation and Computer Engineering Dept. - DCA

UFRN, [email protected]

Abstract—Several games nowadays try to improvethe player immersion by representing human behav-ior as real as possible, generally using agent technolo-gies to model non-player characters (NPCs). How-ever, agent-based behavioral models representing theexisting complexity of, for instance, a decision-makingfor a real life situation can become a very intensivecomputing task. For this reason, real-time simulation-based games may benefit from optimizations pro-duced on how NPCs react to changes in the simu-lated game world. This paper presents an approachfor speeding up the decision-making of autonomousagents representing NPCs of a game. The optimiza-tion is reached by bounding the agent perception toa subset of all agent surrounding elements, whichcontains only the most important elements for theagent at current time. In other words, the agent ismodeled as having“focus of attention”. The attentionfocus represented in this work is based on theories ofemotions and personality.

Keywords-Real-time Strategy; Agents; Human be-havior emulation; Emotional characters

I. Introduction

In the last years, the use of models of emotions andpersonality has been largely explored in games usingagent technologies to model game characters. Most of theworks on this subject aim to make them more believable[1], making them able to exhibit realistic behaviors orhuman-like emotional expressions. Most of these workshave dealt with the concepts of emotions and personalityas a way to improve or to better represent the NPCbelievability and decision-making process, i.e. they havebeen focused on how an agent can trigger an action(or an expression) based on its current emotional stateand/or its personality profile. However, emotions andpersonality do not impact only on how individuals makea decision. They also impact on the whole cognitivesystem of individuals, starting from their perceptionmechanism. Emotions and personality make people to

get different perceptions from the same situation. Also,emotions also make an individual to get different percep-tions when facing the same situation at different times.

The ability of a NPC to answer differently according toits traits and/or current state is one of the major featurein advanced games. For instance, the FIFA Soccer gamehas provided this feature since its beginning version.However, the traits modeled in FIFA game impactspecifically on the quality of the NPC’s actions (forinstance, the quality of a hit to the goal), but not on howthey reason. Consider now a game with goal-orientedNPCs, referred hereafter as agents, able to dynamicallyconstruct their plans, as the game F.E.A.R does [2], andthe need of introducing the ability of different agentsto answer differently for a same situation. In this case,agents characteristics would drive not only the qualityof their actions but also the planning path used to findthem. Depending on how the latter is modeled, thenumber of possibilities can quickly explode, compromis-ing the capacity of the game to answer at real-time.The current work tries to optimize this issue withoutchanging the reasoning/planning procedure. It just puta filter before the NPC planning process, where the gameelements surrounding the NPC are filtered according toits individual characteristics, i.e. we endow the agent ofattention focus.

Thus, the current paper presents a perception-filteringstrategy useful for goal-oriented agents and how it caninteract within a game environment. Our approach isbased on the fact that human perception does not takeinto consideration all the information that is available ina complex environment. On the contrary, part of it is leftaside and forgotten, and the attention is focused on whatis considered important. Our hypothesis is that, whenthe agent attention is focused on only some aspects, theefficiency of its planning process improves. The proposedmechanism uses emotions and personality as parameters

2010 Brazilian Symposium on Computer Games and Digital Entertainment

978-0-7695-4359-8/10 $26.00 © 2010 IEEE

DOI 10.1109/SBGAMES.2010.27

171

2010 Brazilian Symposium on Games and Digital Entertainment

978-0-7695-4359-8/10 $26.00 © 2010 IEEE

DOI 10.1109/SBGAMES.2010.27

171

Page 2: [IEEE 2010 Brazilian Symposium on Games and Digital Entertainment (SBGAMES) - Florianpolis, Santa Catarina, TBD, Brazil (2010.11.8-2010.11.10)] 2010 Brazilian Symposium on Games and

for driving the agent attention focus [3]. In addition,it can also make the behavior of the agent, as a gamecharacter, more realistic and believable. The proposedagent attention focus is structured as: 1) spatial focus,which is related to the contents the agent is interestedin, and 2) temporal focus, which is related to how manyperceptive elements the agent is able to perceive in orderto keep at real-time frame ratings.

This paper is divided into five sections and it isorganized as follows. Section 2 describes the researchworks related to the subject of this paper. The proposedagent architecture is completely described in Section 3.In Section 4, the development methodology and testsprocedures are described. Finally, Section 5 presents thefinal remarks of this paper and the future works.

II. Related Work

A. Regarding Attention Focus

The human emotional aspects were integrated in Mor-gado’s work [4] to achieve better results for the reasoningprocess of agents situated in complex environments likethe realtime ones. At this work, physiologic models(where the emotions are connected with internal alter-ations of an adaptive organism) and appraisal models(where the emotions are extracted from evaluations -appraisals - of events or actions) are connected to im-plement the proposed architecture. However, humor andpersonality are disregarded. Morgado’s model representsthe agent goals and the environment cognitive elementsas periodic functions with a fixed frequency. The agentinterest level for a cognitive element is determined by theresonance between the cognitive element frequency andthe agent objectives ones. As a result, only the elementswith a resonance relation higher than a minimum level ofinterest are perceived. According to Morgado, a deple-tion barrier is created establishing the agent attentionfocus. The resonance physic law is used to create theagent focus of attention in Morgado’s proposal. The fo-cus description would be a burdensome task for dynamicenvironments as the ones found in computational games.The definition of a set of frequencies that correctlyresonate with a set of objectives of a large game scenario,with groups of different NPCs can not be considered asan easy work.

Another work related to attention focus which can beapplied to computer games was proposed by Sarmento[5]. He modeled a complex environment based on a foreston fire[6] where a group of emotional agents have tocooperate in order to extinguish the fire. The agentemotional state is created by a rule based analysis ofthe agent’s cognitive experience. The emotional state isstored in the emotional accumulators that are dynam-ically updated. Therefore, the agent decision process isinfluenced by the emotional accumulators. For instance,

a wind blast causes an accidental high fire exposurewhich increases the value of the fear accumulator. Asa result, the agent first action is to escape from the fireand then, for a period of time, the agent’s action decisionprocess will only choose the most conservative availableactions. After this first reaction, based on the updatedemotional accumulators, different kinds of reactions willappear. Sarmento’s proposal defines a two level reason-ing process. The first one deals with the informationrelated to the agent’s survival objectives and the secondone with the deliberation about the other environmentinformation. In other words, the agent attention focusis settled in an indirect way by the two levels of thesplit reasoning process, since the first level treats onlya portion of available information. For this reason, theattention focus can not be dynamically changed duringthe simulation time. This is can be a very restrictivelimitation for computer games that requires continuousenvironment changes.

B. Regarding emotions, humor and personality

The use of emotion models in the previous works wasjustified as an attempt to improve the behavior of agentssituated in complex and dynamic environments as thereal time ones. In other words, it can be considered asa solution problem approach. The next works introducethe use of emotions, personality and humor models toachieve a human like behavior.

Emotion, personality and humor models are used tosimulate human behavior in systems like ALMA (ALayred Model of Afect) proposed by Gebhard [7], BA-SIC (Believable Adaptable Socially Intelligent Characterfor Social Presence) proposed by Romano at all [8],SIMPLEX (Simulation of Personal Emotion Experience)proposed by Kessler at all [9] and the proposal ofKasap at all [10]. All these proposals use the emotionand personality models relations defined by Mehrabian[11][12] in a similar way as a manner to create a charactercapable of emulating a human conversation interaction.This character is capable of showing surprise or fear anda set of other emotions including a mood driven behaviorinitialized by the agent’s personality.

Merabian describes a general framework for explainingand measuring individual differences in temperamentbased in three nearly independent traits: pleasure (P),arousal (A) and Dominance (D), so called PAD. Thisframework implements a 3-dimensional mood space thatis used for modelling the humor for the conversationalagent in the above mentioned systems. Mehrabian alsodescribes the relationship between the PAD model andthe OCC emotion model [13][14], as well as the relation-ship between the BigFive personalty model [15]apud [16].This last relationship is also used in the above mentionedproposals in order to model the agent’s emotion and

172172

Page 3: [IEEE 2010 Brazilian Symposium on Games and Digital Entertainment (SBGAMES) - Florianpolis, Santa Catarina, TBD, Brazil (2010.11.8-2010.11.10)] 2010 Brazilian Symposium on Games and

personality.

III. Behavioral architecture

The proposed architecture uses a focusing processin the agent’s perception of the environment cognitiveelements. The focus of attention produces a filteredsubset of environment cognitive elements that allows anoptimization in the planning and reasoning process.

Real-time game scenarios can be very complex. In thissituation, complexity is understood as a large quantityof information that is necessary in order to model theenvironment where the agent is situated. Consider, forinstance, a game similar to Total War games series[17] where the units (represented as agents) are notreactive, but goal-driven instead. Despite the fact thatit is possible to design agents with only partial visionon the environment, the quantity of elements perceivedby each agent (unit) can be very large. However, agentsdecision-making are limited by some factors such as time,power and computational capacity. Regarding these lim-itations, an optimized decision process is hard to becarried out considering all the available information.

The implementation of a perception attention focusreduces the set of available cognitive elements to a subsetcontaining only the most important elements for thecontext where the agent is situated. This focus defineswhich significant information is needed to be perceived.In our approach, the information selection is structuredas a spatial focus, which is related to the contents theagent is interested in, and as a temporal focus, which isrelated to how many cognitive elements the agent is ableto perceive in a fixed discrete time. The latter can be setaccording to the processing capacity to keep a real-timeframe rate.

At this architecture, the evaluation of the cognitive el-ements of the environment (actions, events and objects)causes reactions that change the agent emotional stateand its level of knowledge (set of facts containing theagents beliefs). The agent’s emotional state is responsiblefor driving the operation of the attention focus wheresome environmental elements are disregarded. In otherwords, the agent forgets some elements and ignores oth-ers in the environment, like a real person normally does.This feature can also improve the believability of thegame characters as they can behave more realistically.

A. Architecture Model

The agent architecture is composed by two structures:1) the Core Agent, that is responsible for the reason-ing, action planning and action selection, and; 2) theAgent Behavior, that is responsible for perceiving theenvironment and executing the action. The behavior isselected according to the actions chosen for execution by

the Core Agent. The architecture showed in Figure 1 isfragmented in the following modules:

• Sensing and filtering: module responsible for theperception of environmental cognitive elementswhich is performed by the sensors set. The perceivedelements are filtered by a process that works underthe spatial and temporal focus definitions; therefore,a subset of elements is created and sent to the CoreAgent;

• Focus: module that defines the spatial and temporalfocus;

• Belief Base: module where the agent beliefs aboutthe environment and about itself are stored. Thesebeliefs are consequences of environmental percep-tions or conclusions of the agent reasoning process;

• Reasoning and Planning: module responsible forcreating and evaluating a full detailed plan. Thelatter is a hierarchical tree of possible actions andits evaluation process is restricted by the temporalfocus. This tree is created using the facts saved inthe belief base. The outcome of this process is a setof actions to be performed by the agent, similar towhat the F.E.A.R. agent architecture does [2];

• Emotion, humor and personality: module responsi-ble for establishing the agent’s emotional state. Thiscomponent is introduced over the others, since itdoes not save or process information, but it ratherestablishes the way in which the other componentscarry out the whole process [18][19];

• Action: module responsible for the action executionprocess.

B. Emotion, humor and personality

Models of emotion, humor and personality are used inthis proposal in order to achieve a more effective agent’sbehavior, specially in complex game environments. Inthe same direction, it is important to notice that timeis very significant for the human temperament emer-gence, because there is a temporal relationship amongemotions, humor and personality. Emotion has a tran-sitory duration, that is, it is a short-term expression.In its turn, humor is a medium-term expression andfinally, personality is a long-term expression [7][10][9].Thus, our approach model three layers that structurethe agent behavior: emotions, humor, and personality.The selection of the models for implementing each levelwas carried out considering recognized computationalimplementations already done [20][7][10][9]. As a result,the following models were selected: the OCC appraisalmodel for emotions [13][14], the PAD model [11] forhumor and the BigFive model [15]apud [16] for modelingpersonality.

The OCC model defines the agent’s emotional state asan evaluation of the environment situation considering

173173

Page 4: [IEEE 2010 Brazilian Symposium on Games and Digital Entertainment (SBGAMES) - Florianpolis, Santa Catarina, TBD, Brazil (2010.11.8-2010.11.10)] 2010 Brazilian Symposium on Games and

Figure 1. Agent architecture model

some aspects as: events, actions (done by other agents)and objects. The relationship between these aspects aredescribed in a hierarchy that classifies 22 emotions typesand, for each emotion type, a list of variables affectingintensity is provided. The PAD model explains thatthe agent’s mood can be expressed in terms of threetraits Pleasure (P), Arousal (A) and Dominance (D).For Mehrabian [11] these three traits (also called dimen-sions) creates a 3D mood space. The implementationof the PAD mood space uses axes ranges from -1.0 to1.0 for each dimension and an agent’s mood state isdefined by a tuple with the values for each dimension(< +−P,+−A,+−D >). Finally, the Big Five modelis a common schema that specifies the personality by fivebasic traits: openness, conscientiousness, extroversion,agreeableness and neuroticism. The combination of thesetraits explains the general (affective) agent’s behavior.

The Figure 2 shows the relationship between theemotion, humor and personality models. The person-ality model is responsible for the establishment of theagent’s basic humor, and this process is based on therelationship described by Mehrabian [13] who statesthat individual personality traits define a basic humorstate for the agent. The agent basic humor state isthe start reference for the PAD model and the statewhere the agent’s humor returns when the appraisal ofenvironmental cognitive elements stops [7]. The changes

in the agent’s humor state, which occur in the PAD3D space, are influenced by the emotions appraisal donethrough the OCC model and their valence values. Thelatter means that an appraised emotion has an attachedvalue that indicates if the perception is good or bad andits intensity. In other words, any perception done by theagent about an action or an event of the environmentcauses an emotion appraisal that can be positive (goodemotion) or negative (bad emotion). The positive emo-tions cause changes in the agent PAD 3D space towarda position that represents a good mood state and thenegative emotions cause changes toward a position thatrepresents a bad mood state. The variation in the PADspace determines the values of some parameters of theagent architecture such as spatial focus, temporal focus,reasoning time and the beliefs base.

Considering the agent reasoning process in the Figure2, the set of preferences used to assist the decisionabout available solution options are defined by the agentpersonality. The preferences make the agent reasoningand planning process more realistic and more flexible[18]. The personality is also related to the velocity ofemotions intensity decay. In other words, as pointed outby Kasap [10]“for people who are more neurotic, positiveemotions disappear more quickly and negative emotionsdisappear more slowly. The opposite is true for peoplewith more stable personalities”.

174174

Page 5: [IEEE 2010 Brazilian Symposium on Games and Digital Entertainment (SBGAMES) - Florianpolis, Santa Catarina, TBD, Brazil (2010.11.8-2010.11.10)] 2010 Brazilian Symposium on Games and

Figure 2. Emotion, humor and personality relationship

The elements of the agent architecture are influencedby the humor state variation as seen below (Figure 2).

• Spatial focus: the spatial focus can change accordingto the agent humor state. That is, considering twoagents executing the same behavior, the agent inbad mood may prioritize its attention in differentenvironmental elements that the agent in goodmood.

• l limiter: the quantity of environmental elementsthat an agent can perceive is defined by the tem-poral focus thorough the l limiter. The outcomeof the filtering process over the set of perceivedelements using the spatial and temporal focus isan ordered list with a size of l elements. The llimiter is influenced by the agent’s humor state, sothat an agent in a good mood can perceive moreenvironmental elements than an agent in a badmood.

• k limiter: some environmental information that doesnot belong to the agent spatial focus list can be-come important in some specific occasions, and inthese occasions it has to be considered in the agentreasoning process. For example, an alarm is notimportant when it is silent, but it brings up avery important information when it goes off and,therefore, it must be considered in the agent rea-soning process. The k limiter establishes a numberof elements inside the list defined by the filteringprocess to be used by this kind of information.For example, if the k limiter is equal 0.8, twenty

percent of the filtered list belongs to this kind ofinformation.

C. Environmental cognitive elements

The environmental information is collected by thesensing module and converted into a format that canbe processed by the agent’s internal process. Theseelements, called perceptive elements, are represented ina [0, 1] ∈ R scale. The perceptive elements have someassociated tags that are used as meta-information todrive the agent’s reasoning process.

In an instant of time t, the sensing module receives aset of perceptive elements E(t) = {e1(t), e2(t), ..., en(t)}from the environment , where each element ei(t) is atuple ei(t) = 〈di(t), Ri,4di(t)〉 such that:

• di(t) is the value associated to the information inthe instant of time t;

• Ri is a set of tags associated to the perceptiveelement eit;

• 4di(t) is the variation in the value of di(t) in theinstant of time t since the last perception.

The set of tags associated to the perceived element isa tuple Ri = 〈Ai, V i〉, such that:

• Ai is a set of aspects of The Spatial Focus theperceived element ei(t) belongs;

• V i is a set of tags informing how to process thevariation of di(t).

For each perceptive element ei(t), the value betweentwo consecutive game loop iterations may suffer a pos-itive variation (4+, when the value of di(t) has in-

175175

Page 6: [IEEE 2010 Brazilian Symposium on Games and Digital Entertainment (SBGAMES) - Florianpolis, Santa Catarina, TBD, Brazil (2010.11.8-2010.11.10)] 2010 Brazilian Symposium on Games and

creased) or a negative variation (4−, when the valueof di(t) has decreased). Each agent may have its ownset of thresholds to define if a perceptive element varia-tion is significant to be analyzed. A positive threshold,4di(t)+, is used to evaluate the positive variations, anda negative one, 4di(t)−, is used to evaluate the negativevariations. The variation of a perceptive element valueis defined as 4di(t) = di(t)− di(t− 1).

Environmental elements of information can be ana-lyzed according to three different possibilities of varia-tion, such that:

• V i = {+}: the perceptive element is importantwhen 4di(t) > 0 and |4di(t) | ≥ 4di(t)+;

• V i = {−}: the perceptive element is importantwhen 4di(t) < 0 and |4di(t) | ≥ 4di(t)−;

• V i = {+−}: the perceptive element is importantwhen 4di(t) < 0 and |4di(t) | ≥ 4di(t) −or 4di(t) > 0 and |4di(t) | ≥ 4di(t)+.

The threshold values can be implemented as a functionof the agent’s emotional state but, normally, they arestatic values defined during the agent’s design phase.

D. Spatial Focus

The spatial focus is responsible for establishing thelevel of importance for the environmental informationcollected by the sensing module. The environment ischaracterized according to a set of attributes calledaspects. The interest related to each aspect of the en-vironment is signed by a value in a [0, 1] ∈ R scaleand it represents the level of interest (LoI) of the agentover that aspect. Based on the LoI, the agent createsa priority order over the perceptive elements of the listE(t).

The spatial focus is defined as a function f : S → R,where S = {s1, s2, · · · , sn} is the set representing theaspects of the environment the agent is interested in.Considering that the total agent interest as 100%, thesum of the interest over all the aspects considered bythe agent achieves the value 1. Each perceptive elementbelongs to one or more of the aspects of the environmentand, for those that belong to a more than one aspect ofthe environment, the agent has to consider all the LoIsto define his interest over that element.

The agent’s interest over a set of perceptive elementE(t) is defined by the function I(t) : E(t) → R, thatmaps each perceptive element ei(t) to a set of values ofinterest. The latter values are based on the aspects ofspatial focus where the element ei(t) belongs.

The priority order over the list E(t) mentioned aboveis defined considering the relationship between the spa-tial focus and the perceived elements list. For instance,considering a spatial focus with three aspects of interest,S = {s1 = 0.7, s2 = 0.1, s3 = 0.2}, the first stepsplits the E(t) list in three parts, each one with the

elements of the original list that belong to the relativeaspect, i.e. the first list is related to the aspect s1 andcontains l ∗ k ∗ s1 elements that belong to the aspect s1ordered by the di(t) values and so on. The second stepjoins the three sub-lists in a single one containing l ∗ kperceptive elements related to the spatial focus that areused by the agent’s reasoning process. The remainingelements join the set of perceptive elements that donot belong to any aspects considered in the agent’sspatial focus. These elements may become important insome specific occasions, when they have to be consideredin the agent reasoning process. They are ordered bythe di(t) values in what we named as exception ordi-nation. The latter is defined as following: consideringtwo perceptive elements e1(t) = 〈d1(t), R1,4d1(t)〉 ande2(t) = 〈d2(t), R2,4d2(t)〉, e1(t) �E e2(t) if only ifEx(e1(t)) ≥ Ex(e2(t)), where Ex : E(t) → R is thefunction:Ex(ei(t)) = max(Ex+(ei(t)), Ex−(ei(t))), where:

Ex+(ei(t)) =

{4di(t) if 4+ ∈ V i and Sit10 otherwise

Ex−(ei(t)) =

{|4di(t)| if 4− ∈ V i and Sit20 otherwise

where:Sit1 = 4di(t) > 0 and |4di(t) | ≥ 4di(t)+Sit2 = 4di(t) < 0 and |4di(t) | ≥ 4di(t)−

The exception order allows the agent to perceive theelements of the environment that do not belong to thespatial focus and that had the major value variationsince the last perception.

E. Temporal Focus

The temporal focus is responsible for defining thequantity of perceptive elements which are used by theagent’s reasoning process. This quantity varies accordingto the time and the agent’s emotional state. In otherwords, the reasoning process uses an ordered list contain-ing a fraction of the total perceptive elements receivedfrom the environment by the sensing module.

The set U of perceptive elements used by the reasoningprocess is formed by joining two sets: M , which isordered using the interest defined by the spatial focusand N , which is ordered using the exception ordination.The U ’s cardinality is defined by the l limiter combinedwith the k limiter (both explained before). Both limitersdefine the distribution of perceptive elements betweenthe M and N sets inside U , so that the M ’s cardinalityis k% of l and, in consequence, N ’s cardinality is (l−k)%of l. In other words, for k = 0.8 and l = 100, the cardi-nalities of M and N are 80 and 20 elements respectively.

The l limiter is a function of the time and the agent’semotional state, and as a result this factor depends ofthe agent’s state of humor and it assumes different valueswhen the agent is in a bad mood or in a good mood. This

176176

Page 7: [IEEE 2010 Brazilian Symposium on Games and Digital Entertainment (SBGAMES) - Florianpolis, Santa Catarina, TBD, Brazil (2010.11.8-2010.11.10)] 2010 Brazilian Symposium on Games and

approach is used by B. G. Silvermnan [21][22] when hedescribes the relation between the effectiveness of theagent’s decisions and the agent’s state of stress throughan inverted ”U” curve.

The assumption used in this work is that the quantityof perceptive elements considered for reasoning is di-rectly related to the effectiveness of the agent’s decisions,and the agent’s state of humor is directly related to theagent’s state of stress. As a result, the l function wasempirically defined as a pseudo Gaussian distributiondefined as following: l(x) = e−δ(x−µ)

2

. The parametersδ and µ are adjusted during the agent’s design phaseand the value of x is derived from the agent’s state ofhumor. This derivation is implemented using an aver-age between the distance of the point representing thecurrent agent’s state of humor in PAD-3D space, andthe positions representing the extreme relaxed mood(+P−A+D = +1−1+1) and the extreme anxious mood(−P +A−D = −1+1−1). These extreme points in thePAD-3D space were selected because of their similarityto the stress level concept used by Silverman [21][22].

IV. Development methodology and testingprocedures

In this work the reasoning efficiency of agents situatedin environments with a large amount of perceptive ele-ments is observed. The aim of this proposal is to compareagents with and without perception attention focus onthis kind of environment.

An exploratory and experimental research was themethodology used for developing and adapting the archi-tecture of agents based on emotion, humor and personal-ity. Therefore, the classical approach of developing sim-ulating models was used, which results in a cyclical andinteractive process. During this process, several proto-types were developed and tested, exploring progressivelythe possibilities of interaction between the agents andthe environment. Finally, the prototypes were adjustedaccording to the testing results and a new modeling-executing-validating process started.

A. Testing Scenario

Prior to test the proposal in a production game, wechoose to test it at a prototype scenario. The prototypescenario is an 2D grid game environment where the sizeof its cells is defined a priori. This environment simulatesin a movie theater room with several characters insideand a fire suddenly occurs. Some restrictions were placedon this scenario. Although the individuals, representedby agents, can occupy the same space, other agentsare considered obstacles to achieve the main agent’sobjective, that is to find an emergency exit to guaranteeits self safety.

Figure 3. Prototype scenario for testing the architecture.

The movie theater room has some emergency exitsand audible and visual fire alarms and the suited agentsare aware of the elements that are present in the room.During the simulation, one or more fire outbreaks startin the room, all of them with radially expansion from theorigin point. The fire that naturally causes an increase inthe temperature also brings the smoke as a consequence,which propagates in the same way as the fire. When thefire starts, all the alarms go off. The agent’s death canoccur by fire exposure or smoke exposure. The startingtime and the quantity of fire outbreaks are parametersdefined in the beginning of the simulation. The positionof the fire origin points are defined by the system as freecells randomly chosen.

In this testing scenario, we modeled the agent per-ception through four perception senses: audition, smell,vision, and touch feeling. Thus, agents can perceivesurrounding noises (for instance, the fire alarm), smoke(even if the alarm has not yet started, the agent is ableto smell fire smoke), see exits, fire and other agents on itsdirection, as well as to feel the surrounding temperature(if it is hot or not). Regarding the temperature, the agentcan only perceive the 8 cells that surround its currentposition. It is not possible to perceive anything beyondthat, although the agent can infer from other perceivedelements (fire, for instance) and from its belief base.

The path the agent takes to reach the exit is decidedin a step by step utility-based reasoning process, whereeach step consumes a BDI reasoning cycle. The decisiontakes into account the cost for all the possible steps. Thecost calculation considers the elements perceived in thecells, the distance of the elements to the agent, the beliefbase and the current emotional state.

177177

Page 8: [IEEE 2010 Brazilian Symposium on Games and Digital Entertainment (SBGAMES) - Florianpolis, Santa Catarina, TBD, Brazil (2010.11.8-2010.11.10)] 2010 Brazilian Symposium on Games and

For this scenario, the agent’s spatial focus was createdusing three aspects of the environment: danger, exits,and agents.

The choice of this scenario was based in some im-portant requirements for gaming goal-oriented agentsusing emotion as a part of the perception and reasoningprocess. These requirements are:

• Large number of game objects for planning in realtime;

• Characters with multiple goals;• Multiple agent interaction;• Real world problem proximity.

These requirements are important to effectively testemotion-cognition interactions because simple environ-ments do not reveal the need for emotional mechanisms.As Sarmento points out [5]: “Simpler environments oragents with fewer goals will simply not need emotionalmechanisms because possible problems may be solvedwith the help of simpler, more straight-forward mecha-nisms”.

A complex environment is also necessary to answerone question before the use of the emotional mechanismsin the proposal architecture: is it possible to achieve amore effective decision process using a perception focusof attention? Normally, in this kind of environment it isexpected that not all the available information is relevantfor a correct and effective decision process. As a result, itis necessary to answer the question about the attentionfocus and, if the answer is affirmative, to establish thebest value of the l parameter for the chosen environment.

In the next section the testing procedures and theresults that answers affirmatively the above mentionedquestion, as well as the definition of the best value forthe l parameter are shown. These results also bring amore natural behavior when the agent clearly points outits preferences and seems to forget some environmentalelements.

B. Comparative analysis

1) Testing procedures: The tests were divided intotwo groups, one to define the best parameters for theattention focus in the perception process (perceptionfocus), and another one to evaluate the efficiency of theperception focus regarding the execution time and thequantity of alive agents after the simulation.

In the first group of tests, the experiments weredivided into several stages in order to define the bestparameters for the perception focus. The first stagefound the best values for the agent’s interest in eachaspect of the spatial focus, that is, the best interest valuefor the aspects danger, exits and agents. The secondstage uses the best values defined in the first stage toestablish the best value for the l parameter. Finally, the

third stage uses all the best values found before to definethe best value for the k parameter.

In the second group of tests, several experiments wereconducted with two type of samples. In the first type, allagents were executed without attention focus, i.e. theycould use all information the environment give to themfor their decision making. In the second type, all agentswere executed using the focusing mechanism describedin the paper. The decision making mechanisms of bothagents are identical. They used a utility-based approachto evaluate the best path to follow in order to reach theexit avoiding fire. Both agents also take into account allthe information they receive in order to calculate thebest surrounding cell to step in. The difference betweenthem is the existing filter in the focused agent prior tosending data to decision making procedure.

All the experiments were made with fifteen situatedagents. The agents were distributed in fifty differentways, composing is this way fifty test scenarios. Eachscenario was executed with focused agents and withunfocused agents, and repeated about fifty times foreach one since environment changes (for instance, fireexpansion) followed an indeterministic approach.

2) Testing results: As previously mentioned, the ex-periments were conducted through three different stagesin order to define the best values for the agent perceptionmechanism. Firstly, the values of l, k, 4+, and 4− werearbitrarily fixed and the degree of agent interests werechecked, i.e the values for the tags danger, exits, andagents. The values were initially fixed as follow: l = 2560(which is maximum of perception given the testingenvironment), k = 0.8, 4+ = 0.1 and 4− = 0.1. Theinitial results for the agent interests were danger = 0.3,exits = 0.7, and agents = 0. These values representthe best average of alive agents after all the simulationsconsidering the given fixed values.

In the second stage, the best values of agent interestwere used to define the best value for the l parameter(which was arbitrarily fixed in the previous stage). Theresults considering the value of l and the average ofalive agents are showed in the figure 4. In that figure,it is possible to see that the interval between 600 and1500 represents proximately a stabilized value for theaverage of alive agents and, for values of l under 600, theperformance of simulation is very unstable. Observingthe figure 5, where the average time of simulation (inseconds) vary in function of l, it is possible to see thatthe time of simulation grows proportionally to the valueof l until the value l = 1500. On this value, the agentstarts to perceive all the environmental elements and thesimulation time increase very rapidly.

Finally, the third stage of experiments defines the bestvalue of the k value using the best parameters valuesdefined in the first two stages of experiments. The results

178178

Page 9: [IEEE 2010 Brazilian Symposium on Games and Digital Entertainment (SBGAMES) - Florianpolis, Santa Catarina, TBD, Brazil (2010.11.8-2010.11.10)] 2010 Brazilian Symposium on Games and

Figure 4. Average of alive agents regarding l parameter

Figure 5. Average of simulation’s time regarding the l parameter

are showed in the figure 6, where it is possible to see thatthe best configuration of the agent’s perception focusis achieved using a proportional relation between the land k parameters. In other words, the best results areachieved when the agent’s focus of attention uses ele-ments from spatial focus as well as elements that belongto the exception ordination list. In the testing scenario,the proportion of elements belonging to the exceptionlist can vary from 10% (k = 0.1) to approximately 80%(k = 0.8).

Considering these three stages of experiments, the bestparameters for the agent using the attention focus are:l = 600, danger = 0.3, exits = 0.7, agents = 0.0 and

Figure 6. Average of alive agents regarding k parameter

Measurements Without A.F. With A.F.Average 9.500 10.500ADeviation 5.194 2.843Steps 42.750 48.167SDeviation 9.231 3.020Time 47.651 13.544TDeviation 17.634 5.018

Table IThe final comparative results

k = 0.8. After these definitions, the tests with the agentswithout the perception focus were executed.

The final comparative results between agents withand without the attention focus are showed in the tableI where: the Average line represents the average ofthe amount of alive agents after the simulation, theADeviation line represents the standard deviation ofthe Average, the Steps line represents the average ofthe simulation’s steps in each simulation process, theSDeviation line represents the standard deviation ofthe steps, the Time line represents the average of theexecution’s computational time in seconds and, finally,the Tdeviation represents the standard deviation of time.

With the the standard deviation values showed intable I, it is possible to see that the experiments usingagents with the attention focus results in more stablesimulations. Regarding the objective of representing hu-man behavior as real as possible, these results are veryimportant since stability of a behavior is expected to bea fundamental aspect of the agent behavior’s plausibil-ity. Also regarding the efficiency, the experiments withthe attention focus produced simulations with a majornumber of steps, but with almost 30% more efficient(considering time response). The latter result is veryimportant considering the approach for speeding up thedecision-making of NPCs.

V. Final remarks and Future works

The architecture proposed in this work shows a wayof designing goal-oriented agents that are able reducethe amount of time spent to take a decision withoutlosing efficacy. This approach is useful for games toprovide better frame rates for game characters designedwith goal-oriented architectures. Moreover, it takes intoconsideration the use of emotional and personality fac-tors, which can improve the characters’ believability.Furthermore, the structure of the spatial focus makesit possible to define changes in the agent’s attention. Itresults in a completely different behavior which does notrequire alterations in the agent’s reasoning or planningprocess. As a consequence, it is expected that a set ofcompletely different agents can be easily designed.

The current work was aimed in defining a new ap-proach for filtering perceptive elements for agents and

179179

Page 10: [IEEE 2010 Brazilian Symposium on Games and Digital Entertainment (SBGAMES) - Florianpolis, Santa Catarina, TBD, Brazil (2010.11.8-2010.11.10)] 2010 Brazilian Symposium on Games and

also to construct a testbed environment where the pro-posed mechanism could be evaluated. Once evaluated,next steps include a better encapsulation of the overallarchitecture. This new work aims to facilitate the useof the mechanism in different applications. More specifi-cally, we intent to reuse the approach in the developmentof a serious educational game. In the game, the playercompete against another human player in a realtimestrategy game, and uses slave NPCs as advisers. TheNPCs should be able to infer possible consequences fromthe changing environment in realtime. Thus, a filteringapproach is welcomed.

A future work also aims to investigate the use of theproposed filtering mechanism in games by exploring theparallel nature of GPUs. As the filter is a process sep-arated from the agent decision-making, we expect thatthe perception focus could be implemented using somethreads of the GPU. In this possible approach, the GPUcalculates the priority of the perceptive elements whilethe agent processes data from a previous environmentstate.

Beside the test of applying the architecture in a realgame engine, other issues we also wish to address includehow emotional and personality parameters can reallyreinforce character believability and how to tune up thespeed of a decision-making in order increase believability.

Acknowledgements

This work was partially supported by the Brazil-ian National Research Council (CNPq) under number479629/2008-0.

References

[1] E. Bevacqua, E. de Sevin, and C. Pelachaud, “Buildingcredible agents: behaviour influenced by personality andemotional traits,” in Proc. of International Conferenceon Kansei Engineering and Emotions Research 2010(KEER2010), Paris - Franca, Mar. 2010, p. 123.

[2] J. Orkin, “Three states and a plan: The a.i. of f.e.a.r,”in Game Developers Conference, San Jose, Nov. 2006.

[3] A. R. Damasio, Descartes Error - Emotion, Reason andthe Human Brain. New York, NY: Harper Perennial,1995.

[4] L. G. Morgado, “Integracao de emocao e raciocınio emagentes inteligentes,” Ph.D. dissertation, Faculdade deCiencias da Universidade de Lisboa, Lisboa, Portugal,Mar. 2006.

[5] L. M. Sarmento, “An emotion-based agent architecture,”Master’s thesis, Faculdade de Ciencias da Universidadedo Porto, Porto, Portugal, Mar. 2004.

[6] E. Oliveira and L. Sarmento, “Emotional valence-basedmechanisms and agent personality,” Lecture Notes InComputer Science, vol. 2507, pp. 771–780, 2002.

[7] P. Gebhard, “Alma - a layered model of affect,” inProceedings of The fourth international joint conferenceon Autonomous agents and multiagent systems. Utrecht- the Netherlands: ACM, Jul. 2005, pp. 29 – 36.

[8] D. M. Romano, G. Sheppard, J. Hall, A. Miller, andZ. Ma, “Basic: A believable adaptable socially intelli-gent character for social presence,” in Proceedings ofThe 8th Annual International Workshop on Presence(PRESENCE’05). London - UK: Springer, Sep. 2005.

[9] H. Kessler, A. Festini, H. C. Traue, S. Filipic, M. Weber,and H. Hoffmann, Affective Computing: Focus on Emo-tion Expression, Synthesis and Recognition. InTech Ed-ucation and Publishing, 2008, ch. SIMPLEX: Simulationof Personal Emotion Experience.

[10] Z. Kasap, M. B. Moussa, P. Chaudhuri, and N. M.Thalmann, “Making them remember: Emotional virtualcharacters with memory,” IEEE Computer Graphics andApplications, vol. 29, no. 2, pp. 20–29, Mar. 2009.

[11] A. Mehrabian, “Pleasure-arousal-dominance: A generalframework for describing and measuring individual dif-ferences in temperament,” Current Psychology, vol. 14,no. 4, pp. 261–292, 1996.

[12] A. Mehrabian(a), “Analysis of the big-five personalityfactors in terms of the pad temperament model,” Aus-tralian Journal of Psychology, vol. 48, no. 2, pp. 86–92,1996.

[13] A. Ortony, G. Clore, and A. Collins, The CognitiveStructure of Emotions. New York, EUA: CambrigeUniversity Press, 1998.

[14] A. Ortony, Emotions in Humans and Artifacts. MITPress, 2003, ch. On making believable emotional agentsbelievable.

[15] R. R. McRae and P. T. Costa, The five-factor modelof personality: Theoretical perspectives. The GuilfordPress, 1996, ch. Toward a new generation of personalitytheories: Theoretical contexts for the five-factor model.

[16] D. R. D. da Silva, “Atores sinteticos em jogos serios:Uma abordagem baseada em psicologia organizacional,”Ph.D. dissertation, Universidade Federal de Pernambuco- Centro de Informatica, Recife, Pernambuco, Dec. 2009.

[17] C. Assembly, “Total war series,” Creative Assembly, webaddress: http://www.totalwar.com/, last visit: august2010, 2010.

[18] A. Campos, F. Dignum, V. Dignum, A. Signoretti,A. Magaly, and S. Fialho, “A process-oriented approachto model agent personality,” in Proceedings of The 8thInternational Conference on Autonomous Agents andMultiagent Systems - AAMAS2009, Budapest - Hungary,2009, pp. 1141–1142.

[19] A. M. Campos, F. Dignum, and V. Dignum, “From indi-viduals to social and vice-versa,” in Engineering Societiesin the Agents World IX, A. Artikis and G. Picard, Eds.Berlim - Germany: Springer Berlin / Heidelberg, 2008,pp. 264–279.

180180

Page 11: [IEEE 2010 Brazilian Symposium on Games and Digital Entertainment (SBGAMES) - Florianpolis, Santa Catarina, TBD, Brazil (2010.11.8-2010.11.10)] 2010 Brazilian Symposium on Games and

[20] M. Burkitt and D. M. Romano, “The mood and memoryof believable adaptable socially intelligent characters,”in Proceedings of Intelligent Virtual Agents, 8th Interna-tional Conference, IVA 2008. Tokyo - Japan: Springer,Sep. 2008.

[21] B. Silverman, G. Bharathy, , J. Cornwell, andK. O’Brien, “Human behavior models for agents insimulators and games: part ii: gamebot engineering withpmfserv,” Presence: Teleoperators and Virtual Environ-ments, vol. 15, no. 2, pp. 163 – 185, 2006.

[22] B. G. Silverman, M. Johns, J. Cornwell, and K. O’Brien,“Human behavior models for agents in simulators andgames: part i: enabling science with pmfserv,” Presence:Teleoperators and Virtual Environments, vol. 15, no. 2,pp. 139–162, 2006.

181181