home about ideas indie games non-digital games other creative outlets contact
Masters Code: Jenn Sandercock's Demos

Masters thesis code

My thesis work was based on agent-oriented programming, particularly the BDI paradigm. In this paradigm an agent is said to have Beliefs (what they think the world is like), Desires (what they want the world to be like), and Intentions (commitments to achieve specific desires using methods/plans). The aim of my research was to take simple personalities for characters and improve the depth of the characters by allowing them to learn their own preferences for individual plans. The work is inspired by Damasio's somatic marker hypothesis that states that when we (as humans) are faced with a decision with many options we automatically use gut instinct to narrow down our options into "good" options and "bad" options.

[An incoming event triggers a choice between available plans;
    A plan is executed (which may cause more choices); and then the plans that finished
    are evaluated for success]

In order to implement this, the characters need to use an execution loop that forces them to evaluate the success or failure of plans that they execute, see diagram above. An incoming event from either the agent itself or a request from another agent causes the agent to consider which plans can handle the event. (Note: In the JACK programming language events and goals are interchangeable words.) If there is more than one plan that can handle the event, then the agent must choose between them. It does this using the Appraisal of Choices plan, which considers the agent's preference (somatic marker) for each plan it could choose between and then chooses a plan according to Damasio's somatic marker hypothesis. The somatic marker hypothesis is a psychological theory of how we (as humans) make decisions using our "gut instinct".

After the agent has chosen a plan, it executes it. This may cause the agent to make further choices using the same process as above. After the top-level plan has finished execution, the agent needs to evaluate whether the plans and sub-plans it executed actually helped it achieve its personal desires (called soft goals in my work). This allows it to determine whether the plans it choose were "good" or "bad" and so update its preference (somatic marker value) for the plans chosen.

The code is written for the JACK programming language (which has a Java base) available through AOS. Here are the links to the two main pieces of code that do most of the work:

The code is generic for any domain and acts similarly to AI Middleware. To build a specific domain the characters need to have multiple plans that achieve the same goal (e.g. to make friends I could talk to someone, buy something for someone and so on...). These plans are then specified to use the Appraisal of Choices plan and the character will automatically build up their own preferences (somatic markers) for future actions. To test the theory an example domain was built based on characters trying to be popular, see thesis demo page for more information about the specific domain used. For more detail about the masters thesis and this theory, please look at the thesis overview page.