Cognitive Models for Virtual Characters

Several diploma workers have focused on this project, working together to developing an extensive agent architecture that can be used for very diverse scenarios. The architecture focuses on using emotions and expectations to aid the agent in its decisions.

The aim is to create a dynamic and high-level intelligent agent structure that can be used for many different kinds of applications. Below can be seen the basic structure of the current architecture.

Agent Architecture Modules

XML Interface
The XML interface is not a part of the agent architecture but acts as a middle layer and communicator between the game engine and the agent. Because we want our architecure to be independent of rendering engine and game engine, the xml interface translates engine specific data to XML that the agent can understand.

It is no possible for a human to acknowledge everything that she has percieved. The perception module acts as a filter on the incoming information. It filters the information from the game state with the help of emotions, special interests and goals. It also mimics the visual accuity of the agent, taking into account things like distance to the object seen and color of the object.

The appraisal evaluates the information that the agent has percieved and triggers emotions accordingly. For instance, if an agent sees a wolf approaching, the appraisal module will trigger fear.
The appraisal also manages the agents expectations; checking whether they have been fulfilled and triggering emotions given the result.

Knowledge Base
The main purpose of the knowledge base is to store information. This information can be memories, ideas, expectations etc. We use the Prolog-based XSB system to store information. Because of its logical nature, it is also possible to performs reasoning using the information in the knowledge base. This module is currently being rewritten.

This module manages the emotions once they are triggered. The emotions are represented as mathematical signals (we use a Sigmoid curve). They interact through a sofisticated filtering system. This can give effects such as fear inhibiting other emotions.

Trust towards other agents is managed in this module. Trust is divided into four parts: ability, predictability, integrity and dependability. In our model emotions affect trust, enabling a rich and varied behavior.

Action Selection
As the name implies, it is in the action selection module that decisions are taken on what actions to perform (mostly external actions, but internal actions also possible). We use a modified version of the Extended Behavior Network. Energy is spread through a network of goals and possible actions. In short, the action with the highest energy will be the action chosen for execution. The action selection module uses emotions both explicitly and implicitly in the behavior network.

Action Management
This modules takes the output of the action selection (which is usually something abstract, such as "explore" or "find food") and turns it into a series of simpler actions. This module should also take care of such things as pathfinding. This module controls which animations that should be run in the animation controller.

Animation Controller
The animation controller controls the agent's skeleton animation. It consists of a set of possible skeletel animations that can be blended together to vary with e.g. emotions.

Future Research

We are interested in extending the current agent architecture with the following parts:
  • Reasoning
  • Action Management
    • Path finding
  • Memory management
    • Improved memory storage
    • Long/Short term memory and forgetting
  • Extension to behavior network
  • Prediction
  • Inter-agent communication
    • Information exchange
    • Co-operation
    • Sharing of goals and values
    • Forming societies

Diploma Works

This project opens up great opportunities for diploma works. Students interested in doing their final projects within any of these areas are encouraged to contact Pierangelo Dell'Acqua for more information. Other areas than the ones mentioned here may also be of interest to us.

Currently we are interested in the following areas:
  • Social behavior
    We want the agents to be able to have social interaction, to form groups, to share goals, etc.
  • Prediction
    The agent should be able to predict what another agent will do. For instance, if an enemy is running towards the agent, the agent should be able to predict that the enemy is about to attack.
  • Morality
    The agent should have a sense of morals and ethics that influence its decisions.
  • Spacial reasoning
    We want the agent to be able to reason about the environment on a higher abstraction level than pure geometry.
  • Communication
    Agents should be able to communicate with each other and with the player.

Completed Diploma Works
  • Design of a computational model for morality and emotions in EmoBN, Henry Fröcklin, 2014
  • Design and Implementation of an Appraisal Module for Virtual Characters, Petter Grundström (MT), May 2012
  • Learning in Emotional Behavior Networks, Oscar Djupfeldt (MT) and Jonathan Wahlström (MT), March 2010
  • Skeletal Based Animation for Emotional Virtual Characters, Ruman Zakaria (ACG), Nov 2008
  • A Modular API for Intelligent Virtual Agents, Daniel Franzen (MT), Jan 26th, 2007
  • EMO - A Computational Emotional State Module. Emotions and their influence, Jimmy Esbjörnsson (ACG), May 2007
  • Modelling Expectations and Trust in Virtual Agents, Anja Johansson (MT), June 2007
  • A Modular API for Intelligent Virtual Agents, Daniel Franzen (MT), Jan 26th, 2007


  • Anja Johansson and Pierangelo Dell'Acqua. Affective States in Behavior Networks. In Dimitri Plemenos and Georgios Miaoulis, editors, Intelligent Computer Graphics 2009, volume 240 of Studies in Computational Intelligence, chapter 2, pages 19-39. Springer Berlin / Heidelberg, 2009.
  • Anja Johansson and Pierangelo Dell'Acqua. Introducing Time in Emotional Behavior Networks. In proceedings of 2010 IEEE Conference on Computational Intelligence and Games, CIG'10, pages 297-304, Copenhagen, Denmark, August 18-21 2010.
  • Anja Johansson and Pierangelo Dell'Acqua. Knowledge-Based Probability Maps for Covert Pathfinding. In Ronan Boulic, Yiorgos Chrysanthou, and Taku Komura, editors, Motion in Games, volume 6459 of Lecture Notes in Computer Science, pages 339-350. Springer Berlin / Heidelberg, 2010.
  • Petri Lankoski, Anja Johansson, Benny Karlsson, Staffan Björk, and Pierangelo Dell'Acqua. AI Design for Believable Characters via Gameplay Design Patterns. Business, Technological, and Social Dimensions of Computer Games: Multidiciplinary Developments, chapter 2, pages 15-31. IGI Global, 2011.
  • Anja Johansson and Pierangelo Dell'Acqua. Pathfinding with Emotion Maps. In Dimitri Plemenos and Georgios Miaoulis, editors, Intelligent Computer Graphics 2011, volume 374 of Studies in Computational Intelligence, pages 139-155. Springer Berlin / Heidelberg, 2012.
  • Anja Johansson and Pierangelo Dell'Acqua. Comparing Behavior Trees and Emotional Behavior Networks for NPCs. In proceedings of 17th International Conference on Computer Games: AI, Animation, Mobile, Interactive Multimedia, Educational & Serious Games, CGAMES'12, 2012.
  • Anja Johansson and Pierangelo Dell'Acqua. Emotional Behavior Trees. In proceedings of IEEE Conference on Computational Intelligence and Games, CIG'12, 2012.
  • Anja Johansson and Pierangelo Dell'Acqua. Realistic Virtual Characters in Treatments for Psychological Disorders - an extensive agent architecture. In SIGRAD'07: Computer Graphics in Healthcare, pages 46-52. Linköping University Electronic Press, November 2007.