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.
-
If the bot kills the enemy and wants to type
a chat message, it will change to the "stand" leaf.
-
When the enemy just died or the bot killed
it and doesn't want to type a chat message, it will change to the "seek
long term goal" leaf.
-
The bot looks around for nearby items that
are useful. When such an item is found, the bot will change to the "battle
get item" leaf.
-
When the bot wants to retreat, it will change
to the "battle retreat" leaf.
-
When the bot can't see the enemy anymore and
wants to chase, it will change to the "battle chase" leaf.
-
When the bot doesn't want to chase and the
enemy isn't visible, it will change to the "seek long term goal" leaf.
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.
-
If the bot kills the enemy and wants to type
a chat message, it will change to the "stand" leaf.
-
When the enemy just died or the bot killed
it and doesn't want to type a chat message, it will change to the "seek
long term goal" leaf.
-
The bot looks around for nearby items that
are useful. When such an item is found, the bot will change to the "battle
get item" leaf.
-
When the bot doesn't want to retreat anymore
(for instance it picked up some nice items), it will change to the "battle
fight" leaf.
-
As soon as the bot can't see the enemy, it
will change to the "seek long term goal" leaf.
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.
-
When the enemy dies during the chase, the
bot will change to the "seek long term goal" leaf.
-
As soon as the bot can see the enemy, it will
change to the "battle fight" leaf.
-
The bot looks around for nearby items that
are useful. When such an item is found, the bot will change to the "battle
get item" leaf.
-
The bot also looks around for other nearby
enemies. When an enemy is found the bot will fight this new enemy. The
bot will change to the "battle fight" leaf.
-
When the bot doesn't want to chase anymore
(the bot could be hurt during the chase) it will change to the "seek long
term goal" leaf.
-
When the bot looses track of the enemy it
will change to the "seek long term goal" leaf.
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.
-
If the bot kills the enemy and wants to type
a chat message, it will change to the "stand" leaf.
-
When the enemy just died or the bot killed
it and doesn't want to type a chat message, it will change to the "seek
long term goal" leaf.
-
The bot looks around for nearby items that
are useful. When such an item is the bot will change to the "battle get
item" leaf.
-
If the enemy isn't visible for a while and
there are no other enemies around, the bot will change to the "seek long
term goal" leaf. When the enemy isn't visible and there is another nearby
enemy, the bot will retreat from this new enemy.
-
When the bot is "feeling" better (for instance
it has picked up several nice items) and doesn't want to retreat anymore,
it will change to the "battle chase" leaf.
-
When the bot is taking to long to retreat
or simply isn't able to retreat (for instance walked into a dead end) and
the enemy isn't visible, the bot will change to the "seek long term goal"
leaf. However when the enemy is still visible, the bot will change to the
"battle suicidal fight" leaf.
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.
-
If the bot kills the enemy and wants to type
a chat message, it will change to the "stand" leaf.
-
When the enemy just died or the bot killed
it and doesn't want to type a chat message, it will change to the "seek
long term goal" leaf.
-
When the item has been picked up, the bot
will change back to the previous leaf of the AI tree (one of the battle
leaves).
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.
-
During the travel the bot keeps looking for
nearby enemies. When an enemy is found, the bot will change to the "battle
fight" leaf.
-
When the bot wants to type a random chat message,
it will change to the "stand" leaf.
-
The bot looks around for reachable items or
structural system it wants to use. When something the like is found, the
bot will change to the "seek get item" leaf.
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.
-
The bot looks around for nearby enemies. When
an enemy is found, the bot will change to the "battle get item" leaf.
-
The bot will move towards the nearby goal
until the item is picked up or the structural system is reached or activated.
Then the bot will return to the "seek long term goal" leaf.
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.
-
The bot will look around for nearby enemies.
When an enemy is found, the bot will change to the "battle fight" leaf.
-
When the time has lapsed the bot will change
to the "seek long term goal" leaf.
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.