7. AI tree

7.1 The tree

The Omicron bot uses a tree like structure as the core of the AI.
 

          AI tree with green leafs and yellow nodes
 

The leaves of this tree represent actions the bot can perform. Mostly these actions deal with moving towards a nearby goal.
A leaf has a procedure which gives the bot the ability to perform the specific action. This procedure uses several elementary actions like "moving towards a goal", "aiming at an enemy", "shooting" etc.
The actions represented by the leaves of the tree are fully separate. For instance a bot can't chase and retreat at the same time. As a result the bot always executes only one of the procedures of a leaf at a time. However, it is possible to change from one leaf to another. In other words the bot is able to stop the current action and start another. Changing from one leaf to another is done by following the paths in the tree. When a node is encountered certain settings are initialized.
 

7.2 The leaves

Analyzing the actions of human players in the Quake environment it is possible to distinguish several different ones. These actions are represented by the leaves of the AI tree the bot uses. The actions are more or less character independent. However the decision to switch from one leaf to another is mostly fully or partly depending on the character of the player.

The procedures of all the leaves used in the AI tree of the bot are described below. There is a description of the action(s) the bot will perform followed by the conditions for changes to other leaves.
 

Battle fight

The bot will fight with the enemy. Attack movements will be performed to confuse the enemy and to make it difficult for the enemy to aim. The bot will also aim and try to shoot at the enemy.

Battle suicidal fight

The bot will fight with the enemy. Attack movements will be performed to confuse the enemy and to make it difficult for the enemy to aim. The bot will also aim and try to shoot at the enemy.

Battle chase

In this leaf the bot has a chase goal, an enemy that it can't see. The bot follows waypoints leading towards the enemy.

Battle retreat

In this leaf the bot has a retreat goal. The bot will follow waypoints to get as far away as possible from the enemy. The bot will also aim and try to shoot at the enemy during the retreat. When the enemy the bot is retreating from isn't visible anymore the bot will look around for other enemies and take a new enemy when found.

Battle get item

The bot will move towards a nearby item during the battle. The bot will also aim and try to shoot at the enemy.

Seek long term goal

In this leaf the bot travels towards a normal long term goal, walkabout goal or a sound goal. The bot moves towards a waypoint that is leading to the long term goal. When at a certain point the bot can't find any more waypoints leading to the long term goal it will use a roam goal. When the long term goal has become invalid for some reason (for instance the bot used to many roam goals) or it is reached,  the bot chooses a new normal long term goal. When no such a goal is found the bot chooses a walkabout goal.  When the bot has a walkabout goal it continuously listens to sounds from possible enemies. When a sound is heard and could be located the bot will take the position of the sound as new long term goal.

Seek get item

The bot will move towards a nearby item or nearby structural system. During the movement towards the item the bot looks around for more interesting items or structural systems that have become reachable. When something is found the bot will take the new item or structural system as nearby goal.

Stand

This leaf is used, when the bot just enters the game, respawns or when it types a message. When the bot enters the game or respawns, it stands for a very short moment and doesn't do anything. When the bot has decided to type a chat message, it will also use the "stand" leaf. Before changing to the "stand" leaf, the bot has chosen one of the predefined chat messages and knows an estimate period of time a human would take typing the message. The bot just stands for this period of time and enters the message when the time has lapsed.

Intermission

In this leaf the bot isn't doing anything. The intermission is at the end of a game. The players can see the score and after a short period of time the game restarts. During the intermission a player can't do anything and the bots also won't try to do anything.