pontiff - personality framework for companion characters...de decisao baseado na personalidade da...
TRANSCRIPT
“PONTiFF”
PersONaliTy Framework For Companion Characters
Ricardo Lucas Borges Seleiro Martins
Thesis to obtain the Master of Science Degree in
Information Systems and Computer Engineering
Supervisor: Prof. Carlos Antonio Roque Martinho
Examination Committee
Chairperson: Prof. Ana Maria Severino de Almeida e Paiva
Supervisor: Prof. Carlos Antonio Roque Martinho
Member of the Committee: Prof. Maria Luısa Torres Ribeiro Marques da Silva Coheur
October 2017
Acknowledgments
I would like to thank my mother and grandmother for their friendship, encouragement and caring over
all these years, for always being there for me through thick and thin and without whom this project would
not be possible. I would also like to thank my brother for his patience and understanding throughout all
these years.
I wish to thank my father for his support and understanding throughout all these years. I would also
like to thank my grandparents, aunts, uncles and cousins for their understanding throughout all these
years.
I would also like to acknowledge my dissertation supervisor Prof. Carlos Martinho for his insight,
support, patience and sharing of knowledge that has made this thesis possible.
Last but not least, to all my friends and colleagues that helped me grow as a person and were always
there for me during the good and bad times in my life. Thank you.
To each and every one of you – Thank you.
Abstract
Personality has been a key feature in the creation of companion characters for digital games. These
characters cooperate with the player to overcome obstacles and progress through the game. In this
work, we present a generic framework and a personality model inspired by Cloninger’s psychobiological
model of Temperament and Character to convey a companion character’s personality in the context of
the cooperation between the companion character and the player. Our framework is comprised of the
character’s personality, a decision system based on the character’s personality, and a tag system to keep
track of the character’s experience, knowledge, objectives, etc. We conducted a two-stage experiment
to better understand (1) if the character’s graphical design has an influence on personality reporting and
(2) if the companion’s personality conveyed by our model is adequately perceived by the player through
interaction. Our results suggest that (1) in-game behaviour is more important than first impressions
induced by the character’s design and that (2) two of our traits (Harm Avoidance and Cooperativeness)
were easily understood by the participants.
Keywords
Companion Characters, Synthetic Characters, Personality, Digital Games.
iii
Resumo
Personalidade tem sido uma caracterıstica fundamental na criacao de personagens companheiras em
jogos digitais. Estas personagens cooperam com o jogador para superar obstaculos e para progredir no
jogo. Neste trabalho, apresentamos uma abordagem computacional estuturada e um modelo de person-
alidade inspirado pelo modelo psicobiologico de Temperamento e Carater de Cloninger para transmitir a
personalidade de uma personagem companheira, no contexto de cooperacao entre a personagem com-
panheira e o jogador. A nossa abordagem e composta pela personalidade da personagem, um sistema
de decisao baseado na personalidade da personagem e um sistema de marcadores para acompanhar
a experiencia da personagem, conhecimento, objetivos, etc. O nosso teste experimental foi feito em
duas fases. Uma primeira fase para entender (1) se o design grafico do personagem tem influencia na
avaliacao da personalidade da personagem, e uma segunda fase (2) onde verificamos se a personali-
dade transmitida pelo nosso modelo e percebida adequadamente pelo jogador atraves da interacao. Os
nossos resultados sugerem que (1) o comportamento no jogo e mais importante do que as primeiras
impressoes induzidas pelo design da personagem e que (2) dois dos nossos tracos (Harm Avoidance e
Cooperativeness) foram facilmente compreendidas pelos participantes.
Palavras Chave
Personagens Companheiras, Personagens Sinteticas, Personalidade, Videojogos;
iv
Contents
1 Introduction 1
1.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Problem description and objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3 Dissertation outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2 Background and related work 6
2.1 Personality and personality models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.1.1 The Five Factor Model (FFM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.1.2 Myers-Briggs Type Indicator (MBTI) . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.1.3 Cloninger’s psychobiological model of temperament and character . . . . . . . . . 9
2.1.4 Discussion of the personality models . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.2 Personality in synthetic and companion characters . . . . . . . . . . . . . . . . . . . . . . 13
2.3 Personality in the gaming industry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.4 Chapter conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3 Solution 19
3.1 Adapted Personality Model (APM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.2 Framework overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.3 Companion’s decision making . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.4 Tag system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.5 Alternative approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.6 Chapter Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4 Implementation 28
4.1 Development Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.1.1 Starcraft 2 Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.2 Companion’s decision making . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.3 Tag system implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
4.4 Test scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
4.5 Player character . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
v
4.5.1 Player controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
4.6 Companion characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
4.6.1 Sorceress character . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
4.6.2 Companion character’s Artificial Intelligence (AI) . . . . . . . . . . . . . . . . . . . 39
4.6.3 Random character . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
4.7 Non-Player Character (NPC) characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
4.8 User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
4.9 Chapter conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
5 Evaluation and data analysis 44
5.1 Evaluation methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.1.1 Montra de Jogos (MOJO) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.1.2 Online Questionnaire . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.2 Participants demography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
5.3 Data analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
5.3.1 Questionnaire validity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
5.3.2 First impression results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
5.3.3 Companion personality perception results . . . . . . . . . . . . . . . . . . . . . . . 51
5.3.4 Results discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
5.4 Chapter conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
6 Conclusion 54
6.1 Conclusions and Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
A Online Questionnaire 59
B Project algorithm implementations 65
B.1 Decision system algorithm implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
B.2 Based trait algorithm implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
B.3 Combat value algorithm implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
vi
List of Figures
1.1 The Last Guardian companion character1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Elizabeth dancing in Battleship Bay from Bioshock Infinite2 . . . . . . . . . . . . . . . . . 3
4.1 Terrain module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.2 Trigger module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.3 Data module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.4 Test scenario layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
4.5 Player character model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
4.6 Character companion model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
4.7 Companion’s decision tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
4.8 End boss character . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
4.9 User Interface design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
4.10 Player hot bar component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
4.11 Map component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
4.12 Text component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
4.13 Objective component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
5.1 Demographic information on subjects’ gender . . . . . . . . . . . . . . . . . . . . . . . . . 48
5.2 Demographic information on subjects’ age . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
5.3 Demographic information on subjects’ dedication with videogames . . . . . . . . . . . . . 49
5.4 Demographic information on subjects’ familiarity with arpgs . . . . . . . . . . . . . . . . . 49
A.1 Questionnaire’s demographic section . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
A.2 Questionnaire’s first impression section . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
A.3 Questionnaire’s gameplay video section . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
A.4 Questionnaire’s companion’s personality assessment section . . . . . . . . . . . . . . . . 63
vii
List of Tables
3.1 Example of a decision’s option weight distribution . . . . . . . . . . . . . . . . . . . . . . . 22
3.2 Example of a normalized decision’s option weight distribution . . . . . . . . . . . . . . . . 22
3.3 Subject Table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
5.1 Cronbach’s alpha value in pair of trait items . . . . . . . . . . . . . . . . . . . . . . . . . . 50
5.2 Cronbach’s alpha value in the pair of attention items . . . . . . . . . . . . . . . . . . . . . 50
5.3 Shapiro-Wilk test results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
5.4 Wilcoxon signed test results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
5.5 Mann-Whitney U first impression results . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
5.6 Mann-Whitney U characters’ personality perception results . . . . . . . . . . . . . . . . . 52
5.7 Frequency of evaluation on the sorceress character . . . . . . . . . . . . . . . . . . . . . 52
5.8 Adjectives used for the sorceress character . . . . . . . . . . . . . . . . . . . . . . . . . . 52
viii
List of Algorithms
3.1 Pseudocode to calculate an option’s total value . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.2 Pseudocode for alternative version of the calculation of the option’s total value . . . . . . . 26
B.1 Decision making function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
B.2 BasedTraitFunction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
B.3 Chance value calculation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
ix
Listings
4.1 Information contained in an option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
x
Acronyms
NPC Non-Player Character
AI Artificial Intelligence
AoE Area-of-Effect
ARPG Action Role Playing Game
RTS Real Time Strategy
UI User Interface
MOJO Montra de Jogos
FFM Five Factor Model
MBTI Myers-Briggs Type Indicator
DGD Demographic Game Design
OCC Ortony, Clore and Collins
POV Point-of-View
FPS First Person Shooter
NS Novelty Seeking
HA Harm Avoidance
RD Reward Dependence
Pers Persistence
SD Self-Directedness
Co Cooperativeness
xi
APM Adapted Personality Model
DPS Damage-Per-Second
DOT Damage-Over-Time
xii
1Introduction
Contents
1.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Problem description and objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.3 Dissertation outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1
1.1 Motivation
Companion character are a Non-Player Character (NPC)1, that will cooperate with the player through-
out the game to surpass upcoming obstacles in order to progress. These characters have been the focus
point for some videogames.
Figure 1.1: The Last Guardian companion character2
Examples include the trilogy of games directed by Fumito Ueda and published by Sony Interactive
Entertainment: Ico, Shadow of Colossus and The Last Guardian. These games are action adventure
games, that includes some puzzle solving problems for the players to solve in order to proceed in the
game. For example, in The Last Guardian3, the player controls a young boy that awakes in a cave with
a griffin like creature, Trico as shown in figure 1.1. The player must interact with Trico to solve puzzles,
these interactions vary per player’s actions (e.g. the player by throwing barrels with food for Trico, can
make the creature move to a certain location). Meanwhile, the player will also have to care of Trico by
feeding it, and removing spears and arrows from its body. Trico’s eyes also change colour depending on
the creature mood, allowing the player to better understand Trico. This in turn, makes Trico more similar
to a pet.
1NPCs are characters that are not controlled by the player, but often controlled by scripts or an Artificial Intelligence algorithm.2https://goo.gl/7VkMPu, last accessed 10 of September 20173https://www.playstation.com/en-us/games/the-last-guardian-ps4/
2
Figure 1.2: Elizabeth dancing in Battleship Bay from Bioshock Infinite4
Elizabeth, shown in figure 1.2, from the game Bioshock Infinite5 is regarded as one of the best com-
panions in videogames in recent years. Since the start of development of Bioshock Infinite, Elizabeth
was part of the game design. Making all interactions with her surroundings thought out since the start [1].
Elizabeth has been imprisoned in a tower, since she was a child. This made her naturally curious about
the world. To help express Elizabeth’s curiosity and personality, her interactions were dynamically trig-
gered [2]. There were 3 types of interaction triggers: “Smart Terrain”, “sketches”, and “look at markers”.
“Smart Terrain” contains a set of animations to be triggered when the player was near and looking at
the terrain. “Sketches” were used when the player was a near a location to trigger a scripted sequence.
“Look at markers” are hand placed markers to make Elizabeth gaze at a certain object.
Personality has been a key feature in the creation of characters in videogames and there has been a
game series that have been explicitly using it to create diverse behaviours in their characters. Since the
first iteration of their game, The Sims Series have been using personality systems for their Sims (defini-
tion of the characters in the game). The recent iteration of the game “The Sims 4”, uses a combination
of the second game system and the third to create its personality system. Utilizing traits and aspirations
to define the characters’ personality.
Yet, personality in videogames is not limited to interactions with the player, but also via character
animations. Overwatch6 has taken this path to express their characters’ personality [3]. A common
4https://goo.gl/TDgkXy, last accessed in 10 of September of 20175https://bioshockinfinite.ghoststorygames.com/the-game6https://playoverwatch.com/en-gb/
3
approach in first person games is to leave the players’ character in a blank state to allow the players
to express their personality. However in Overwatch, a multiplayer First Person Shooter (FPS), each
character (also referred as hero in the game) has its own personality. As a result, each character stance,
design and body motion are specifically crafted to each hero, to convey the character’s personality.
1.2 Problem description and objectives
Most games rely on cutscenes to express the characters’ personality, rather than expressing it via
in-game behaviour. As such, we intend to define a personality model for companion characters in
videogames, based on a existing personality trait model. This personality model is focused for com-
panion characters in videogames. Alongside this personality model, we intend to create a personality
framework for companion characters (PONTiFF) for different videogame genres. We set as guidelines,
that both the personality trait model and PONTiFF, to be simple to implement and to understand by game
designers and game developers. The framework will consist on: allowing the game designer define a
character’s personality, via our personality model; a decision system that allows the companion charac-
ter to choose an option that is the most aligned with its personality, between N available options; and
a tag system, which allows the game designer to keep track of the character’s experience, knowledge,
objectives, etc. Since personality can be not only conveyed through interactions, we are also interested
in seeing the impact of character’s graphical model in the assessment of the personality of the character
exposed via in-game behaviour.
So, we set as objectives for this work to:
• Review the current state-of-the-art in personality models for synthetic and companion characters;
• Create a personality model for companion characters;
• Create a generic framework for companion characters that is capable of giving the illusion of a
consistent personality;
• To verify if the character’s graphical design has an influence on personality reporting.
1.3 Dissertation outline
This dissertation is organized as follows: Chapter 1 introduces the motivation and problem to be
tackled by our dissertation. In this Chapter, we also set our objectives for this dissertation. Chapter 2 will
present three personality models from psychology literature, and discuss which we selected as a basis
for our personality model for companion characters. Chapter 2 will also expose what have been done
for personality in synthetic and companion characters, in both the academic and gaming environment.
4
In Chapter 3, we will present our personality model, detail on how our framework works and utilises
our personality model.
Chapter 4 will discuss what was our selected development environment for our framework, what
scenarios were created to allow the companion character to express its personality, what companion
characters we created to test our framework, the design of the user interface, and how some of our
framework aspects were implemented due to the selected environment.
Chapter 5 discloses our evaluation methodology, and present our participants demographic informa-
tion. In Chapter 5 is where we will do all data analysis, and reflect on that data we retrieved from the
participants.
Finally in Chapter 6, we will conclude on all our work, present the limitations of our developed work
and give possible directions for future work.
5
2Background and related work
Contents
2.1 Personality and personality models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2 Personality in synthetic and companion characters . . . . . . . . . . . . . . . . . . . 13
2.3 Personality in the gaming industry . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.4 Chapter conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
6
In this chapter, we will start by reviewing the personality models from the psychology literature, then
we will look at how personality have been driving the behaviour of synthetic and companion characters,
as well the role of personality in the game industry.
2.1 Personality and personality models
Personality has been defined multiple times in several different ways [4], but per Mayer [4] these
definitions share a common view, “(a) personality is a psychological system, (b) composed of a group
of parts (c) that interact, (d) and develop, and (e) that impact a person’s behavioral expression” [4].
Furthermore, Mayer [4] defines the term personality as the “study of major psychological systems and
their interaction”.
To guide the development of our personality model for companion characters, we researched different
personality models. The two most common personality models in the psychology literature are: the Five
Factor Model (FFM) which has seen a substantial use on the implementation of computational models for
synthetic characters, and the Myers-Briggs Type Indicator (MBTI) which has been used in a wide range
of areas of application. Although across our research, we found another personality model, Cloninger’s
psychobiological model of temperament and character, which we found to be in more agreement with
the focus of this work.
2.1.1 The Five Factor Model (FFM)
The FFM is a personality trait model that defines five broad domains of traits. Each trait has a scale,
which measures different behaviours. To better understand this model, we have to understand its history.
The FFM has two historical paths [5]. The first path as described in “An introduction to the five-factor
model and its applications” [5] is the lexical approach or lexical hypothesis. “The lexical hypothesis holds
that all important individual differences will have been noted by the speakers of a natural language at
some point in the evolution of the language and encoded in trait terms; by decoding these terms, we
can discover the basic dimensions of personality” [5]. This resulted in the study of the natural language.
This study organized different trait terms into clusters of synonyms, which culminated into five groups that
may represent a personality trait. The second path was finding the consensus among various personality
questionnaires, which was considered by McCrae and John as the most important one. Since, “only a
small minority of questionnaire researchers were concerned with the issue of consensus- most preferred
to generate new scales rather than organize those already available” [5]. Most of personality traits have
been assessed through questionnaires, and these would often require some time to complete. Whereas,
the lexical researchers could identify the traits of a person, in a single interaction with the subject. By
corresponding the lexical factors and the traits measured in questionnaires, resulted in the definition of
7
the FFM. The traits defined by FFM are the following [5]:
Openness to experience a person evaluated with high openness to experience is intellectually curious,
always seeking novelty and complex experiences. This trait is measured in scales of: fantasy,
aesthetics, feelings, actions, ideas and values;
Conscientiousness a conscientiousness person is methodical and self-disciplined. Conscientiousness
is measured in scales of: competence, order, dutifulness, achievement striving, self-discipline, and
deliberation;
Extraversion an extraverted person is energetic and social, always seeking interaction with others.
Extraversion is measured in: warmth, gregariousness, assertiveness, activity, excitement seeking,
and positive emotions;
Agreeableness an agreeable person is straightforward and altruistic. It is capable of trusting in others
and expressing altruistic behaviours. Agreeableness is measured in scales of: trust, straightfor-
wardness, altruism, compliance, modesty and tender mindedness.
Neuroticism a neurotic person is emotionally unstable, with the tendency to experience negative emo-
tions, such as anxiety and depression. Neuroticism is measured in: scales of anxiety, hostility,
depression, self-consciousness, impulsiveness, and vulnerability.
2.1.2 Myers-Briggs Type Indicator (MBTI)
MBTI was initially developed by Isabel Briggs Myers and Katherine Briggs in 1942. MBTI was based
on the theory of psychological types by Carl Gustav Jung. C.G Jung theory of psychology defines
two general attitude-types: introvert and extrovert; and four function-types: thinking, feeling, sensation,
and intuition. The general attitude-types modify the four function-types: introvert thinking vs extrovert
thinking, introvert feeling vs extrovert feeling, introvert sensation vs extrovert sensation and introvert
intuition vs extrovert intuition, which results on different approaches that a person can take [6].
“In developing the Myers-Briggs Type Indicator [instrument], the aim of Isabel Briggs Myers, and
her mother, Katharine Briggs, was to make the insights of type theory accessible to individuals and
groups” [7]. This resulted in 4 pairs of dimensions, with a total of 16 combinations of preferences:
Extraversion (E) vs Introversion (I) represents the preference on the focus of the outer or inner world
[8];
Extraversion (E): an extroverted person is a person that enjoys being active and being around
other people. Tends to act before thinking;
8
Introversion (I): an introverted person likes to spend time in their inner world and reflect on
ideas inside their head, they also might prefer doing things alone or with people who they are
comfortable with. Tends to reflect before acting.
Sensing (S) vs Intuition (N) represents the preference on focusing on information coming from their
senses or through the search of patterns on information [9];
Sensing (S): a sensing person focus on the moment, focusing their attention on their five senses.
They prefer the practical side of things, using “common sense” to tackle a problem;
Intuition (N): an intuitive person likes to plan their future. Tends to be someone who prefers to
think in abstract, dissolving the information in patterns and connections to tackle the problem.
Thinking (T) vs Feeling (F) represents the preference when deciding, whether facts or personal con-
cerns have more weight than the other [10];
Thinking (T): a thinking person will put more weight into facts when deciding, and analyses pros
and cons of a specific situation;
Feeling (F): a feeling person will put more weight on personal concerns, and will take a point-of-
view approach of others in the situation when deciding.
Judging (J) vs Perceiving (P) represents the what type of lifestyle a person prefers, and transmits to
others [11].
Judging (J): a judging person tends to be orderly and organized. Seen as someone who likes
routines and planning;
Perceiving (P): a perceiving person tend to be someone spontaneous and open-minded. Seen
as someone flexible and adaptable.
2.1.3 Cloninger’s psychobiological model of temperament and character
In “A unified biosocial theory of personality and its role in the development of anxiety states” [12],
Cloninger first hypothesized three dimensions which are “genetically independent and that have pre-
dictable patterns of interaction in their adaptive responses to specific classes and environmental stim-
uli” [13]. Although these three dimensions are related with independent brain systems and stimuli, they
are functionally interconnected as shown in “A systematic method for clinical description and classi-
fication of personality variants: A proposal” [13]. Similarly to FFM, each trait is divided into smaller
characteristic behaviours allowing to detail more precisely the trait. Each temperament trait functions as
a reaction to a certain stimulus, and different levels of the trait cause different pattern reactions to that
stimulus. Later, a fourth temperament trait rose, persistence. Persistence was “originally thought to be
9
a component of reward dependence” [14]. Temperament dimensions and respective sub-scales are the
following [13–15]:
Novelty Seeking is related with the behavioural activation brain system. This temperament is respon-
sible for frequent search of adventure, and seeking potential rewards. Simultaneously, trying to
avoid monotony and possible punishment. Novelty Seeking can also result in quick tempered be-
haviour, acting on hunches for those who score above average levels. Whereas, people who score
lower than average levels of novelty seeking are slowly engaged to new activities and interests.
The people who score lower than average often think before acting. This trait is sub-scaled into
the following characteristics: Exploratory Excitability, Impulsiveness, Extravagance, and Disorder-
liness;
Reward Dependence is related with the behavioural maintenance brain system. This temperament
is responsible for the response to rewards and succorance1. People who score above average
levels of reward dependence are dependent to emotional support and seek intimacy with others.
These people are also vulnerable to social pressure, and are highly sentimental. On the contrast,
people with score lower than average of reward dependence tend to isolate from others, and
present cynical and insensitive behaviour. The people with score lower than average have better
response to practical rewards, such as money. People with low score tend to prefer activities that
are immediately rewarding. The trait is evaluated in result of: Sentimentality, Openness to warm
communication, Attachment and Openness, and Dependence;
Harm Avoidance is related with the brain’s behavioural inhibition system. This temperament functions
as a modulating influence on the previous behaviours, novelty seeking and reward dependence.
This temperament causes inhibition of exploration of unknown places or uncertain situations, and
passive avoidance of punishment and non-reward. People with high harm avoidance are almost
always fearful and insecure. These people tend to express pessimistic behaviour, and experience
high fatigability. On the opposite side, people with low score in harm avoidance may act carelessly,
independently if faced with unknown situations or situations that may result in injury. People with
low score are seen as confident and optimistic with the ability of rapid adaptation to changes.
This trait is evaluated in: Anticipatory worry and pessimism, Fear of uncertainty, Shyness, and
Fatigability;
Persistence is responsible for the determination and perseverance despite the frustration and the fa-
tigue a person might be experiencing. A person with higher than average score in persistence is
seen as ambitious, an overachiever, and a perfectionist. Although people with score below aver-
age, lack ambition and will easily abandon a task when faced with fatigue and frustration. This trait
1the act of seeking out affectionate care and social support
10
is sub-scaled according to: Eagerness of effort, Work hardened, Ambitious, and Perfectionist.
Along with the 4 temperament traits, Cloninger in “A psychobiological model of temperament and
character” [14] also described three dimensions of character. These dimensions are related with the
concept of character development, defined by Cloninger as “insight learning or reorganization of self-
concepts” [14]. Insight learning can be seen as the mechanism that develops new responses caused by
conceptual reorganization. Self-concepts are “distinguished according to the extent to which a person
identifies the self as an autonomous individual, an integral part of humanity, an integral part of the unity
of all things” [14]. The three dimension of character and their respective small order traits are [14,15]:
Self-Directedness refers to willpower and self-determination of a person. A person that scores above
average in this trait are seen as having good self-esteem, responsibility, and capable of showing
initiative when faced with an challenge. These people are also capable to define clear long term
goals and values, becoming “second nature”. Whereas, people with score lower than average
are seen as someone with lack of goals and purpose. These people are incapable of assuming
their own mistakes, and incapable to define clear goals and values. This trait is divided into:
Responsibility, Purposefulness, Resourcefulness, Self-acceptance, Enlightened second nature;
Cooperativeness determines whether a person is capable of acceptance, cooperation and identifica-
tion with others. An above than average score on this trait results in: altruistic behaviour, empathy,
and an attitude of acceptance towards others. A person that scores lower than average is seen
as: intolerant, uncaring, revengeful, and selfish. This trait is sub-scaled into: Social acceptance,
Empathy, Helpfulness, Compassion, Pure hearted consciousness;
Self-Transcendence is related with spirituality and the ability of feeling that the person is a part of
something larger than herself. This trait determines whether the person is capable of accepting
and identify herself as an essential part of the whole. A person with a higher than average score
is capable of experiencing “transpersonal” experiences and accept unavoidable events. This trait
is evaluated according to: Self-forgetful, Transpersonal identification, Spiritual acceptance.
2.1.4 Discussion of the personality models
One of the objectives of this work is to develop a personality model for companion characters. As
such, we presented 3 personality models that were considered for our work.
The first model we presented was the FFM. Although FFM has already been applied to synthetic
characters, we decided to not use it in this work. The reason that made us not choose this model was
how hard it is to relate game concepts and the dimensions of the FFM. One of the most common chal-
lenges that a player has to face in a game is combat. So, when designing a personality for a companion
11
character, it is important to define how the character will respond when faced with a dangerous situation.
More precisely, combat situations. However, FFM traits do not suggest any clear connection to help us
link combat to the FFM. Furthermore, Harm Avoidance is correlated with multiple small order traits from
the FFM [16]. To be more accurate, “Harm Avoidance is strongly positively correlated with all Neuroti-
cism facets, except for Impulsiveness (N5) and substantially negatively related to almost all Extraversion
and Openness facets” [16].
The second model we presented was MBTI. MBTI is a personality model that has seen most of his
use on corporate environment, mainly because MBTI is being used to evaluate the “basic differences
in the ways individuals prefer to use their perception and judgment” [7]. As a result, MBTI is often
used to determine whether a person is fit for a specific role in a company. Nonetheless, MBTI has
been applied in other areas. According to J. E. Barbuto [17], MBTI as been used in areas such as:
counselling, communications, career counselling, learning or education, empathetic response, creativity,
decision making, business investing, general theory of the inventory, construct validity of the scales and
convergent validity of the scales with other personality constructs. But these areas do not exclude
the gaming industry, more particularly demographic studies. The Demographic Game Design (DGD)
model2 developed by International Hobo3 is used to link players’ preferences to the players’ personality.
The DGD defines four types: conquerors, managers, wanders, and participants. Each of these types
are also divided into two categories: hardcore and causal players. For example: an hardcore conqueror
are people with predominantly an INTJ type, this means that they were evaluated in the dimensions of:
Introvert(I), Intuition (N), Thinking (T), and judging (J). The reason that led us to exclude this model for
our work, is because how hard it is to relate game concepts and the dimensions of the MBTI model. For
example, when designing a companion character, it is important to define how much cooperative the
character will be towards the player. MBTI does not define a specific trait for this trait. As matter of fact,
in a study done by K. J. Swope et al. [18], the authors hypothesized that “Individuals with a preference
for extraversion (E) in orientation and/or feeling (F) in judgment will exhibit more cooperative or other-
regarding behavior than those with preferences for introversion (I) and/or thinking (T)” [18]. To study this
hypothesis the authors asked, the participants to play one of the following one-shot games:
• a dictator game - a two player game, where player 1 was given 15$, and the option to give any
amount to the second player which has 0$;
• an ultimatum game - player 1 has to purpose a division of a fixed monetary amount between herself
and player 2. Player 2 can then either accept or reject the proposal of player 1, if accepted, both
players will receive the accorded amount but if rejected, both players will receive nothing;
• a trust game - player 1 possess 10$ and has the ability to give any amount of the 10$ to player 2,2http://onlyagame.typepad.com/ihobo/_misc/dgd_brochurefinal.pdf, accessed in 3 of September 20173http://blog.ihobo.com/about-international-hobo.html, accessed in 3 of September 2017
12
any amount sent by player 1 to player 2 is tripled;
• a prisoner’s dilemma game - in this version, two players are given the option to either choose
strategy A or strategy B. If both players choose strategy A then both players receive 5$. On the
other hand, if both players choose strategy B then both players receive 10$. If players choose
different options, the player that chose strategy A is given 20$ and the player that chose strategy
B is given 2$.
The results showed that extroverted types were more cooperative in ultimatum, trust and prisoner
dilemma, but were less cooperative in the dictator game. Whereas, feeling types were more cooper-
ative on the dictator, trust and prisoner’s dilemma game but offered less in the ultimatum game. So, the
authors concluded that the combination of extraversion and feeling types best support the hypothesis.
Unlike MBTI, Cloninger’s psychobiological model of temperament and character defines the coopera-
tiveness in a single trait.
The third model we presented was Cloninger’s psychobiological model of temperament and charac-
ter. The traits presented by this model are easier to map with game concepts than the ones presented
by MBTI and FFM. For example, Novelty Seeking can be related with exploration. Games often allow
the player to approach and reach objectives via multiple paths. These paths can be known or unknown
to the companion, allowing the companion to express his exploration or non-exploration needs. Another
trait that was already mentioned, was Harm Avoidance. Harm Avoidance can be related with combat
situations. Since, this trait functions as a modulation influence in the companion’s behaviour. Allowing
to express fear when faced with uncertainty or danger. For this reason, we selected this model for our
work.
2.2 Personality in synthetic and companion characters
Personality has been used in multiple ways to influence a character’s behaviour. From how a char-
acter expresses certain emotions, to how a character expresses its ideas.
In “Creating individual agents through personality traits” [19], Doce et al. used the FFM to cre-
ate diversity in synthetic characters. According to Doce et al. [19], personality strongly influences four
cognitive/behavioural processes: “emotions, coping behaviour, means-ends reasoning and bodily ex-
pression”. Doce et al. mapped the FFM traits to the emotions of the Ortony, Clore and Collins (OCC)
theory of emotions. More precisely, personality is used to influence a character’s emotions thresholds
and decay rate. In planning, according to Doce et al. [19], the Conscientiousness trait was the only trait
with the most relevant influence on this process. While, in coping behaviour the only trait to influence
this behaviour was neuroticism, due to lack of consensus on the remaining traits [19]. In expressivity, ex-
13
traversion and neuroticims were the selected traits to influence this behaviour. Thus, obtaining different
agents from different parametrizations of FFM traits.
“A Model for Personality and Emotion Simulation” [20] studies the connection between some per-
sonality models and the OCC model. Egges et al. [20] define a generic model for personality, mood
and emotion (PME) to define a virtual character’s behaviour. The authors use the emotional information
that is retrieved by the OCC model to update the mood and emotional state of the character. “OCC
uses goals, standards and attitudes” [20]. So to integrate personalty models, the authors relate the
OCEAN model (FFM) and the goals, standards and attitudes. Furthermore, the personality model serve
“as a selection criterion that indicates what and how many goals, structures and attitudes fit with the
personality”.
“Characters with Personality!” [21] purposes a methodology to develop virtual characters capable of
flexible and easily expandable dialogues for serious games. “Characters with Personality!” [21] defines a
character’s personality via FFM’s Extraversion and Agreeableness traits to conduct dialogue. Extraver-
sion and Agreeableness traits are used to influence a conversation’s form, content and strategy. Along
side these traits, the NPC has its own goals, beliefs, and strategies.
“CoBelievable – The Effect of Cooperation in Believability” [22] developed by Ana Filipe et al. with
the purpose to explore new ways of expressing personality in Artificial Intelligence (AI) characters, more
precisely, expression of personality through cooperative behaviours. Ana Filipe focused on conflict sit-
uations that may rise between the player and a companion when cooperating, due to differences in
personal agendas. Arguing that the player often feels frustration, since his teammate disregarded him in
order to pursue his scripted goals. To solve this problem, the authors used the Thomas’ Dual-Concern
Conflict model. Thomas’ Dual-Concern Conflict defines two dimensional axes, assertiveness and coop-
erativeness [23], and sets five main conflict modes that then rest on these axes. The five main conflict
modes are [23]:
• Competing mode - possess high assertiveness and low cooperativeness, to the point of not coop-
erating, it is only concerned by their own goals, with complete disregard for others;
• Collaborating mode - experiences high levels of assertiveness and cooperativeness. Tries to find
a solution to a problem that satisfies both parties participating;
• Compromising mode- is the middle ground for assertiveness and cooperativeness. A person will
try to find a solution that partially solves both parties problems. Unlike the collaborating mode, this
person will not search for the optimal solution, setting with a quick middle ground;
• Avoiding mode - experiences low to no levels of cooperativeness and assertiveness. An avoidant
person will try to avoid conflict and also as no concern for personal goals;
14
• Accommodating - experience high levels of cooperativeness and low to no levels of assertiveness.
An accommodating person will disregard his own personal goals to satisfy the ones of the other
person.
PERSEED [24] is a personality model for virtual characters that unlike our work, does not use a
personality trait model but socio-cognitive theories. According to Caroline Faur et al. [24], the socio-
cognitive approach to personality takes into account the context of the situation. Arguing that personality
trait models hide intra-individual differences. Which follows what K.B. Schroeder et al. [25] concluded,
that personality alone cannot determine whether a person cooperates or not. That context of the situation
also has influence on the person’s behaviour. However, as noted by the authors “modeling personality
is made more complex because we move from five traits to an intricacy of structures and processes in
an interplay” [24]. So, the authors limit their scope to self-regulation theory4. PERSEED is composed
by two parts: a network of selves and attributes, and injection rules. The first part derives from the self-
discrepancy theory. The model creates an ideal self, ought self for each character’s Point-of-View (POV)
involved in the situation, and each self is linked to an attribute. The attributes can be goals, intra-
personal self-regulatory processes such as: perception filters or interpersonal self-regulatory strategies
such as goal setting and planning mechanism. The second part is the injection rules. The injection
rules are rules to specify how attributes are selected. In PERSEED, the rules given as an example
derive from the regulatory-focus theory, more precisely, promotion-focus strategy and prevention-focus
strategy. Although, PERSEED is capable of better expressing intra-individual, it poses more complexity
for the developers. Caroline Faur et al. [24] argued that virtual characters that implemented personality
trait models “successfully produce differentiated behaviors but computer scientists have to choose by
themselves how to link traits to behaviors”. However, in order to create a personality profile for PERSEED
that accounts for individual differences, we have to define [24]: “the contents of the attributes”, “the
links between selves and attributes” and “the mode of injection of attributes”. Furthermore, as noted
by Caroline Faur et al., “In a first phase, the links between selves and attributes will be established by
developers on the basis of an existing corpus and data in the literature” [24], which means more research
is still necessary in order to create links between selves and attributes. Although, Caroline Faur et al.
pointed out that the evolution of this model is in long-term.
Our work focus on creating a personality model and a generic framework for companion characters,
as such we chose a different approach. Because we want our work to be easily understood by game
developers, we decided that our characters’ personality will directly modify the companion’s behaviour.
This means that any change made to a character’s personality may result on a different behaviour from
the character, making it clearer for the developer. To express our character’s decision which is made
based on their personality, we will use dialogue to express the companion’s decision which also reflects
4Self-regulation theory is the mechanism for aligning expectations or desires and reality [26].
15
their personality. As previously mentioned, we chose Cloninger’s psychobiological model of temper-
ament and character to guide the development of our personality model for companion characters in
videogames. Cloninger’s psychobiological model of temperament and character is capable of trans-
lating the assertiveness and cooperativeness axes from Thomas’ Dual-Concern Conflict model, to the
Cooperativeness trait in whether a person has interest in helping others or is only self-interested, and
Self-Directness trait to determine if a person has a lack of goal direction (i.e. no interest in personal
goals). But the added four temperament traits, will allow us to define with more precision our characters’
personality. Caroline Faur et al. [24] argued that the socio-cognitive approach to personality takes into
account the context of the situation, but makes the definition of a character’s personality more complex.
As a result, we opted for a personality trait model. But, not neglecting the importance of context as on a
situation, we developed a tag system.
2.3 Personality in the gaming industry
Different games have been using personality to create and develop their characters. But, “The Sims”
series have used their personality system has a feature. Explicitly exposing their personality system as
a game mechanic, which allows us to analyse their different implementations of personality systems in
their games.
“The Sims”5 is a series of games developed by Maxis, now a subsidiary of Electronic Arts, since
2000, being this the release date of their first game of the series. The games are mostly non-linear
games that allow the player to change and roam the game environment freely, granting the player the
liberty to approach the games as they want, imposing only small limitations to the player.
“The Sims” series have always featured some sort of personality system for their characters. The
system often works as a modifier to the preferences of the character. Although later in the series,
the personality system impacted different aspects of a character (Sim). In “The Sims” and “The Sims
2”, the Sim’s personality was defined via 5 personality traits: sloppy/neat, shy/outgoing, lazy/active,
serious/playful and grouchy/nice. Depending on the personality trait distribution, a Zodiac Sign is given
to the Sim. In “The Sims” and “The Sims 2”, Zodiac signs influence how characters are attracted to
each other. For example: an Aries sign Sim is attracted to Gemini and Taurus signs, while repelled to
Cancer and Libra signs. In “The Sims 3”, the entire system was revamped to a trait system, that with
all downloadable content, the game has a total of 99 normal traits. These traits are divided in multiple
categories such as: mental, physical, social, lifestyle, and other. In the beginning, the player can choose
5 traits from either category. Depending on the choice made, the player can then choose a lifetime wish
or lifetime aspiration. The Sim during his lifetime can gain different traits, though there are limitations to
5https://www.thesims.com/en_GB/
16
what they can learn. A Sim cannot learn a trait that contradicts one already existing. The latest iteration
of the series, “The Sims 4” reformed the previous trait system. The traits are now divided into normal,
bonus and reward traits. Players will choose 3 traits from different categories such as: emotional traits,
hobby traits, lifestyle traits and social traits. In addition to the 3 main traits, the Sim receives a bonus
trait, depending on the chosen aspiration. Upon fulfilling aspirations, our character will be rewarded with
traits. The Sim can also learn traits when dying, advancing in career or spending satisfaction points.
“The Sims 3” and “The Sims 4” implemented a ludicrous amount of individual traits to fine tune the
character’s behaviour, which is not needed for all types of games. As mentioned, in “The Sims” series,
the player’s character or characters live in the Sims world. As such, some of the character’s traits
revolve on activities that are similar to the mundane routines, for example: cleaning the house (Neat
trait6), cooking (Essence of Flavor trait7), hobbies (Geek trait8), between many others. Not all games
need to represent this level of depth of the character’s needs and activities. For example: “The Witcher
3: Wild Hunt” is an Action Role Playing Game (ARPG) that tells the story of Geralt of Rivia (player
character), but almost none of the activities and needs from “The Sims” series are present in the game.
As a result, our approach for our personality model and framework will be more similar to the “The Sims”
and “The Sims 2” personality system. This allows us to create a generic framework to accommodate
different games genres. Nonetheless, personality allows developers and players to create a wide range
of characters.
2.4 Chapter conclusion
In this chapter, we saw two of the most common personality models currently used FFM and MBTI,
and Cloninger’s psychobiological model of temperament and character. We selected the Cloninger’s
psychobiological model of temperament and character, because of being easily traced to game con-
cepts.
We reviewed different works that make use of personalty in both the academic and gaming environ-
ment. The work of Doce et al. [19] uses personality to create distinguishable characters. To do this
they used the FFM. Since, we intend to focus on companion characters on videogames, we opted for
a Cloninger’s psychobiological model of temperament and character to accommodate common game
concepts.
Contrary to the recent iterations of the “The Sims” series, we intend that our personality model
accommodates different game genres. Subsequently, we did not want a excessive amount of personality
6Neat trait - a Sim becomes Happy and Fun when performs house chores, http://sims.wikia.com/wiki/Trait_(The_Sims_4)
7Essence of Flavor trait - a Sim with this trait is a better cooker, http://sims.wikia.com/wiki/Trait_(The_Sims_4)8Geek trait - a Sim becomes Happy when reading sci-fi books or playing videogames, http://sims.wikia.com/wiki/Trait_
(The_Sims_4)
17
traits for the companion character that would overburden the model with unnecessary traits to some
game genres. But, we also do not want a low amount of traits that reduce the precision that the designer
has when creating a character companion, as we argued when presenting the work of Ana Filipe et
al [22]. So we guided our personality model by Cloninger’s psychobiological model of temperament and
character.
Alongside our personality model, a generic framework was created to be used in different video
game genres. Unlike Egges et al. [20] work that uses personality indirectly, our work will use personality
to directly modify the companion’s behaviour. For example: when changing the value of a trait in the
companion character’s personality, the companion may change its choice from the available options.
Carouline Faur et al. [24] objectified against personality trait models because the socio-cognitive
approach to personality can take into account the context of a situation. But as pointed out by Carouline
Faur et al. [24], “modeling personality is made more complex because we move from five traits to an
intricacy of structures and processes in an interplay” [24]. As a result, we opted for a personality trait
model. But, to not neglect the importance of context of a situation, we developed a tag system that allows
us to keep track of the character’s experience, knowledge, objectives, etc. These tags are capable of
influencing the companion’s decision, if the tags are linked to a specific decision.
18
3Solution
Contents
3.1 Adapted Personality Model (APM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.2 Framework overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.3 Companion’s decision making . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.4 Tag system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
3.5 Alternative approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.6 Chapter Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
19
We presented three different personality models, and Cloninger’s psychobiological model of temper-
ament and character was chosen to guide our solution. Therefore, in this chapter will be presented the
adaptation of Cloninger’s psychobiological model of temperament and character for companion charac-
ters, a framework overview, the framework components, and an alternative approach.
3.1 Adapted Personality Model (APM)
Our personality model is a personality trait model, as such, we first need to define what are the traits
and what they mean to a companion character. To guide us in this process, we selected Cloninger’s
psychobiological model of temperament and character. This can help us ensure that our model takes
into account the majority of a character’s possible behavioural patterns. The traits defined by our per-
sonality trait model for companion characters are inspired by the Cloninger’s psychobiological model of
temperament and character traits, but do not strictly follow their definitions. Also, the number of traits
the we have defined in our model allows us to modulate most of the characters’ behaviours. The traits
definitions are the following:
Novelty Seeking (NS): Translates into adventurous and curious behaviour, to seek thrill in new things
and areas. Characters will actively try to find new activities and unexplored paths. It is also
responsible for the search of rewards, being those practical or emotional. Dissimilar to the definition
of Novelty Seeking in the Cloninger’s psychobiological of temperament and character, ours mainly
focus on exploratory excitability and impulsiveness small order traits;
Harm Avoidance (HA): Reflects a character’s courage and confidence. A character that possess high
Harm Avoidance will avoid high risk situations, such as fighting an enemy while a character with
low Harm Avoidance can be seen as careless when in face of danger. Unlike Cloninger’s Harm
Avoidance trait definition, which also express the person’s shyness and fatigability. Our definition
focus in the avoidance of dangerous and uncertain of situations;
Reward Dependence (RD): Characters that posses low Reward Dependence better respond to practi-
cal rewards, such as money or equipment, while characters with high levels on this trait are highly
responsive to emotional support. Contrary to the definition of this trait in the Cloninger’s psychobi-
ological model of temperament and character, this definition focus in the preference of rewards.
We also defined the empathy towards other NPCs in this trait;
Persistence (Pers): Conducts the resoluteness and ambition of a character. If a task requires high
effort, a character with low levels in this trait will abandon or avoid to do such tasks. Our definition
mainly focus on work hardened and ambitiousness small order traits from the original definition.
Furthermore, we define character’s fatigability in this trait;
20
Self-Directedness (SD): Translates into willpower. Allowing us to define the “will” of a character in order
to pursue its goals. Unlike Persistence, this trait only influences the “will” of the character to seek
its goals. This means while a character with low Persistence may constantly change its actions, if it
possess high Self-Directedness its will to pursue the goal won’t change. This trait mainly focus on
the will of the character to seek its own goals, rather than the purposefulness and self-acceptance
of the character from the definition of the Cloninger’s psychobiological model of temperament and
character;
Cooperativeness (Co): Responsible for defining the helpfulness of a character. The higher the values
in this trait, the more helpful the character will act towards the player. The lower, the less helpful
the companion will be. This trait does not focus on the empathy, social acceptance or pure hearted
consciousness like the original definition in Cloninger’s psychobiological model of temperament
and character. But mainly in the definition of helpfulness towards the player.
Henceforth, the traits will be referring to the Adapted Personality Model (APM) traits.
3.2 Framework overview
Now that we have defined our personality trait model, we can move forth to our framework. PON-
TiFF is composed by 3 components: companion character’s personality, companion character’s decision
making, and tag system.
PONTiFF’s purpose is to give the illusion of personality to a companion character. To do so, the
character will make decisions based on its personality. The companion’s personality is defined by setting
a real value for each trait. These real values are bound between 0.0 and 1.0. The game designer
will then place trigger regions, that will define points of decision for the companion character to make.
These regions will feature N different options, from which the companion character will choose. For the
companion to make a decision based on its personality, each option will define a value between 0.0 and
1.0 for each of the APM’s traits. This value will act as a weight for the value set by the game designer
for the character’s personality. In order to add context to decisions, the game designer will tag important
“things”. These “things” can be, for example, a dialogue with a NPC which can disclose a location of
a treasure or a possible monster, that can influence the decision of the character based on this new
gained knowledge. The tags also define value between −1.0 and 1.0 for each of the APM’s traits. In the
end, the companion will choose the option with the highest value, calculated with the equation 3.1.
traits∑i
(decisionWeighti +
∑l tagl,i∑traits
k (decisionWeightk +∑
m tagm,k)) ∗ characterTraiti (3.1)
21
3.3 Companion’s decision making
Each decision is composed by N options, where N ≥ 2. Each option defines a weight for each trait
in APM. These weights will decide how much that companion’s trait contributes for that option.
For example: a companion with the distribution: 0.6 in the Novelty Seeking trait, 0.5 in the Harm Avoid-
ance trait, 0.3 in the Reward Dependence trait, 0.6 in the Persistence trait, 0.9 in the Self-Directedness
trait, and 0.7 in the Cooperativeness trait it is going to face, a decision with two options with their weight
distribution as shown in table 3.1.
Table 3.1: Example of a decision’s option weight distribution
Novelty Seeking Harm Avoidance Reward Dependence Persistence Self-Directedness Cooperativenessoption 1 0.7 0.3 0.0 0.0 0.2 0.3option 2 0.0 0.0 0.5 0.5 0.6 0.7
For option 1, there is a tag which increases the Reward Dependence trait for 0.6, this means it
increases the base weight value of option 1 resulting in the total value of 0.6 (0.0 + 0.6) in the Reward
Dependence trait. Because tags can have negative values, if a option’s weight value after adding the tag
value is negative, we set it to 0. To also avoid the game designer keeping track of the total percentages,
we normalize all weight values in an option. To normalize the weights, we sum the values of all traits, as
shown in the divisor in equation 3.1. For option 1, the normalization value is 2.1 (0.7 + 0.3 + 0.6 + 0.0 +
0.2+0.3 = 2.1). Where for option 2, the normalization value is 2.3 (0.0+0.0+0.5+0.5+0.6+0.7 = 2.3).
With these values, we divide each weight with the normalization value of each corresponding option,
resulting in the weight values shown in table 3.2.
Table 3.2: Example of a normalized decision’s option weight distribution
Novelty Seeking Harm Avoidance Reward Dependence Persistence Self-Directedness Cooperativenessoption 1 0.33 0.14 0.29 0.00 0.10 0.14option 2 0.00 0.00 0.22 0.22 0.26 0.30
Finally, we apply the equation 3.1 to calculate the option’s total value. Which results in the total value
of 0.543 ((0.6 ∗ 0.33) + (0.5 ∗ 0.14) + (0.3 ∗ 0.29) + (0.6 ∗ 0.00) + (0.9 ∗ 0.10) + (0.7 ∗ 0.14)) for option1,
and 0.642 ((0.6 ∗ 0.00) + (0.5 ∗ 0.00) + (0.3 ∗ 0.22) + (0.6 ∗ 0.22) + (0.9 ∗ 0.26) + (0.7 ∗ 0.30)) for option
2. This results in the companion choosing option 2, which has the biggest value from available options.
Sometimes developers want to add an unpredictability in the character’s behaviour, as such a possible
alternative is that these options’ total values define the probability of that option to be chosen. This
algorithm pseudocode is presented in algorithm 3.1.
22
Algorithm 3.1: Pseudocode to calculate an option’s total valuebegin
totalV alue←− 0normalizationV alue←− 0
/* First we find which tag has an impact in this option, if so add that weight
to the option’s weight values */
foreach tag doif tag impacts this option then
foreach Trait dooptionTrait ←− optionTrait + tagtrait
/* Second limit the values of the weights, to avoid negative weight values */
foreach Trait doif optiontrait < 0 then
optiontrait ←− 0
/* Third calculate the normalization value */
foreach Trait donormalizationV alue←− normalizationV alue+ optionTrait
/* Then normalize all weight values of an option */
foreach Trait dooptionTrait ←− optionTrait/normalizationV alue
/* Finally calculate the option’s total value */
foreach Trait dototalV alue←− totalV alue+ (characterTrait ∗ optionTrait)
23
After reaching a decision, the character will communicate the selected option and explain why it
chose it via a dialogue message. The dialogue message is composed of two parts. The first part (deci-
sion) contains the information about the option, e.g: “I should go to the forest, across the bridge”. Where
the second part (trait) contains the reason of why that choice was made. This reason is based on the
trait that impacted that decision, e.g: “To avoid me being an annoyance to you, because I don’t like to be
in dangerous situations.” (Harm Avoidance). In addition, the message dialogue subject changes accord-
ing to the character’s Self-Directedness and Cooperativeness trait values, with the objective to reinforce
the character’s personality. So, depending on whether the Self-Directedness and Cooperativeness trait
values are bigger or not than 0.5, this results in a different subject, as shown in table 3.3. We chose to
use English, because of its practicability.
Table 3.3: Subject Table
Self- ≥ 0.5 Cooperativeness ≥ 0.5 SubjectDirecteness
True True WeTrue False IFalse True YouFalse False It
For this reason, we created a generic sentence for each part of the dialogue message for the com-
panion to say. The created sentences are the following:
decision: “Maybe ... should go to ...”
decision (it): “Maybe got to ...”
Novelty Seeking: “Maybe ... can find something new.”
Novelty Seeking (it): “... seems there’s something interesting there”
Harm Avoidance:“So ... can avoid danger.”
Harm Avoidance (you):“So ... can avoid danger, because I don’t deal good with dangerous.”
Harm Avoidance (it):“... seems the safest option.”
Reward Dependence:“So ... can get something out of it.”
Reward Dependence (it):“... seems the most rewarding.”
Persistence:“... can get us through this.”
Persistence (it):“... can be done.”
Self-Directedness:“... need to go there!”
24
Self-Directedness (it):“Don’t really care.”
Cooperativeness (I):“So ... can help you.”
Cooperativeness (you):“So ... can help me.”
Cooperativeness (we):“So ... can help each other.”
Cooperativeness (it):“If you want.”
To find which trait was the one that impacted the most a decision, we first look at the values of each
trait before the sum of all trait values, as seen in equation 3.2.
utilitytrait = (decisionWeighttrait +
∑l tagl,trait∑traits
k (decisionWeightk +∑
m tagm,k)) ∗ characterTraittrait (3.2)
Following the previous example, since option 2 was selected, we will look at the value of each trait.
For option 2, Novelty Seeking has a value of 0.000 (0.6 ∗ 0.00), Harm Avoidance of 0.00 (0.5 ∗ 0.00),
Reward Dependence of 0.066 (0.3 ∗ 0.22), Persistence of 0.132 (0.6 ∗ 0.22), Self-Directedness of 0.234
(0.9 ∗ 0.26), Cooperativeness of 0.210 (0.7 ∗ 0.30). The trait with the biggest value, is the trait that will be
selected for the reason of that choice. Which means, that the trait that impacted the decision the most
was Self-Directedness. Since, the character’s value of Self-Directedness and Cooperativeness are 0.9
and 0.8, respectively, the corresponding subject is I, according to table 3.3. So an example of dialogue
message could be “Maybe I should go to the forest. I need to go there!”.
3.4 Tag system
As previously mentioned, the tag system was created with the purpose to add context information
when a companion character is making a decision. The tag system does not have the purpose to change
the character’s personality values, but the contribution of these in an option. For example: a game
designer can create a tag with 0.5 in the Novelty Seeking, that when the player reads a note, a map,
eavesdrop a conversation that discloses a hidden path, that tag is activated. This in turn, will increase
weight of the Novelty Seeking trait in the option by 0.5. Even though the contribution of Novelty Seeking
is increased for that option, if the character possess low values of Novelty Seeking the contribution that
Novelty Seeking will make for the companion to choose that option is minimal. The designer can create
different kinds of tags, which can have different purposes. But a tag will always have to define the weight
change that will be made in the option, if it wants to impact a decision. We conceptualized 2 different
tag types, although developers can create more if needed. The two conceptualized tags were:
Knowledge tag: A knowledge tag represents the knowledge gained by the companion character. This
tag is the only tag that has a state, whether active or inactive. The tag is inactive when the player
25
does not know of the knowledge that this tag represents, this is the start state of the tag. When
the player gains that knowledge, the knowledge tag becomes active. A knowledge tag could be
used when the player and the companion are listening to an NPC, and both learn about a monster.
When this situation happens a knowledge tag could be created with, for example 0.8 in Harm
Avoidance, increasing the weight of the trait in the option.
Objective tag: An objective tag is used to define the companion’s objective. An objective tag has the
purpose to influence the decisions that go according to the companion’s objective. For example, if
a character has the objective of finding treasure, then an objective tag will increase the weight of
the Self-Directedness trait, since this trait is responsible for the “will” of the character to pursue its
goals.
3.5 Alternative approach
Originally an option’s trait values would represent the “perfect” personality for that option, and the
calculation of an option’s total value was the difference between the character’s personality traits and
the options traits, as seen in algorithm 3.2.
Algorithm 3.2: Pseudocode for alternative version of the calculation of the option’s total valuebegin
totalV alue←− 0normalizationV alue←− 0
/* First we find which tag has impact in this option, if so add that weight to
the option’s weight values */
foreach tag doif tag impacts this option then
foreach Trait dooptionTrait ←− optionTrait + tagtrait
/* Second limit the values of the weights */
foreach Trait doif optiontrait < 0 then
optiontrait ←− 0
if optiontrait > 1 thenoptiontrait ←− 1
/* Finally we calculate the option’s total value */
foreach Trait dototalV alue←− totalV alue+ abs(characterTrait − optionTrait)
26
This meant, that the character would choose the option with the lowest value, because that option
was the closest to the character’s personality. For example, in this alternative it is possible to create a
decision with one option with 0.7 on and another with 0.2 on the Harm Avoidance, and the remaining
traits with 0. A companion with, for example, 0.3 in the HA trait would choose the second option, because
it is the closest to its personality (|0.3 − 0.7| > |0.3 − 0.2|). However, in the solution we presented, the
companion would always select the first option because the weight of this trait is bigger in this option ,
i.e. 0.3 ∗ 0.7 > 0.3 ∗ 0.2. We did not chose this approach, because it makes the creation of decisions less
intuitive. Since in this approach, the values in an option define the “perfect” personality. So, when we
are defining an options values, we have to be aware of what are the characters’ personality distributions.
Additionally, tags would now change the “perfect” personality for an option, making it harder for game
designer to manage the interplay of multiple tags in an option. Although it is an alternative, if the designer
requires this level of intra-trait precision.
3.6 Chapter Conclusion
In this chapter, we presented our personality model for companion characters for videogames, guided
by Cloninger’s psychobiological model of temperament and character. Following the APM, we described
how the framework components interact with each other, and how the companion chooses its option.
In the next section, we gave an example describing the process for the companion to make its decision
and how it communicates its decision. With the decision made, the companion also explains why it
made that choice according to the trait that impacted the most the decision. In the following section, we
discussed the tag system and gave an example of a scenario where the game designer would like to
tag a certain knowledge to a decision. In this section, we also gave 2 concepts of tags types. Finally,
we presented an alternative approach, which was the first version of the decision component. In the
end, we did not chose to use this approach because it made designing decisions and tags harder and
less intuitive. In the next chapter, we will present what was the selected development environment, how
we implemented the components of our framework, and the test scenario. We also talk about all the
developed characters from the player, the companion and the NPCs.
27
4Implementation
Contents
4.1 Development Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.2 Companion’s decision making . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.3 Tag system implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
4.4 Test scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
4.5 Player character . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
4.6 Companion characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
4.7 NPC characters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
4.8 User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
4.9 Chapter conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
28
In the previous chapter, we presented our personality model, and the components that compose
the framework. As such, in this chapter will be presented the selected environment to implement our
framework, how the framework was implemented, the test scenario, the characters we created, and the
developed user interface.
4.1 Development Environment
To implement our personality model and our framework, it was decided to use a modding tool rather
than a game engine. Since, modding tools often provide the in-game assets. Nevertheless, there
are some games from different genres that support modding tools. But, the customization that each
modding tool offers differs from one another. From the available modding tools, we selected Starcraft
2 Editor. Starcraft 2 Editor was released with Starcraft 2, a game that possess an active competitive
scene. Starcraft 2 has good playability and the release of the Arcade system (a hub for different mods
for Starcraft 2) in June of 2012, allowed the nourishment of the creation of different game modes and
genres using Starcraft 2 Editor with success. Furthermore, Starcraft 2 Editor allows its user to create
and customize assets (units, abilities, special effects, etc.), being those already existing or new. Unlike
some modding tools, Starcraft 2 Editor also allows to code, via scripts or code blocks. Enabling us to
customize individual units AI, customize the User Interface (UI), and much more.
4.1.1 Starcraft 2 Editor
Starcraft 2 Editor is divided in different modules, each to modify different aspects from the game.
Three modules were primarily used, these were: terrain module, trigger module, and data module.
The terrain module, as in figure 4.1, provides tools to modify maps, allowing to modify the map height,
put/change/combine textures to the map’s floor, add liquid terrain (for example: water, lava, toxic liquids,
etc..), create and modify map ramps to connect different terrain heights, to define the vegetation of the
map, add roads, between others.
Figure 4.1: Terrain module
29
This module allows to place both units and doodads. Units can be either player characters, NPCs or
interactive objects. While doodads are objects or effects (such as: rain, thunderstorm, wind, rock slides,
etc..) with the objective to create the map aesthetic, these objects are not interactive. This module also
allows us to place points, which can be used to issue order to NPCs, and create regions. These regions
can be then used to detect whether a unit enters or leaves a certain region, with the goal to trigger
a piece of code. This module grants the ability to define cameras, which allows to define the player’s
in-game perspective. Furthermore, the module allows to define pathing, for example: to block NPCs and
the player to access certain map areas.
The trigger module, seen in figure 4.2, allows to develop code. This module works similar to coding
with pre-built functions and code blocks. In this window, we can create triggers1, functions, and actions2.
Figure 4.2: Trigger module
The data module, seen in figure 4.3, keeps all properties and information from units, doodads, abili-
ties, weapons, effects, actors3, behaviours, cameras, lights, maps (for example customize map’s sound
ambient, texture sets, etc.), between others. In this module we can create, combine or customize dif-
ferent game entities4 to our mod. Some game entities require the combination of other game entities to
create them. For example, units have abilities, actors, weapons. In turn abilities have actors, and effects
which in turn may apply a behaviour to a character. As a result, the data module is also responsible to
connect different game entities in order to create more complex game entities.
Figure 4.3: Data module
1triggers are pieces of code that run when they are called in another piece of code or triggered by in-game events2actions are similar to functions but do not allow to return. They work as a versatile trigger, since it allows to receive parameters3actors are responsible for models and animations of any object, unit or special effect that is going to be displayed.4game entities are all the categories kept by the data module. For example: units, actors, behaviours, effects, abilities, etc..
30
Two types of documents were used, the Arcade Map and the Dependent Mod document. The Arcade
Map allows to create a “custom map with non-melee gameplay” [27], this means it allows to create maps
with gameplay different from the standard game mode. The Dependent Mod is a “file containing custom
data and trigger libraries which can be shared by multiple maps”’ [27]. Our maps used the Arcade
Map document, since our scenario is an ARPG. While, Dependent Mod was used to implement our
framework, tag system, player movement, any data module customization, UI, and companion’s AI. As
this allowed us to reuse these implementations in different maps.
4.2 Companion’s decision making
In our particular implementation of the decision making, we focused on decisions with only two
options. In Chapter 3, we presented the generic sentences that the companion can say after making
its decision. But, we also implemented macros to allow dialogue customization. So, it was necessary
to add more information to an option. The options will now carry the weight values for each trait, and
the dialogue components. Since dialogue is composed by two parts, the option has the first part and
second part of the dialogue, each with a version for a non-It subject and It subject, as shown in listing
4.1.
Listing 4.1: Information contained in an optionOption{
string decision;string itDecision;string NSDecision;string itNSDecision;string HADecision;string itHADecision;string RDDecision;string itRDDecision;string PersDecision;string itPersDecision;string SDDecision;string itSDDecision;string CoDecision;string itCoDecision;float NS;float HA;float RD;float Pers;float SD;float Co;
}
As previously mentioned, we also developed macros to allow the customization of dialogue. These
macros are:
%s or %S: If the macro is %s, then it means to be replaced with a lowered case of the subject, with the
exception of ‘I’. If the macro is %S, it means that it is the upper cased version of the subject. The
subject of the sentences varies according to the levels of Cooperativeness and Self-Directedness
of the companion character, see table 3.3.
31
%pr: This macro is replaced with the object pronoun of the subject, according to table 3.3.
%ps: This macro is replaced with the possessive pronoun of the subject, according to table 3.3.
%g: This macro is replaced with a generic sentence for each specific part.
%0: This macro is used to define the sentence as empty. This means if the decision or decision (it) are
defined by %0, the companion will say nothing. If the traits are defined by %0, the companion will
only say the decision or decision (it) sentence, depending on the subject.
An example of the use of macros from our scenario, is when the companion is deciding to whether
go help a village or seek treasure, “%S should go to the left, for the canyon”(decision), “Let’s go for
the canyon.”(itDecision), and with one of the explanations “Maybe %s should go help the people in the
oasis.”.
As such, our decisions in the scenario are composed by: two options, the current map name, the
target maps of those options, the first part of a indecision dialogue (indecision text), and a version for
the it pronoun for the second part of indecision dialogue message (indecision trait it text). An example
of a decision in our implementation, is, for example, when the companion is deciding to proceed to a
forest or a desert. The decision has as arguments: cityMap, ForestMap, DesertMap, option1(Forest),
option2(Desert), “ ”, “ ”. With option1 defining the weights has: 0.3 in Novelty Seeking, 0.8 in Harm
Avoidance, and 0.0 in the remaining traits, and option2 defining the weights has: 0.7 in Novelty Seeking,
0.2 in Harm avoidance, and 0.0 in the remaining traits5. Then option1 defined: “%S should go for the
forest, across the bridge.” (decision), “Maybe go to the forest, across the bridge.” (itDecsision), “To
avoid me being an annoyance to %pr, because I don’t like to be in dangerous situations.” (HADecision),
and “%g” in all other dialogues; And option2 defined the dialogues as: “%S should go ahead for the
desert.” (decision), “Maybe go ahead for the desert.” (itDecision), and “%g” in the remaining dialogues.
There was no need to define a dialogue special for NSDecision for the option for the desert, because
the generic sentence fitted in the decision.
Because our sentences’ subject can change depending on the character’s Self-Directedness and
Cooperativeness traits, a draw between options will be handled according to the subject table, table
3.3. If the companion character’s levels of Self-Directedness and Cooperativeness traits results in the
pronoun “We”. Then the character will choose one the options, with equal chance, but also say “But
either option is good”. Transmitting the idea the companion cares about the player’s choice. If the
companion character’s levels result in the pronoun ‘I’, then the character is self-centered and will choose
one of the options, equally, but without adding anything else. If the companion character’s levels result
in the pronoun “You”, then the companion mainly focus on the player rather than itself, as a result the
5We used just two traits in our decisions because this helped us reduce the number of dialogue lines to write for the experiment,since we controlled each character’s personality.
32
companion will say the trigger region indecision text and adding “I leave it up to you”. Finally if the
companion character’s levels result in the pronoun “It”, then means that the character does not care
about itself nor the player. Thus, the companion will only say the indecision text and indecision trait
it text. The implementation of the decision making then follows the algorithm shown in algorithm 3.1.
The specific implementation of the entire decision making can be seen in algorithm B.1. As previously
mentioned, the reason of a companion character’s option will be based on the trait that most impacted
that choice. The implementation of this algorithm, is shown in algorithm B.2.
4.3 Tag system implementation
In order to reuse our framework, tag system, player movement, data customization, UI, and com-
panion’s AI across all the eleven maps it was created a Dependent Mod. This allowed us to create
all the necessary triggers, functions and actions in a single document. There were two possibilities to
implement the tag system through Starcraft 2 Editor, either through the data editor or through bank files.
We opted for bank files, because they function as simple xml files and becomes easier to debug the
system. Bank files are organized in sections and each section can store key-value pairs. As such, we
need a nomenclature to identify a tag. A tag ended up with two identifiers: a tag name (a unique name
given by the game designer) and a standard tag identifier (e.g: an objective tag standard identifier is
objectivetagx, where x is an integer). The tag name allows to easy change and create the tags while in
the maps documents, while the standard tag identifier allows to determine and retrieve all keys from a
certain tag type. So, we organized our framework bank files into the following sections:
• a general tag section that holds the key-value pair (name-standard identifier) of all tags, and the
current number of each tag type;
• an inactive knowledge tags section that holds the key-value pair (standard identifier-name) of all
the inactive knowledge tags;
• an active knowledge tags section that holds the key-value pair (standard identifier-name) of all the
active knowledge tags;
• an objective tag section which holds the key-value pair (standard identifier-name) of all the objec-
tive tags;
Furthermore, when a tag is created, a section with the nomenclature standard identifier section (e.g:
objectivetag0section) is created to hold all the tag’s attributes. The implementation is made simpler, if
the implementation is made in a regular programming language. For example: the utilization of a specific
implementation from the Collection class from C#(e.g: Dictionary) would made the implementation of the
tag system much easier, without requiring the previous organization.
33
There are two possibilities of linking the tag to an option, either the tags hold the options that they
influence or the options has a list of tags that influences them. Each approach has its advantages and
disadvantages, the first possibility whenever we create a new decision, we have to update the list on
each tag that we want to influence that decision. While in the second possibility, whenever we create
a new tag, we have to add the decisions that this tag influences. In our case we opted for the second
approach, because we implemented our tags via the bank files. The implementation of the two tag types
were the following:
Knowledge tag: The knowledge tag represents knowledge gained by the companion character. This
tag is the only tag that has a state, whether active or inactive. The tag is inactive when the
player does not know that knowledge. When the player gains that knowledge, the knowledge tag
becomes active.
An example of a knowledge tag that was used on our scenario, is when the player and the com-
panion are close enough to eavesdrop a conversation between two NPCs, and they learn about a
treasure in the desert. When this situation happens, a knowledge tag with 0.8 in Novelty Seeking
and 0.5 in Reward Dependence, is turned active influencing the decision of the player and the
companion choosing whether go through the forest or the desert.
A knowledge tag possesses the following attributes:
• Personality Values - A real value for each of the six personality traits, varying from -1.0 to
1.0.
• Influence maps - The maps where this tag is active.
• Target options - The options that this tag influences.
Objective tag: An objective tag is used to define the companion’s objective.
An objective tag has the purpose of influencing the decisions that go according to the companion’s
objective. For example, one of the created companions wants to gain new knowledge, so this
companion seeks treasures. For this companion, it is associated an objective tag, which links all
options that involve a treasure. This tag has as value of 0.8 in the Self-Directedness trait, since
this trait is responsible for the “will” of the character to pursue its goals. It is also possible to update
this tag, in case of a change in the companion’s objective.
An objective tag has the following attributes:
• Personality Values - A real value for each of the six personality traits, varying from -1.0 to
1.0. Although only Self-Directedness’ value is defined.
• Target options - The options that this tag influences.
34
• Companion - The companion that this tag belongs. This attribute is used to update a com-
panion’s objective tag along different maps.
4.4 Test scenario
To create a test scenario similar to a game, eleven different maps were created. The transition
between each map is dictated by the each trait of the personality model, with the exception of Self-
Directedness. Self-directedness is related with the companion’s objective, so this behaviour should
be observed along all maps. This approach allowed us to create a story for the player to follow, and
simultaneously allow the companion character to express its personality. This layout is similar to an
acyclic graph, see figure 4.4.
Figure 4.4: Test scenario layout
The maps were created so that from the point of decision of the trait Novelty Seeking, the experience
would be symmetrical. Although maps featured different thematics, the decisions that the companion
character makes are similar.
The test scenario starts with the tutorial. The tutorial’s purpose is to teach the player the basic
game mechanics, and introduce the story to the player. From the moment the player moves to the next
map, the player and the companion character will be confronted with different decisions to allow the
companion to express its personality. After completing the tutorial, the player will move to the city. In
the city, the player will meet a companion. The companion will then introduce himself and specify its
objective. The companion then joins the player in his journey. The first decision that the player and the
companion will face is whether to proceed to the forest (upwards) or to the desert (downwards). This
decision allows the companion to express the Novelty Seeking trait. If the companion chooses forest
35
then it chose the safest option, instead of choosing to explore the desert. In the next maps, the player
and the companion will meet a traveller that will expose the next decision. This decision is designed
around the Reward Dependence trait, and involves the companion and the player to choose whether to
seek a treasure or seek the villagers in need of help. Independently of the previous choice, the player
and the companion will have to decide either to fight or run in both maps, this decision will come down
to the Harm Avoidance trait. If the player and the companion chose the treasure map, in order to get
to the treasure they will have to fight to obtain it or they can choose to skip to the next map. In case
the player chose to seek the villagers, there is currently a war between evil creatures and the villagers.
Once again they will have to decide to fight and help the villagers or to skip to the next map. Forward to
the next map, the player and the companion will be greeted by a landslide between themselves and their
objective, but they find a dubious side path. The player and the companion will have to decide whether to
persist forward and destroy the rocks in their path or try to move by the dubious path. If the companion
is persistent, it will say to the player that they can push forward, otherwise it will say to the player to
follow the side path where they will fight a giant golem. Finally, the player and the companion enter the
last map. Before reaching their final destination, the player and the companion will have to complete
two puzzles. Here the companion may or not give tips to the player on how to complete the challenges,
depending on the Cooperativeness trait. As previously mentioned, Self-Directedness influences the will
to seek the character’s goal. One of the created companion characters is a sorceress with the goal to
seek treasure, in order to gain new knowledge. As such, this character has a tag which influences the
options to seek treasure, increasing the weight of Self-Directedness trait by 0.8. In this case, increases
the weight of the Self-Directedness trait on the decision to seek treasure in the third and fourth maps.
4.5 Player character
Starcraft 2 Editor has a large amount of available assets, so there was no need to create new models
or animations. As a result, the player character is using the priest unit from Warcraft 3 that is available
in Starcraft 2 Editor, seen in figure 4.5.
Figure 4.5: Player character model
36
However, it was necessary to create new abilities for the player to use. This means to either re-
utilizing or changing some existing abilities to create new ones, or create new abilities from scratch.
Thankfully, this does not mean creating new models or sounds assets. Since, we could re-utilize and
customize existing models to different things, which made the task simpler. The abilities of the char-
acter are mainly focused for a character that focus on dealing damage(or Damage-Per-Second (DPS)
character). As such, the ability kit of the character possess a high single target damaging ability, a
Damage-Over-Time (DOT) ability, an Area-of-Effect (AoE) ability, and a filler single target ability (nor-
mally used when other abilities are on cooldown). To make the test scenario easier for the player, we
also add a healing and a shield ability, to make the player character tougher to kill.
4.5.1 Player controls
Starcraft 2 is an Real Time Strategy (RTS) game. To replicate the controls of an ARPG, it was
necessary to code the controls. Nevertheless, the player controls were created via the trigger module,
and are the following:
Right mouse click: orders the player character to move towards the mouse click. The right mouse
button can also be hold, to make the character follow the mouse pointer. If a targeted enemy is
highlighted6, then the player will cast a Holy Bolt.
Holy Bolt: is a energy bolt that causes 20 damage to the target enemy and regenerates 20
energy to the player. Holy Bolt has a 0.3 second cooldown.
Left mouse click: orders the player character cast Heal when the player character is highlighted.
Heal: is an ability that heals the player for 30% of their maximum health. Heal has 2 second
cooldown.
1: orders the player to cast Holy Ground over the mouse point.
Holy Ground: is an AoE ability, that burns the targeted ground. This ability causes 30 damage
to any enemy inside of this area. Holy Ground has 5 second cooldown.
2: orders the player to cast Holy Fire on the highlighted enemy.
Holy Fire: is an extremely powerful ability that deals 150 damage. Holy Fire has 6 second
cooldown.
3: orders the player to cast Shadow Word on the highlighted enemy.
6mouse pointer over an unit.
37
Shadow Word: places an aura on the targeted enemy which is afflicted with 20 damage every
second. Lasts 4 seconds, and has a 1 second cooldown. Does not stack.
4: orders the player to cast upon himself Holy Shield.
Holy shield: creates a shield surrounding the player, reducing damaged received for 30%. Last
15 seconds, and has a cooldown of 16 seconds.
5: orders the player to drink Health Potion. This ability is locked, unless the player has found and
opened a treasure.
Health Potion: a replenishing potion that heals the player for 60% of their maximum health.
Health Potion has a 10 second cooldown.
4.6 Companion characters
To test our framework, we created three companion characters. A sorceress character, a warrior
character and a random character. Due to time restrictions, we were unable to gather enough data
to evaluate the warrior character. As a result, we will mainly focus on the sorceress and the random
character.
4.6.1 Sorceress character
The sorceress character and warrior character had their personality contrast between each other.
Since, the personality given to the sorceress character is: 0.3 (low) in Novelty Seeking, 0.8 (high) in Harm
Avoidance, 0.2 (low) in Reward Dependence, 0.8 (high) in Persistence, 0.3 (low) in Self-Directedness,
and 0.8 (high) in Cooperativeness. Then, the warrior character’s personality is the inversion of these
values, 1− sorceresstrait. The sorceress’ personality distribution means that the sorceress is unadven-
turous, fearful, cold, persistent, non-ambitious and highly cooperative. For example: in the situation that
the player and the companion face a landslide, this character will tell the player to push through because
of the value in the Persistence trait.
The sorceress companion and the random companion share the sorceress model from the available
assets, seen in figure 4.6.
38
Figure 4.6: Character companion model
4.6.2 Companion character’s AI
Starcraft 2 Editor provides an aggression behaviour, which detects any nearby enemy and orders
the unit to attack it, and patrolling movement for individual units’ AI. Since, our scenario features com-
bat situations, we decided to also influence the combat decision based on the companion character’s
personality. As a result, we customized the companion units’ AI. The companion character featured a
simple decision tree, showed in figure 4.7.
Figure 4.7: Companion’s decision tree
The traits that will impact the chance of the character to fight or run are:
Harm Avoidance: Since Harm Avoidance reflects the companion’s courage, this trait directly translates
in whether the companion character will fight or run. This trait is the trait that most influence the
39
companion’s flight or fight response.
Reward Dependence: Characters with higher Reward Dependence are more emotional sensitive.
These character’s will have a higher chance of fighting, because of fear of failing the player. There-
fore, the value of this trait is inverted when calculating the chance value.
Persistence: Conducts the resoluteness and ambition of a character. As such, the higher the char-
acter’s Persistence, the higher the chance to fight. Subsequently, the value of this trait has to be
inverted as well.
Self-Directedness: Translates in willpower. If the current fight is aligned with the companion’s objec-
tive, the companion should be more motivated to fight. This results in higher chance of fighting,
which means that the value of this trait also needs to be inverted to calculate the chance value. In
this implementation of the framework is not possible to determine if the current fight is aligned with
the companion’s objective. As a result, the contribution of this trait is reduced.
Cooperativeness: Cooperativeness is responsible for defining the helpfulness of the companion. As
a result the more cooperative the character is, the higher the chance that it will help the player. As
a result the value of this trait needs to be inverted in order to calculate the chance value.
To calculate the chance of whether the companion character will run or fight, we first need to invert
the values of the traits that require this step. Because this value will be used to calculate a probability
value, the value of the traits are to be between 0 and 1. To make sure that the sum of the values of
each trait is 100%, Reward Dependence, Persistence, and Cooperativeness traits are multiplied by 0.2.
Self-Directedness is multiplied by 0.1 by the reason mentioned above, and since Harm Avoidance is the
trait that is most akin with combat its ratio is 0.3. After the ratios have been applied, we sum all values.
Finally, we generate a random real number between 0 and 1. If the random number is higher than the
chance value, the companion character will fight. For example: taking into account only Harm Avoidance
which directly contributes for the character to run, if the companion character’s Harm Avoidance value is
0.8. This means that the companion character has 80% of chance to run.
Similar to our decision making, depending on the trait that most influenced the companion to run,
the companion will say a dialogue sentence. These comment will be based on the trait with the highest
value, after all the calculations made prior to the sum of the chance value. The implementation of the
combat algorithm can be seen in algorithm B.3.
4.6.3 Random character
The random character’s purpose is to serve as a neutral personality character, which possess an
inconsistent random personality.
40
The random personality is implemented as follows. Whenever the player enters combat, the com-
panion character will decide whether to run or fight. Because the companion has a random personality,
whenever the player enters combat, the companion’s personality trait values that influence combat will
be random real numbers, between 0 and 1. Rather than set values.
The decision making process will be different. The random character will choose randomly between
available options. After the companion make its decision, the algorithm will determine what is the trait
that most influences the sorceress on this decision. To determine which trait would influence the sorcer-
ess’ decision, the algorithm identifies each trait with an integer. 0 is associated with Novelty Seeking,
1 is associated with Harm Avoidance, 2 is associated with Reward Dependence, 3 is associated with
Persistence, 4 is associated with Self-Directedness, and 5 is associated with Cooperativeness. Then, a
random number between 0 to 5 is generated. If random number is different from the one that would be
selected by the sorceress, then the trait that is identified by the real number will be selected. Otherwise,
another random number is generated. To avoid causing an infinite loop, the number generation is limited
by five random numbers.
4.7 NPC characters
Unlike the companion character, most NPC characters just use the aggression behaviour and pa-
trolling movement provided by Starcract 2 Editor for individual units. The only exception is the final boss,
seen in figure 4.8, which has a customized behaviour, that is divided into phases each with increased
difficulty.
Figure 4.8: End boss character
41
4.8 User Interface
The user interface was implemented via the trigger module, seen in figure 4.9. The user interface is
divided into four components: player hot bar, map component, text component, and objective compo-
nent.
Figure 4.9: User Interface design
The player hot bar component’s, seen in figure 4.10, purpose is to display the player’s health, energy,
and abilities. The red orb displays the player’s current health, while the player’s energy is displayed in
the blue orb. In the centre of the bar are the player’s abilities. These abilities turn to grey when they
are on cooldown. The health and energy orbs and the bar art style were provided by an available mod7,
under the public domain licence. The ability icons were obtained from World of Warcraft [28].
Figure 4.10: Player hot bar component
The map component displays a top-view perspective from the map. The map component also repre-
sents the player position with a red dot and the quests’ location with a question mark, as in figure 4.11.
It is also possible to mouse over the question mark to display a tooltip to give further information.
7“Diablo 3 UI Tutorial”, xXdRaGoNrIdDeRXx, available at: https://www.sc2mapster.com/projects/diablo-3-ui-tutorial
42
Figure 4.11: Map component
The text component, shown in figure 4.12, is responsible for displaying the interactions between
characters. This component shows the current interlocutor image, their name followed by their dialogue.
Figure 4.12: Text component
The objective component displays the player’s current objective, as in figure 4.13.
Figure 4.13: Objective component
4.9 Chapter conclusion
We started this chapter by presenting our chosen development environment, Stracraft 2 Editor, and
all the components that were used. After, we explained how we implemented our framework compo-
nents in Starcraft 2 Editor. Then, we proceeded to describe the structure of the scenario layout, and
the scenario playthrough as implemented. After explaining the test scenario, we moved to the game
characters. Here we explained the player character and the controls, the created companion characters
and its AI, and the NPC characters. Finally, we discussed the UI of the scenario. For the next chapter,
we will talk about our evaluation methodology, and what was our participants demography. In the next
chapter, we will also analyse our data retrieved from our evaluation, and discuss upon the results.
43
5Evaluation and data analysis
Contents
5.1 Evaluation methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.2 Participants demography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
5.3 Data analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
5.4 Chapter conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
44
To determine if PONTiFF is capable of giving the illusion of a coherent and understandable person-
ality to a companion, a questionnaire with gameplay video was created for the users to observe the
companion’s behaviour. Each user will first express their first impression of what might be the person-
ality of the companion, by evaluating the character’s model. Afterwards, the player will see a gameplay
video of a run of the game scenario, and describe the companion via one to three adjectives. Finally,
the user will evaluate the companion behaviour in 16 items divided in a 4-point Likert scale.
5.1 Evaluation methodology
Our evaluation process was divided into two phases. The first phase was a preliminary hand-on test
made available at Montra de Jogos (MOJO) of Instituto Superior Tecnico. The second phase was an
online questionnaire.
5.1.1 Montra de Jogos (MOJO)
At MOJO, we made our test scenario available for attendees of the event. When an attendee asked to
play the scenario, we would first introduce the game controls and ask the player to take special attention
to the companion’s dialogue. From there, the attendee would play the entire scenario by himself. After
the attendee completed the scenario, we would ask if the player could answer a questionnaire about the
companion character. After answering the questionnaire, we asked for feedback. The feedback that we
started receiving was that, upon responding to the questionnaire, the attendee no longer remembered
most of the interactions of the companion, because after awhile the attendee started focused more
on the game mechanics rather than the companion itself. This clearly meant a problem, because we
wanted to evaluate the attendee’s perception of the companion character’s personality. As a result, we
developed a second methodology.
5.1.2 Online Questionnaire
It was then decided, that our evaluation needed to allow the users to focus on the companion’s
interactions rather than the game mechanics. This resulted in the creation of an online questionnaire,
that features a gameplay video.
So, an online questionnaire was developed for our 3 characters. The only difference from each
questionnaire was the gameplay video. As such, the questionnaire was divided into 3 sections: a demo-
graphic section, model impression, and description of the companion character based on the gameplay
video. The demographic section allows us to retrieve the age of the participants, their dedication to
videogames, and whether they have experience with ARPGs. The model impression evaluates the
45
participants’ first impression of the personality from the model character. In order to evaluate this first
impression, the participant answers a 6 4-point Likert scale items for each trait. The 4-point Likert scale
is: Fully Disagree, Disagree, Agree, and Fully Agree. Afterwards, the participant sees a gameplay video
of the player and the companion character completing the test scenario. The participant will then de-
scribe the companion character with 1 to 3 adjectives. Finally, the participant answers a sixteen 4-point
Likert scale items. These 16 items are composed by 6 items that analyse a trait in the positive form,
6 items that analyse a trait in the negative, and 2 items to mislead the participants about the actual
purpose of the questionnaire, each with a positive and negative form. Redundancy on the items serve
the purpose to evaluate the attention and honesty of the participant, and validate our questionnaire. The
6 items from the model analysis are the same as the 6 items that analyse in the positive form each trait.
The items that composed the questionnaire are the following:
Dedication to videogames item scale
d1.1 “I don’t play digital games.”
d1.2 “I play digital games occasionally when the opportunity presents itself.”
d1.3 “I make some time in my schedule to play digital games.”
Experience with an ARPG item scale
d2.1 “I don’t play digital games.”
d2.2 “I play digital games but I am not very familiar with the Action Role-Playing genre.”
d2.3 “I am familiar with the Action Role-Playing genre.”
Novelty Seeking items
1. “The companion wants to explore new areas and find new things.”
2. “The companion prefers to go to paths that she knows rather than new ones.”
Harm Avoidance items
3. “The companion wants to avoid danger and risky situations.”
4. “The companion is fearless.”
Reward Dependence items
5. “The companion is a warm character, capable of skipping possible rewards (such as trea-
sures), to seek others.”
6. “The companion prefers to seek treasure rather than seek others.”
46
Persistence items
7. “The companion persists when he/she is faced with an obstacle/challenge or is fatigued.”
8. “The companion easily gives up when he/she is tired or faced with an obstacle/challenge.”
Self-Directedness items
9. “The companion only cares about his/her objectives.”
10. “The companion doesn’t care about his/her own objectives.”
Cooperativeness items
11. “The companion cares about the player and gives tips to help the player overcome the chal-
lenges.”
12. “The companion is uncooperative and doesn’t help nor gives tips to the player.”
Misleading items
Smarter
13. “The companion is smarter than the player.”
14. “The companion is dumber than the player.”
Stronger
15. “The companion is stronger than the player.”
16. “The companion is weaker than the player.”
To share the questionnaire, a simple PHP webpage was created with the purpose to redirect the
participants through the different questionnaires. This was made to share multiple questionnaires via a
single link, and avoid participants to answer the different questionnaires. From the 33 total participants,
15 answered the sorceress character questionnaire, and 18 answered the random character question-
naire. The questionnaire’s arrangement can be seen in Appendix A.
47
5.2 Participants demography
From the 33 participants, 6 are female, 26 are male and 1 is transgender, with ages between 15 to
37, as seen in figures 5.1 and 5.2.
Figure 5.1: Demographic information on subjects’ gender
Figure 5.2: Demographic information on subjects’ age
63.6% of our participants schedules their time to play videogames, 27.3% plays videogames when
time allows, and only 9.1% do not play videogames. Which means, that most of our participants are
dedicated gamers, as presented in figure 5.3.
48
Figure 5.3: Demographic information on subjects’ dedication with videogames
From our 33 participants, 66.7% of our participants are familiar with ARPG genre, 24.2% are not very
familiar with ARPG genre, and 9.1% do not play videogames. This indicates that the majority of our
participants are familiar with the ARPG genre, as shown in figure 5.4.
Figure 5.4: Demographic information on subjects’ familiarity with arpgs
5.3 Data analysis
All data analysis was made via IBM SPSS Statistics®version 24.0.0.0. IBM SPSS Statistics® is a
statistical software which provides a different range of methods for data analysis.
Our 4-point Likert scale (Fully Disagree,Disagree, Agree, Fully Agree) is organized into a ordinals
from 1 to 4, 1 to Fully Disagree and 4 to Fully Agree. To convert both forms of each trait into a single
scale variable for each trait, first we need to convert the negative form value in the positive form value.
Then we do the average between both values, as seen in equation 5.1. This variable will be called
combined variable, henceforth.
49
(PositiveForm+ (5−NegativeForm))/2 (5.1)
This allowed us to do all the required analysis with a single variable for each trait. It was also created
an auxiliary variable for each negative form item, which is the negative form item converted into the
positive form item. These variables will be called auxiliary form variable.
5.3.1 Questionnaire validity
Before proceeding to more in-depth analysis, we first need to verify the validity of our questionnaire.
To do this, we need to verify whether the positive and negative form items associated with each trait are
correlated. As such, we applied Cronbach’s alpha to test the reliability of our pair of items from each
trait. Cronbach’s alpha was applied to the auxiliary form variable and the positive form of each trait.
As show in table 5.1, nearly all items were correctly evaluated by the participants, with the exception
of Reward Dependence.
Table 5.1: Cronbach’s alpha value in pair of trait items
Trait Cronbach’s alphaNovelty Seeking 0.857Harm Avoidance 0.606
Reward Dependence 0.047Persistence 0.872
Self-Directedness 0.605Cooperativeness 0.798
The low value of Cronbach’s alpha of Reward Dependence, pT = 0.047, indicates that the auxiliary
form variable and positive form item of this trait are not correlated. Which means, that this trait was not
correctly constructed on the questionnaire. As a result, it is not possible to extract further conclusions
from Reward Dependence. Subsequently, this trait will not be part of our analysis.
It is also possible to exclude that our participants responded to the questionnaire without honesty,
since the Cronbach’s alpha value of the misleading items values are pT = 0.922 and pT = 0.926 for
smarter and stronger attention items respectively, as presented in table 5.2.
Table 5.2: Cronbach’s alpha value in the pair of attention items
Attention item Cronbach’s alphaSmarter 0.922Stronger 0.926
5.3.2 First impression results
To test whether our distribution follows a normal distribution or not, a Shapiro-Wilk test was applied
to our combined variable for both the sorceress and the random character data. The null hypothesis
50
states that the tested distribution follows a normal distribution. As the data presented in table 5.3, only
Novelty Seeking presents a normal distribution in both the sorceress(p = 0.165, p > 0.05) and the
random character (p = 0.277, p > 0.05) data. However, since all the other traits do not follow a normal
distribution on both sets of data, all our tests will be with non-parametric statistical methods.
Table 5.3: Shapiro-Wilk test results
Novelty Seeking Harm Avoidance Persistence Self-Directedness CooperativenessRandom p 0.165 0.009 0.002 0.106 0.011
Sorceress p 0.277 0.002 0.174 0.035 0.012
To verify if the character’s graphical design has an influence on personality reporting, we used
Wilcoxon signed test. The Wilcoxon signed test was applied to the items from the first impression
evaluation and the combined variables corresponding to each trait.
The results from the Wilcoxon signed test, presented in table 5.4, show that Harm Avoidance, Per-
sistence, Self-Directedness and Cooperativeness present a statistical significant difference (p < 0.05),
while Novelty Seeking didn’t show any statistical significance (p > 0.05). These results show that the
first impressions of the character’s personality did not hold in the final impression of the companion
character, after watching the gameplay video. This also shows that our participants were focused on the
companion’s behaviour, unlike what happened in our first evaluation methodology.
Table 5.4: Wilcoxon signed test results
Novelty Seeking Harm Avoidance Persistence Self-Directedness CooperativenessZ -0.919 -3.161 -2.888 -2.125 -2.662p 0.358 0.002 0.004 0.034 0.008
Furthermore, we applied a Mann-Whitney U test to the evaluation of the first impressions between
the group of participants who evaluated the random and sorceress character. As shown in table 5.5, the
results show no statistical significance between the evaluations (p > 0.05).
Table 5.5: Mann-Whitney U first impression results
Novelty Seeking Harm Avoidance Persistence Self-Directedness Cooperativenessp 0.287 0.508 0.879 0.596 0.756
5.3.3 Companion personality perception results
To verify if the participants were able to correctly assess our sorceress’ personality, we applied a
Mann-Whitney U test to the combined variable of each trait on both data sets, with the exception of
Reward Dependence. The results displayed in table 5.6 do not show any statistical significance (p >
0.05).
51
Table 5.6: Mann-Whitney U characters’ personality perception results
Novelty Seeking Harm Avoidance Persistence Self-Directedness Cooperativenessp 0.509 0.168 0.075 0.085 0.677
Recalling the sorceress personality, which has low in Novelty Seeking, high in Harm Avoidance, low
in Reward Dependence, high in Persistence, low in Self-Directedness, and high in Cooperativeness.
The frequency of evaluation of the sorceress’ character personality, as showed in table 5.71, presents
a clear high evaluation on the traits of Harm Avoidance and Cooperativeness, which goes according
to the sorceress’ personality. Whereas Novelty Seeking, Persistence and Self-Directedness have the
participants split among all levels. These results indicate that these traits were not correctly perceived
by the participants.
Table 5.7: Frequency of evaluation on the sorceress character
Novelty Seeking %(#) Harm Avoidance %(#) Persistence %(#) Self-Directedness %(#) Cooperativeness %(#)1.00 13.3 (2) 0 (0) 13.3 (2) 0 (0) 0 (0)1.50 26.7 (4) 0 (0) 13.3 (2) 0 (0) 0 (0)2.00 20.0 (3) 0 (0) 33.3 (5) 33.3 (5) 0 (0)2.50 13.3 (2) 0 (0) 6.7 (1) 26.7 (4) 13.3 (2)3.00 20.0 (3) 33.3 (5) 13.3 (2) 13.3 (2) 40.0 (6)3.50 0 (0) 26.7 (4) 6.7 (1) 20.0 (3) 13.3 (2)4.00 6.7 (1) 40.0 (6) 13.3 (2) 6.7 (1) 33.3 (5)
The adjectives used to describe sorceress character, shown in table 5.8, seem to be mainly focused
towards the Harm Avoidance trait (30.30%), with adjectives such as: fearful, cautious, coward, careful,
and afraid. Cooperativeness appears to also present some relevance in the adjectives, with helpful
occurring 12.12%.
Table 5.8: Adjectives used for the sorceress character
Adjectives # %fearful 3 9.09weak 1 3.03experienced 1 3.03powerless 1 3.03annoying 1 3.03cautious 3 9.09helpful 4 12.12insecure 1 3.03lazy 1 3.03fabulous 1 3.03encouraging 1 3.03attentive 1 3.03coward 2 6.06
careful 1 3.03worrier 1 3.03dull 1 3.03incongruent 1 3.03female 1 3.03unadventurous 1 3.03cold 1 3.03selfish 1 3.03afraid 1 3.03knowledgeable 1 3.03curious 1 3.03gutless 1 3.03
1The first column values represent the possible values for the combined variable.
52
5.3.4 Results discussion
The results obtained from the Wilcoxon signed test indicate that the first impression did not impact
the perception of the character’s personality in-game, which suggest the importance of exposing the
character’s personality via in-game behaviour. Although, this does not mean that developers should
neglect the model aesthetics, because this component can be used to reinforce a character’s personality.
The Mann-Whitney U test between the personality perception of the random and sorceress character
did not show any statistical significance (p > 0.05). These results may indicate that the current version of
the framework is not enough, in the implemented scenario in particular, to fully express a personality dis-
tribution. However, we validated that there were traits of sorceress that were correctly perceived by our
participants, Harm Avoidance and Cooperativeness. One reason for which Harm Avoidance might have
been so clearly observed by the participants, is because of combat. Combat is a common challenge
in the scenario and Harm Avoidance is the trait that most influences the sorceress to avoid combat.
Which means that this trait is often exposed in the game scenario. In the case of Cooperativeness, there
might be two reasons for to be so clearly assessed by our participants. This trait’s interaction is last
interaction to be made by the companion, making it the most recent interaction upon answering to the
questionnaire. The second reason might be, because of all interactions are made by the companion are
written dialogue. Since, the nature of Cooperativeness is to define how much helpful the companion is
to the player and how all interactions are written dialogue, this may indicate that this is the best way to
expose this trait. Therefore, it seems that the problem is not in our framework but in the way in which
the perception of the random character was not sufficient to evidence something statistically significant.
One of the factors may be not enough time to make these differences obvious. On the other hand,
each participant only interacted with one character, without the other character for comparison, makes it
difficult to the participants to evaluate the character’s personality in-game, since the participant is seeing
everything for the first time.
5.4 Chapter conclusion
In this chapter, we explained our evaluation process to evaluate our framework. Then, we proceed to
analyse the data retrieved from the participants demography. Afterwards, we analysed the data retrieved
from the online questionnaire, and we ended this section with a discussion of the results obtained. In
the next chapter, we have a conclusion about all the work done and we propose possible future works.
53
6Conclusion
Contents
6.1 Conclusions and Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
54
6.1 Conclusions and Future Work
In this work, we proposed to define a personality model and a generic framework for companion
characters with the focus in videogames. To achieve this, we reviewed three different personality models
from the psychology literature. Upon which, we found Cloninger’s psychobiological model of tempera-
ment and character to be in more agreement with the focus our work. With this decision, we defined
our personality trait model for companion characters, inspired by Cloninger’s psychobiological model
of temperament and character. For the creation of our generic framework for companion characters in
videogames, we analysed different works that implement personality in synthetic characters. Based on
the analyses of the reviewed works, we decided that our generic framework was going to be composed
by three components: the character’s personality, decision system based on the character’s personality,
and a tag system to keep track of the character’s experience, knowledge, objectives, etc. To implement
our generic framework, we opted for a modding tool, from which we selected Starcraft 2 Editor. It was
in this modding tool, that we also developed our test scenario. Our scenario was designed to provide
an experience similar to a videogame. In our scenario, the transition between each map in our scenario
was dictated by the each trait of the personality model with the exception of self-directedness. Since,
Self-Directedness is related with the companion’s objective, this behaviour should be observed along all
maps. To test our work, we used an online questionnaire. In this questionnaire, we were interested to
evaluate if the character graphical design has an influence on personality assessment and if the com-
panion personality conveyed by our model is adequately perceived by the player through interaction.
Our results indicate that the in-game behaviour is more important than first impressions induced by the
character design, and that Harm Avoidance and Cooperativeness traits were easily understood by the
participants.
This leads us to possible future work. Videogames often use cutscenes to express the character’s
personality. This might be, because players do not need to interact with the game, so they can focus
entirely on the cutscene. But, our results show the importance of expressing the character’s personality
in-game. As such, we propose as future work to study what is the most efficient way to express a
trait. Either through voice acting, written dialogue, body motions, behaviour, combination of previous, or
other. For example, Novelty seeking could be better understood by participants, when expressed with
body emotions, rather than solely expressed with written dialogue. In our current implementation of our
tag system, the designer needs to manually tag in-game events to allow these to influence a decision.
So we propose as another possible future work, the development of a procedural generation algorithm
that creates tags based on the detection of in-game events. For example, when a player chooses a
different option from the companion character, an affinity tag is created which decreases the weight of
Cooperativeness on future decisions.
55
Bibliography
[1] W. Yin-Poole, “Bioshock infinite’s elizabeth: Ken levine on creating the best ai companion
since half-life 2’s alyx vance,” 2012, retrieved on 10 of September of 2017. [Online]. Available:
https://goo.gl/tYX5e
[2] J. Abercrombie, “Bringing bioshock infinite’s elizabeth to life: An ai development postmortem,”
2014, retrieved on 10 of September of 2017. [Online]. Available: https://archive.org/details/
GDC2014Abercrombie
[3] D. Gibson, “Animation bootcamp: Overwatch: How a hero is mei-d,” 2016, retrieved
on 10 of September of 2017. [Online]. Available: https://www.gdcvault.com/play/1023473/
Animation-Bootcamp-Overwatch-How-A
[4] J. D. Mayer, “Asserting the definition of personality,” The online newsletter for personality science,
vol. 1, pp. 1–4, 2007.
[5] R. R. McCrae and O. P. John, “An introduction to the five-factor model and its applications,” Journal
of personality, vol. 60, no. 2, pp. 175–215, 1992.
[6] C. G. Jung, “Psychological types.” Routledge, 1923, ch. 10.
[7] T. M. . B. Foundation, “Mbti®basics,” 2004, retrieved on 3 of September of 2017. [Online].
Available: http://www.myersbriggs.org/my-mbti-personality-type/mbti-basics/
[8] “Extraversion or introversion,” retrieved on 3 of September of 2017. [Online]. Available:
http://www.myersbriggs.org/my-mbti-personality-type/mbti-basics/extraversion-or-introversion.htm
[9] “Sensing or intuition,” retrieved on 3 of September of 2017. [Online]. Available: http:
//www.myersbriggs.org/my-mbti-personality-type/mbti-basics/sensing-or-intuition.htm
[10] “Thinking or feeling,” retrieved on 3 of September of 2017. [Online]. Available: http:
//www.myersbriggs.org/my-mbti-personality-type/mbti-basics/thinking-or-feeling.htm
56
[11] “Judging or perceiving,” retrieved on 3 of September of 2017. [Online]. Available: http:
//www.myersbriggs.org/my-mbti-personality-type/mbti-basics/judging-or-perceiving.htm
[12] C. R. Cloninger, “A unified biosocial theory of personality and its role in the development of anxiety
states,” Psychiatric developments, vol. 3, no. 2, pp. 167–226, 1986.
[13] ——, “A systematic method for clinical description and classification of personality variants: A
proposal,” Archives of general psychiatry, vol. 44, no. 6, pp. 573–588, 1987.
[14] C. R. Cloninger, D. M. Svrakic, and T. R. Przybeck, “A psychobiological model of temperament and
character,” Archives of general psychiatry, vol. 50, no. 12, pp. 975–990, 1993.
[15] J. Gutierrez-Zotes, C. Bayon, C. Montserrat, J. Valero, A. Labad, C. Cloninger, and F. Fernandez-
Aranda, “Temperament and character inventory-revised (tci-r). standardization and normative data
in a general population sample,” Actas espanolas de psiquiatrıa, vol. 32, no. 1, pp. 8–15, 2004.
[16] F. De Fruyt, L. Van De Wiele, and C. Van Heeringen, “Cloninger’s psychobiological model of temper-
ament and character and the five-factor model of personality,” Personality and individual differences,
vol. 29, no. 3, pp. 441–452, 2000.
[17] J. E. Barbuto, “A critique of the myers-briggs type indicator and its operationalization of carl jung’s
psychological types,” Psychological Reports, vol. 80, no. 2, pp. 611–625, 1997.
[18] K. J. Swope, J. Cadigan, P. M. Schmitt, and R. Shupp, “Personality preferences in laboratory eco-
nomics experiments,” The Journal of Socio-Economics, vol. 37, no. 3, pp. 998–1009, 2008.
[19] T. Doce, J. Dias, R. Prada, and A. Paiva, “Creating individual agents through personality traits,” in
International Conference on Intelligent Virtual Agents. Springer, 2010, pp. 257–264.
[20] A. Egges, S. Kshirsagar, and N. Magnenat-Thalmann, “A model for personality and emotion simula-
tion,” in International Conference on Knowledge-Based and Intelligent Information and Engineering
Systems. Springer, 2003, pp. 453–461.
[21] K. Van den Bosch, A. Brandenburgh, T. J. Muller, and A. Heuvelink, “Characters with personality!”
in International Conference on Intelligent Virtual Agents. Springer, 2012, pp. 426–439.
[22] A. P. F. Filipe, “Cobelievable – the effect of cooperation in believability,” Master’s thesis, Instituto
Superior Tecnico, 2015.
[23] K. W. Thomas, Thomas-Kilmann conflict mode instrument. Xicom Tuxedo, NY, 1974.
[24] C. Faur, C. Clavel, S. Pesty, and J.-C. Martin, “Perseed: a self-based model of personality for
virtual agents inspired by socio-cognitive theories,” in Affective Computing and Intelligent Interaction
(ACII), 2013 Humaine Association Conference on. IEEE, 2013, pp. 467–472.
57
[25] K. Schroeder, D. Nettle, and R. McElreath, “Interactions between personality and institutions in
cooperative behaviour in humans,” Phil. Trans. R. Soc. B, vol. 370, no. 1683, p. 20150011, 2015.
[26] R. H. Hoyle, Handbook of Personality and Self-Regulation. Wiley-Blackwell, 2010, ch. 1.
[27] B. Entertainment®, “Starcraf 2 editor,” acessed 24-August-2017.
[28] ——, “World of warcraft©.”
58
AOnline Questionnaire
59
Figure A.1: Questionnaire’s demographic section
60
Figure A.2: Questionnaire’s first impression section
61
Figure A.3: Questionnaire’s gameplay video section
62
Figure A.4: Questionnaire’s companion’s personality assessment section
63
64
BProject algorithm implementations
65
B.1 Decision system algorithm implementation
Algorithm B.1: Decision making functionFunction makeTwoOptiondecision(mapName, targetMap1, targetMap2, option1, option2,indecisionText, indecisionTraitItText)/* Weight variables for option 1 */
NSWeight←− 0HAWeight←− 0RDWeight←− 0PersWeight←− 0SDWeight←− 0CoWeight←− 0/* Weight variables for option 2 */
NSWeight2←− 0HAWeight2←− 0RDWeight2←− 0PersWeight2←− 0SDWeight2←− 0CoWeight2←− 0
foreach objectiveTag doforeach objectiveTag.TargetOptions do
if objectiveTag.TargetOption = option1 thenNSWeight←− NSWeight+ objectiveTag.NSHAWeight←− HAWeight+ objectiveTag.HARDWeight←− RDWeight+ objectiveTag.RDPersWeight←− PersWeight+ objectiveTag.PersSDWeight←− SDWeight+ objectiveTag.SDCoWeight←− CoWeight+ objectiveTag.Co
endelse if objectiveTag.TargetOption = option2 then
NSWeight2←− NSWeight2 + objectiveTag.NSHAWeight2←− HAWeight2 + objectiveTag.HARDWeight2←− RDWeight2 + objectiveTag.RDPersWeight2←− PersWeight2 + objectiveTag.PersSDWeight2←− SDWeight2 + objectiveTag.SDCoWeight2←− CoWeight2 + objectiveTag.Co
endend
end
66
foreach knowledgeTag doforeach knowledgeTag.InfluenceMap do
if knowledgeTag.InfluenceMap = mapName thenforeach knowledgeTag.TargetOptions do
if knowledgeTag.TargetOption = option1 thenNSWeight←− NSWeight+ knowledgeTag.NSHAWeight←− HAWeight+ knowledgeTag.HARDWeight←− RDWeight+ knowledgeTag.RDPersWeight←− PersWeight+ knowledgeTag.PersSDWeight←− SDWeight+ knowledgeTag.SDCoWeight←− CoWeight+ knowledgeTag.Co
endelse if knowledgeTag.TargetOption = option2 then
NSWeight2←− NSWeight2 + knowledgeTag.NSHAWeight2←− HAWeight2 + knowledgeTag.HARDWeight2←− RDWeight2 + knowledgeTag.RDPersWeight2←− PersWeight2 + knowledgeTag.PersSDWeight2←− SDWeight2 + knowledgeTag.SDCoWeight2←− CoWeight2 + knowledgeTag.Co
endend
endend
endNSWeight←− NSWeight+ option1.NSHAWeight←− HAWeight+ option1.HARDWeight←− RDWeight+ option1.RDPersWeight←− PersWeight+ option1.P ersSDWeight←− SDWeight+ option1.SDCoWeight←− CoWeight+ option1.Co
clamp(NSWeight, 0,+∞)clamp(HAWeight, 0,+∞)clamp(RDWeight, 0,+∞)clamp(PersWeight, 0,+∞)clamp(SDWeight, 0,+∞)clamp(CoWeight, 0,+∞)
NSWeight2←− NSWeight2 + option2.NSHAWeight2←− HAWeight2 + option2.HARDWeight2←− RDWeight2 + option2.RDPersWeight2←− PersWeight2 + option2.P ersSDWeight2←− SDWeight2 + option2.SDCoWeight2←− CoWeight2 + option2.Co
clamp(NSWeight2, 0,+∞)clamp(HAWeight2, 0,+∞)clamp(RDWeight2, 0,+∞)clamp(PersWeight2, 0,+∞)clamp(SDWeight2, 0,+∞)clamp(CoWeight2, 0,+∞)
option1NormalizationV alue←−NSWeight+HAWeight+RDWeight+ PersWeight+ SDWeight+ CoWeightoption2NormalizationV alue←−NSWeight2 +HAWeight2 +RDWeight2 + PersWeight2 + SDWeight2 + CoWeight267
NSWeight←− NSWeight/option1NormalizationV alueHAWeight←− HAWeight/option1NormalizationV alueRDWeight←− RDWeight/option1NormalizationV aluePersWeight←− PersWeight/option1NormalizationV alueSDWeight←− SDWeight/option1NormalizationV alueCoWeight←− CoWeight/option1NormalizationV alue
NSWeight2←− NSWeight2/option2NormalizationV alueHAWeight2←− HAWeight2/option2NormalizationV alueRDWeight2←− RDWeight2/option2NormalizationV aluePersWeight2←− PersWeight2/option2NormalizationV alueSDWeight2←− SDWeight2/option2NormalizationV alueCoWeight2←− CoWeight2/option2NormalizationV aluecompanion←− getCompanion()/* This allows the designer to exclude a trait from the option, independently
from the active tags */
if option.NS 6= −1.0 and option2.NS 6= −1.0 thenoption1.NS ←− companion.noveltySeeking ∗NSWeightoption2.NS ←− companion.noveltySeeking ∗NSWeight2
endelse
option1.NS ←− 0option2.NS ←− 0
endif option.HA 6= −1.0 and option2.HA 6= −1.0 then
option1.HA←− companion.harmAvoidance ∗HAWeightoption2.HA←− companion.harmAvoidance ∗HAWeight2
endelse
option1.HA←− 0option2.HA←− 0
endif option.RD 6= −1.0 and option2.RD 6= −1.0 then
option1.RD ←− companion.rewardDependence ∗RDWeightoption2.RD ←− companion.rewardDependence ∗RDWeight2
endelse
option1.RD ←− 0option2.RD ←− 0
endif option.Pers 6= −1.0 and option2.P ers 6= −1.0 then
option1.P ers←− companion.persistence ∗ PersWeightoption2.P ers←− companion.persistence ∗ PersWeight2
endelse
option1.P ers←− 0option2.P ers←− 0
end
68
if option.SD 6= −1.0 and option2.SD 6= −1.0 thenoption1.SD ←− companion.selfDirectedness ∗ SDWeightoption2.SD ←− companion.selfDirectedness ∗ SDWeight2
elseoption1.SD ←− 0option2.SD ←− 0
if option.Co 6= −1.0 and option2.Co 6= −1.0 thenoption1.Co←− companion.cooperativeness ∗ CoWeightoption2.Co←− companion.cooperativeness ∗ CoWeight2
elseoption1.Co←− 0option2.Co←− 0
totaloption1V alue←−option1.NS + option1.HA+ option1.RD + option1.P ers+ option1.SD + option1.Cototaloption2V alue←−option2.NS + option2.HA+ option2.RD + option2.P ers+ option2.SD + option2.Co
if totaloption1V alue > totaloption2V alue thengetBasedTraitText(targetMap, option1)
else if totaloption1V alue < totaloption2V alue thengetBasedTraitText(targetMap, option2)
elsesubjectIndecision←− getSubjectFromTruthTable(companion.selfDirectedness ≥0.5, companion.cooperativeness ≥ 0.5)
if subjectIndecision = I thenrandomNumber ←− randomReal(0, 1)if randomNumber 6 0.5 then
getBasedTraitText(targetMap, option1)
elsegetBasedTraitText(targetMap, option2)
else if subjectIndecision = We thenrandomNumber ←− randomReal(0, 1)if randomNumber 6 0.5 then
getBasedTraitText(targetMap, option1)
elsegetBasedTraitText(targetMap, option2)
setChatText(getChatText() + “But either option is good”)
else if subjectIndecision = Y ou thensetChatText(indecisionText + “I leave it up to you”)
elsesetChatText(indecisionText+ indecisionTraitItText)
69
B.2 Based trait algorithm implementation
Algorithm B.2: BasedTraitFunctionFunction getBasedTraitText(targetMap, option)
companionSelfDirectedness←− getCompanion().selfDirectenesscompanionCooperativeness←− getCompanion().cooperativenesssubject←− getSubjectFromTruthTable(companionSelfDirectedness ≥0.5, companionCooperativeness ≥ 0.5)
/* string.replace function replaces argument1 with argument2 in the argument3,
and returns argument3 with everything replaced */
if subject = I thenoption.decision←− string.replace(“%ps”, “mine”, option.decision)option.decision←− string.replace(“%pr”, “me”, option.decision)option.itdecision←− string.replace(“%ps”, “mine”, option.itdecision)option.itdecision←− string.replace(“%pr”, “me”, option.itdecision)
endelse if subject = We then
option.decision←− string.replace(“%ps”, “ours”, option.decision)option.decision←− string.replace(“%pr”, “us”, option.decision)option.itdecision←− string.replace(“%ps”, “ours”, option.itdecision)option.itdecision←− string.replace(“%pr”, “us”, option.itdecision)
endelse if subject = Y ou then
option.decision←− string.replace(“%ps”, “yours”, option.decision)option.decision←− string.replace(“%pr”, “you”, option.decision)option.itdecision←− string.replace(“%ps”, “yours”, option.itdecision)option.itdecision←− string.replace(“%pr”, “you”, option.itdecision)
endelse if subject = It then
option.decision←− string.replace(“%ps”, “its”, option.decision)option.decision←− string.replace(“%pr”, “it”, option.decision)option.itdecision←− string.replace(“%ps”, “its”, option.itdecision)option.itdecision←− string.replace(“%pr”, “it”, option.itdecision)
end
70
/* string.find function returns a true if argument1 is in argument2, otherwise
returns false */
if string.find(“%0”, option.decision) thenchatText←− “”
endelse if subject = It and ¬string.find(“%g”, option.itdecision) then
chatText←− option.itdecisionendelse if subject = It and string.find(“%g”, option.itdecision) then
chatText←− “Maybe go to” + targetMapendelse if string.find(“%s”, option.decision) then
if subject = I thenchatText←− string.replace(“%s”, subject, option.decision)
end/* lowerCase converts all characters in argument1 to lowercase */
elsechatText←− string.replace(“%s”, lowerCase(subject), option.decision)
endendelse if string.find(“%S”, option.decision) then
chatText←− string.replace(“%s”, subject, option.decision)endelse if string.find(“%g”, option.decision) then
if subject = I thenchatText←− “Maybe” + subject+ “should go to” + targetMap
endelse
chatText←− “Maybe” + lowerCase(subject) + “should go to” + targetMapend
endelse if ¬string.find(“%”, option.decision) then
chatText←− option.decisionend
71
/* The process of novelty seeking is similar for the other traits */
biggestV alue←− max(option.NS, option.HA, option.RD, option.Pers, option.SD, option.Co)if biggestV alue = option.NS then
if subject = I thenoption.NSdecision←− string.replace(“%ps”, “mine”, option.NSdecision)option.NSdecision←− string.replace(“%pr”, “me”, option.NSdecision)option.itNSdecision←− string.replace(“%ps”, “mine”, option.itNSdecision)option.itNSdecision←− string.replace(“%pr”, “me”, option.itNSdecision)
endelse if subject = We then
option.NSdecision←− string.replace(“%ps”, “ours”, option.NSdecision)option.NSdecision←− string.replace(“%pr”, “us”, option.NSdecision)option.itNSdecision←− string.replace(“%ps”, “ours”, option.itNSdecision)option.itNSdecision←− string.replace(“%pr”, “us”, option.itNSdecision)
endelse if subject = Y ou then
option.NSdecision←− string.replace(“%ps”, “yours”, option.NSdecision)option.NSdecision←− string.replace(“%pr”, “you”, option.NSdecision)option.itNSdecision←− string.replace(“%ps”, “yours”, option.itNSdecision)option.itNSdecision←− string.replace(“%pr”, “you”, option.itNSdecision)
endelse if subject = It then
option.NSdecision←− string.replace(“%ps”, “its”, option.NSdecision)option.NSdecision←− string.replace(“%pr”, “it”, option.NSdecision)option.itNSdecision←− string.replace(“%ps”, “its”, option.itNSdecision)option.itNSdecision←− string.replace(“%pr”, “it”, option.itNSdecision)
end
72
if string.find(“%0”, option.NSdecision) then
else if subject = It and ¬string.find(“%g”, option.itNSdecision) thenchatText←− chatText+ option.itNSdecision
else if string.find(“%s”, option.NSdecision) thenif subject = I then
chatText←− chatText+ string.replace(“%s”, subject, option.NSdecision)
/* lowerCase converts all characters in argument1 to lowercase */
elsechatText←− chatText+ string.replace(“%s”, lowerCase(subject),option.NSdecision)
else if string.find(“%S”, option.NSdecision) thenchatText←− chatText+ string.replace(“%s”, subject, option.NSdecision)
else if string.find(“%g”, option.NSdecision) thenif subject = It then
if subject = I thenchatText←− “Maybe” + subject+ “ can find something new”.
elsechatText←− “Maybe” + lowerCase(subject) + “ can find something new”.
elsechatText←− chatText+ subject+ “ seems there′s something interesting there”.
else if ¬string.find(“%”, option.NSdecision) thenchatText←− chatText+ option.NSdecision
73
B.3 Combat value algorithm implementation
Algorithm B.3: Chance value calculationBegin
companion←− getCurrentCompanion()harmAvoidance←− companion.harmAvoidancerewardDependence←− 1 - companion.rewardDependencepersistence←− 1 - companion.persistenceselfDirectedness←− 1 - companion.selfDirectednesscooperativeness←− 1 - companion.cooperativeness
/* clamp function limits a real or integer value by min and max values */
harmAvoidance←− clamp(harmAvoidance, 0, 1)rewardDependence←− clamp(rewardDependence, 0, 1)persistence←− clamp(persistence, 0, 1)selfDirectedness←− clamp(selfDirectedness, 0, 1)cooperativeness←− clamp(cooperativeness, 0, 1)
/* It is not possible to determine if the current fight goes according to the
companion’s objective, so the ratio of self-directedness is also lowered */
harmAvoidance←− harmAvoidance ∗ 0.3rewardDependence←− rewardDependence ∗ 0.2persistence←− persistence ∗ 0.2selfDirectedness←− selfDirectedness ∗ 0.1coperativeness←− coperativeness ∗ 0.2runningChanceV alue←−harmAvoidance+ rewardDependence+ persistence+ selfDirectedness+ cooperativeness
74
/* max function finds between the received arguments (real or integer) the
largest value */
biggestV alue←−max(harmAvoidance, rewardDependence, persistence, selfDirectedness, cooperativeness)/* biggestValue variable will allows us to determine which trait caused the
companion to avoid combat */
if biggestV alue = harmAvoidance thenif numberOfenemies > 2 then
setCombatComment(“There are too many of them.”)
elsesetCombatComment(“It is too dangerous.”)
else if biggestV alue = rewardDependence thensetCombatComment(“It is not worth it.”)
else if biggestV alue = persistence thensetCombatComment(“I am tired, give me a second.”)
else if biggestV alue = selfDirectedness thensetCombatComment(“I have nothing to do with this.”)
else if biggestV alue = cooperativeness thensetCombatComment(“It is your problem, I cannot help you.”)
/* rand function returns a random real number between the min and max values */
randomNumber ←− rand(0, 1)
/* the combat comment will only be said by the companion, if running from
combat is set to true */
if randomNumber > runningChanceV alue thensetRunningFromCombat(false)
elsesetRunningFromCombat(true)
75