/Projects/Jazzbot

Jazzbot

What is Jazzbot?

Jazzbot screenshot

Jazzbot is a virtual agent embodied in a simulated 3D environment of the firstperson shooter computer game Nexuiz. It is a goal-driven BDI inspired cognitive agent developed with the Jazzyk language. The Nexuiz death-match game takes place in a virtual building containing various objects (e.g. weapons, flags or armor kits), is capable of simulating diverse terrains like solid floor, or liquid and provides a basic means for inter-player interaction. Because of its accessibility (Nexuiz is published under the open source GNU GPL licence), we chose the Nexuiz game server as the simulator for Jazzbot case-study, the first larger proof-of-concept application for the Jazzyk BSM framework.

Jazzbot’s behaviour is implemented as a Jazzyk program. In the experimental scenario, the bot searches for a particular item in the environment, which it the picks up and delivers to the base point. While during the search phase the agent tries to always move to unexplored segments of the environment, when it tries to deliver the item, it exploits a path planning algorithm to compute the shortest path to the base point. Hence, during the search phase, in every step the bot randomly selects a direction to move to a previously unexplored part of the building and in the case there is none such, it returns to the nearest waypoint from which an unexplored direction exists. The behaviour for environment exploration is interrupted, whenever Jazzbot feels under attack, i.e. an enemy player attempts to shoot at it. Upon that it triggers emergency behaviours, such as running away from the danger. After the sense of emergency fades away, it returns back to its previously performed goals of item search, or delivery. The Jazzbot’s control cycle consists of three steps that are executed sequentially. Firstly, the bot reads its sensors (perception), then if necessary it deliberates about its goals, (goal commitment strategies implementation) and finally it selects an action according to its actual goals and beliefs (act). The following listing provides an example code implementing selection of goal oriented behaviours, realized as parametrized macros, triggered by Jazzbot’s goals.

define(‘ACT’,‘{
    /* Code snippet for actual behaviour selection */

    /∗ The bot searches for an item, only when it does not have it ∗/
    when query goals [{ task(search(X)) }] and not query beliefs [{ hold(X) }] then SEARCH(‘X’);

    /∗ When a searched item is found, it picks it ∗/
    when query goals [{ task(pick(X)) }] and query beliefs [{ see(X) }] then PICK(‘X’) ;

    /∗ When the bot finally holds the item, it deliver it ∗/
    when query goals [{ task(deliver(X)) }] and query beliefs [{ hold(X) }] then DELIVER(‘X’) ;

    /∗ Simple behaviour triggers without guard conditions ∗/
    when query goals [{ task(wander) }] then WALK ;
    when query goals [{ task(safety) }] then RUN AWAY ;
    when query goals [{ task(communicate) }] then SOCIALIZE
}’)

While the bot simply triggers behaviours for walking around, danger aversion and social behaviour, execution of behaviours finally leading to getting an item are guarded by belief conditions. The following Figure provides an overview of the Jazzbot’s architecture.

Jazzbot architecture

The agent features a belief base consisting of two KR modules for representation of agent’s actual beliefs and storing the map of the environment, a goal base encoding interrelationships between various agent’s declarative, performance and maintenance goals and finally the module interfacing the bot with the simulated environment. JzNexuiz KR module, the Jazzbot’s interface to the environment, the body, provides the bot with capabilities for sensing and acting in the virtual world. The bot can move forward, backward, it can turn, or shoot. Additionally, the Jazzbot is equiped with several sensors: GPS, sonar, 3D compass and an object recognition sensor. The module communicates over the network with the Nexuiz game server and thus provides an interface of a pure client side Nexuiz bot, i.e. the bot can access only a subset of the perceptual information a human player would have available. The Jazzbot’s belief base is composed of two modules: JzASP and JzRuby. While the first one integrates an Answer Set Programming (ASP) solver Smodels and contains a logic program reflecting agent’s beliefs about itself, the environment, objects in it and other players, the second, based on an interpreted object oriented programming language Ruby, stores the map of the agent’s environment. The Jazzbot’s goal base is again an ASP logic program representing agent’s current goals and their interdependencies. Goals can be either of a declarative (goals-to-be), or performative nature (goals-to-do, or tasks). In Jazzbot agent implementation, each goal-to-do activates one, or more tasks, which in turn trigger, one or more corresponding behaviours the agent is supposed to execute. On the ground of holding certain beliefs, the agent is also allowed to adopt new, or drop goals which are either satisfied, irrelevant, or subjectively recognized as impossible to achieve. The agent thus implements goal commitment strategies.

Demo videos

The Jazzbot was first presented at the Dagstuhl seminar 08361. Below, we provide sample videos of Jazzbot in action.

Jazzbot moving

The following video sequence shows the Jazzbot moving around the first room of the virtual building and building up the map of the environment.

The map generated in this sequence roughly corresponds to the scheme in the following figure.

Search & explore

The task of the Jazzbot in the environment is to find the red object located in the first room. While in the first demo video above, the bot did not find the object, the following video shows a sequence in which the bot finally finds the red object rather straightforwardly.

Under attack

The final demonstration video sequence shows the Jazzbot under attack. The bot can only find out about itself being under attack, when its health level drops below a certain threshold. Therefore it takes the first few shots without noticing, while it correctly reacts by an attempt to escape to the last few. Although it is not clear enough that the bot tries to escape (it seeks a hideout by the wall, where it finds an unexplored pieces of environment), we can observe in the lower left corner log stream that it knows that it is under attack and the escape behaviour is active.