Cover ERCIM News 53

This issue in pdf
(60 pages; 9,6 Mb)

Cover ERCIM News 52
previous issue
(Number 52
January 2003):
Special theme:
Embedded Systems

all previous issues

Next issue:
July 2003

Next Special theme:
Applications and Platforms for the Mobile User

About ERCIM News

Valid HTML 4.01!

< Contents ERCIM News No. 53, April 2003

Enhancing Non Player Characters in Computer Games using Psychological Models

by Brian Mac Namee and Pádraig Cunningham

In the ever-growing research field of computer games, one of the main research areas is the creation of believable non-player characters. A part of the TCD Game AI Project, is furthering this research by creating a connectionist system for the simulation of social interactions amongst non-player characters based on psychological models of personalities, moods and relationships.

In modern computer games the level of graphical realism is so advanced that players can be led to believe that games are set within realistic game worlds. However, this illusion is often shattered as soon as the player begins interacting with computer controlled non-player characters (NPCs). The TCD Game AI Project at Trinity College Dublin is applying artificial intelligence and machine learning techniques to the problem of creating believable NPCs.

One of the areas in which NPCs are lacking is the kind of interactions in which they engage, both with other NPCs and players. An exception to this rule, The Sims (, has shown that games which make management of character interactions a focus of game play can be highly successful.
The µ-SIC system (which is a part of an agent architecture designed specifically for the creation of NPCs) uses quantitative psychological models to capture NPCs' personalities, moods and relationships. The values of these models are used as inputs to an artificial neural network (ANN), which drives characters' social behaviour causing them to perform interactions such as flirting, joking, and chatting

Modelling Personality, Mood & Relationships
In order to capture the important aspects of NPCs' personae the following quantitative psychological models are used:

  • Personality Model: To model NPCs' personalities Eysenck's classification model has been chosen. This plots personality across two orthogonal axes, introversion-extroversion and neuroticism-stability, allowing the creation of characters with personality types, such as aggressive, sociable and moody.
  • Mood Model: To simulate a character's mood a model from Lang is used. Agents' moods are measured according to valance and arousal, where valance refers to whether the mood is positive or negative, and arousal refers to the intensity of the mood.
  • Relationship Model: Agents' relationships are simulated using a model with its psychological basis in work undertaken by Wish. Typically this models plots the relationship between two characters across four axes: the amount that a particular character likes another character, physical attraction, dominance or submissiveness and intimacy. To facilitate conversation, this model has been augmented with a value indicating how interested one character is in another. A high interest rating indicates that characters share a number of common subjects of interest, and are thus more likely to converse.

Implementing the µ-SIC System
An ANN is used to transfer a particular set of a values for the models just described to a particular interaction for an NPC to engage in at a particular moment. The structure of the ANN used by µ-SIC (a multi-layer perceptron with a single hidden layer) is shown in figure 1. The network has been trained using an artificially created data set based on interactions predicted by a group of researchers.

Figure 1: The structure of the ANN used within µ-SIC.

In order to reduce the storage requirements of the µ-SIC system, only one copy of it is stored within a game engine. Whenever NPCs are free to begin an interaction they query this master copy of the µ-SIC system and so it can be considered an oracle that advises NPCs on how to behave.

Simulation Example Evaluation
To evaluate the performance of the µ-SIC system a simulation example (graphically represented in a very simple, cartoon style) which takes place in a small town has been constructed.

The simulation is populated by a range of NPCs, each of which has a personality defined using the Eysenck model. The system runs in real-time with NPCs moving between different locations performing day-to-day tasks such as going to work and visiting restaurants and bars. At various times during the simulation NPCs are free to perform interactions chosen by the µ-SIC system, which in turn cause their moods and relationships to adjust. A screenshot of the simulation running is shown in figure 2.

Figure 2: A screenshot of the simulation example demonstrating the µ-SIC system.
Figure 2: A screenshot of the simulation example demonstrating the µ-SIC system.

The µ-SIC system can be used as part of a larger agent architecture to allow computer game NPCs perform social interactions. These interactions are based on characters' personalities, moods and relationships which are captured using quantitative psychological models. Interactions are chosen using an ANN which has been trained to determine an appropriate interaction based on particular values of the models used. Within a simulation example created characters perform the full range of interactions which are always consistent with their personalities and current mood and relationships with other characters. To improve the system extra inputs will be added to the ANN. These include the last interaction performed by the character and values indicating NPCs' current locations which should block certain interactions. The system is also being integrated into the Trinity College Image Synthesis Group's ALOHA system, which performs sophisticated animation of virtual humans.


Please contact:
Pádraig Cunningham, Trinity College Dublin
Tel: +353 1 608 1136