Figures - uploaded by J.M.P. Van Waveren
Author content
All figure content in this area was uploaded by J.M.P. Van Waveren
Content may be subject to copyright.
Discover the world’s research
- 25+ million members
- 160+ million publication pages
- 2.3+ billion citations
II
The Quake III Arena Bot
by J.M.P. van Waveren
June 28
th
2001
Revision 1
University of Technology Delft
Faculty ITS
III
The Quake III Arena bot is an artificial player for the computer game Quake III Arena.
This document is copyright 2001 by J.M.P. van Waveren, all rights reserved.
Quake III Arena™, the QIIIA™ logo, the id™ logo and the id Software™ name are
tradem…
Figures - uploaded by J.M.P. Van Waveren
Author content
All figure content in this area was uploaded by J.M.P. Van Waveren
Content may be subject to copyright.
Discover the world’s research
- 25+ million members
- 160+ million publication pages
- 2.3+ billion citations
II
The Quake III Arena Bot
by J.M.P. van Waveren
June 28
th
2001
Revision 1
University of Technology Delft
Faculty ITS
III
The Quake III Arena bot is an artificial player for the computer game Quake III Arena.
This document is copyright 2001 by J.M.P. van Waveren, all rights reserved.
Quake III Arena™, the QIIIA™ logo, the id™ logo and the id Software™ name are
trademarks of id Software, Inc., Mesquite, Texas.
All other trademarks are properties of their respective owners.
c
IV
Abstract
Games play an important role in the field of artificial intelligence (AI). They offer an
environment to test ideas about human reasoning, problem solving and other human
abilities. The ultimate goal of AI is to create an artificial man. Games offer the
opportunity to create artificial players which are modeled after human beings. Playing
the game, human beings can interact with these artificial creatures and experience how
well these creatures show human-like behaviour.
Quake III Arena is a computer game that belongs to the genre of first person shoot-em
up games. The player views from a first person perspective and moves around in a real-
time 3D virtual world. The most important tasks are staying alive and eliminating
opponents within this virtual world. These opponents are other people, equal in strength
and abilities, connected to the same game through a network or the Internet. The game
has a set of different virtual environments called levels or maps, that contain rooms and
hallways. The players have a whole range of weapons, items and powerups available to
aid in the battles that take place in these maps. Quake III Arena offers various ways to
play the game including team based gameplay modes.
This thesis presents the Quake III Arena bot which is an intelligent artificial player
emulating a human player in the game environment. This artificial player is often called a
bot as an abbreviation for the word robot. With this bot everyone can enjoy the game
and practice, without the need for a network connection to other people. The bot is an
artificial player that only ‘lives’ inside the computer, side by side with the game. The bot
receives information about the game environment directly from the game program as a
set of variables. The game input from the bot is also sent directly to the game program.
Although the bot only ‘lives’ inside the computer, the ingame behaviour of the bot has to
be hard to distinguish from the behaviour of human players. To make the game more
enjoyable and more versatile, a range of different bot characters is used that each play
the game in their own style, and provide different challenges for the human player.
To show human-like behaviour a wide range of techniques and common sense solutions
are used for the bot AI. The Quake III Arena bot is the first commercially developed
artificial player that uses fully automated path and route finding through arbitrary
complex 3D polygonal worlds, without the need for the bot to acquire knowledge about
routing and navigation during gameplay. No human intervention is required to provide
the bot with all the information needed to navigate through, and understand new game
environments. The bot uses a volume (area) based representation of the 3D game
environment, which serves as a back-bone for the bot’s cognitive world model. Together
with a high performance path finding solution this cognitive model makes the bot rather
resource efficient.
Key words and phrases: Quake III Arena bot, Quake3 bot, artificial player, artificial
intelligence, automated route finding through polygonal worlds, navigation through
polygonal worlds, hierarchical routing.
V
Acknowledgements
First of all, my thanks to id Software for making some of the best and most addictive
games, and giving me the freedom to make the Quake III Arena bot reality as I deemed
best.
Thanks to my supervisor and mentor at the University of Technology in Delft the
Netherlands, drs. dr. L.J.M. Rothkrantz, for support, encouragement and inspiration.
It has always been a pleasure working with Miklos de Rijk. My thanks and appreciation
to him for lots of input, feedback and bringing previously developed bots ‘alive’ with
characters and ideas.
I would like to thank Alan [Strider] Kivlin for being a great sounding board and source of
inspiration.
Special thanks to some of the best students at the university, Ronald Kroon, Edward van
Bilderbeek and Karin de Boer. Both as friends and colleagues they have made life at the
university a lot more enjoyable. Also my appreciation to them for keeping up with my
mindless chatter.
Thanks to William van der Sterren for inspiration with his work on Computer Generated
Forces (CGF) and for his many suggestions to this thesis.
Last but not least I am greatful to my family and friends for their love and
encouragement.
J.M.P. van Waveren
June 28
th
2001
VI
Contents
1. Introduction ................................................................................................................................1
1.1 Quake III Arena ........................................................................................................................................................... 1
1.2 Artificial player............................................................................................................................................................. 1
1.3 Cognitive model........................................................................................................................................................... 2
1.4 Domain knowledge...................................................................................................................................................... 3
1.5 Knowledge acquisition................................................................................................................................................. 4
1.6 Bot behaviour .............................................................................................................................................................. 4
1.7 Perfect simulation vs. enjoyable opponent................................................................................................................... 5
1.8 Generic vs. map specific knowledge............................................................................................................................ 6
1.9 Overview ..................................................................................................................................................................... 7
2. Requirements .............................................................................................................................8
3. Background ................................................................................................................................9
3.1 Robots......................................................................................................................................................................... 9
3.2 Path finding.................................................................................................................................................................10
3.3 Finite state machine....................................................................................................................................................11
3.4 Fuzzy logic .................................................................................................................................................................12
3.5 Neural networks..........................................................................................................................................................13
3.6 Expert systems...........................................................................................................................................................14
3.7 Genetic algorithms......................................................................................................................................................15
4. Related work.............................................................................................................................16
4.1 FPS games & AI.........................................................................................................................................................16
4.2 Previous work.............................................................................................................................................................18
4.2.1 Omicron bot.............................................................................................................................................................19
4.2.2 Gladiator bot............................................................................................................................................................20
5. Bot Architecture.......................................................................................................................21
5.1 Layered architecture...................................................................................................................................................21
5.2 Information flow..........................................................................................................................................................22
5.3 Structure of game engine............................................................................................................................................23
6. Area Awareness System .........................................................................................................24
6.1 AAS............................................................................................................................................................................24
6.2 Creating areas............................................................................................................................................................25
6.3 Environment sampling................................................................................................................................................32
6.4 Reachability................................................................................................................................................................34
6.5 Routing.......................................................................................................................................................................40
6.6 Entities........................................................................................................................................................................46
7. Basic Actions ...........................................................................................................................47
7.1 Human and Bot Input Interface...................................................................................................................................47
7.2 Actions........................................................................................................................................................................47
VII
8. Bot Characters .........................................................................................................................49
8.1 Characters..................................................................................................................................................................49
8.2 Characteristics............................................................................................................................................................50
9. Bot Decisions & Preferences..................................................................................................52
9.1 Fuzzy Logic................................................................................................................................................................52
9.2 Representation...........................................................................................................................................................52
9.3 Preferences................................................................................................................................................................54
9.4 Genetic Selection........................................................................................................................................................56
10. Bot Chats ................................................................................................................................57
10.1 Communication with text...........................................................................................................................................57
10.2 Interpreting text sentences........................................................................................................................................57
10.3 Initiating chats and Eliza chats..................................................................................................................................59
10.4 Chat reasoning.........................................................................................................................................................63
11. Bot Goals ................................................................................................................................65
11.1 Ingame goals............................................................................................................................................................65
11.2 Short term goals .......................................................................................................................................................65
11.3 Long term goals........................................................................................................................................................66
12. Bot Navigation........................................................................................................................67
12.1 Moving towards a goal..............................................................................................................................................67
12.2 Moving in a direction.................................................................................................................................................68
13. Bot Fighting............................................................................................................................69
13.1 Acquiring an enemy..................................................................................................................................................69
13.2 Using weapons.........................................................................................................................................................69
13.3 Movement.................................................................................................................................................................71
14. Obstacles and puzzles ..........................................................................................................72
14.1 Obstacles .................................................................................................................................................................72
14.2 Solving Puzzles........................................................................................................................................................72
15. AI network...............................................................................................................................75
15.1 The network..............................................................................................................................................................75
15.2 The nodes.................................................................................................................................................................76
16. Bot Commands.......................................................................................................................80
16.1 Interpreting chat messages.......................................................................................................................................80
16.2 Commands...............................................................................................................................................................81
16.3 Questions.................................................................................................................................................................84
VIII
17. Team AI ...................................................................................................................................85
17.1 Individual team AI.....................................................................................................................................................85
17.2 Team leader .............................................................................................................................................................85
18. Implementation & tests .........................................................................................................87
18.1 Implementation.........................................................................................................................................................87
18.2 Bot characters ..........................................................................................................................................................87
18.3 AAS & Maps.............................................................................................................................................................88
18.4 AAS visualisation......................................................................................................................................................89
19. Conclusion..............................................................................................................................90
19.1 Bots..........................................................................................................................................................................90
19.2 AAS..........................................................................................................................................................................91
19.3 Future directions.......................................................................................................................................................91
20. References..............................................................................................................................93
20.1 Books and articles ....................................................................................................................................................93
20.2 Websites...................................................................................................................................................................94
20.3 Previous work...........................................................................................................................................................95
A. Quake III Arena ........................................................................................................................97
A.1 Getting about..............................................................................................................................................................97
A.3 Environmental hazards...............................................................................................................................................98
A.4 Structural systems......................................................................................................................................................99
A.5 Weapons..................................................................................................................................................................100
A.6 Items & Powerups....................................................................................................................................................103
A.7 Deathmatch..............................................................................................................................................................105
A.8 Teamplay.................................................................................................................................................................105
A.9 Capture the Flag.......................................................................................................................................................105
B. Bots.........................................................................................................................................106
C. Terms and abbreviations......................................................................................................108
IX
List of figures
1.1 View in Quake III Arena.
1.2 Cognitive model.
1.3 Turing test.
3.1 Maze with waypoints represented by dots.
3.2 FSM for a light switch.
3.3 Simple FSM for a bot.
3.4 Example of a neural network.
4.1 Wolfenstein 3D, 1993 by id Software
4.2 Doom, 1994 by id Software
4.3 Duke Nukem 3D, 1995 by 3D Realms
4.4 Quake, 1996 by id Software
4.5 Quake II, 1997 by id Software
4.6 Unreal, 1998 by Epic
4.7 Half-Life, 1999 by Valve Software
4.8 Unreal Tournament, 1999 by Epic
4.9 Omicron bot.
4.10 Quake map with waypoints
4.11 Gladiator bots.
5.1 Layered architecture.
5.2 Information flow through layers.
5.3 Integration of bot AI with the game engine.
6.1 Bounding box on cube shaped brush.
6.2 Expanded cube shaped brush.
6.3 Mins and maxs vector in a bounding box.
6.4 2d view of a bounding box colliding with a brush.
6.5 Bounding box on wedge.
6.6 Expanded wedge.
6.7 Beveled wedge.
6.8 BSP tree of four brushes.
6.9 Three brushes.
6.10 Three expanded brushes with overlap.
6.11 Two adjacent brushes.
6.12 Area with gap.
6.13 Area subdivided around a gap.
6.14 Trace subdivided by a BSP tree.
6.15 Step.
6.16 Step with low water.
6.17 Low water onto step.
6.18 Barrier.
6.19 Barrier with low water.
6.20 Step down.
6.21 Ledge.
6.22 Ledge with water.
6.23 Ledge with obstacle.
6.24 Water jump.
6.25 Water jump with low water onto floor.
6.26 Jump reachability.
6.27 Clusters separated by portals.
6.28 Entities linked into areas.
9.1 Teleporter item.
9.2 Lightning gun.
9.3 Lightning gun fuzzy weight.
11.1 Two items which can be goals.
11.2 A bot camping.
X
11.3 A flag in a CTF game.
12.1 Route through areas (only area ground faces are shown).
13.1 Enemy in fog.
13.2 Shooting projectiles at both sides of a pillar.
14.1 Top down view of a puzzle.
15.1 AI network.
15.2 C code for “Battle Fight” AI node.
17.1 Four states of a CTF game.
18.1 Area underneath arch.
18.2 Jump reachability.
18.3 Jump pad reachability.
1. Introduction Quake III Arena Bot 1
1. Introduction
1.1 Quake III Arena
Quake III Arena belongs to the genre of the first person shoot-em up games. A player
views from a first person perspective and moves around in a real-time 3D virtual world.
The most important tasks are staying alive and eliminating opponents within this virtual
world. These opponents are other people, equal in strength and abilities, connected to
the same game through a network or the Internet. The players have a whole range of
weapons, items and power-ups available to aid in the battles. The game has a set of
different virtual environments called levels or maps, that contain rooms and hallways.
The battles in the game take place within these maps much like gladiators fight in an
arena. Players can score points by taking out other players. When killed, a player
respawns at one of the designated locations on the map and can continue to fight.
Quake III Arena also has several team oriented gameplay modes. In normal teamplay
there are two teams with players that fight each other. The team with the highest
accumulated score, of all players on that team, wins. There is also a Capture The Flag
(CTF) team based game mode. Again there are two teams with players. Each team has
a base structure in the game world or map. A flag is positioned in such a base. A team
scores points by capturing the flag of the opposing team and bringing it back to their own
flag in their own base. More detailed information about the game can be found in
appendix A. However playing Quake III Arena is probably the best way to acquire a
better understanding of a lot of concepts in the game.
1.2 Artificial player
The Quake III Arena bot is supposed to act like a human player in the virtual world of the
game. The bot replaces the need for other people to connect to the game. Just like a
player can play the game with multiple other people the game can be played with one or
more bots. To make the game more enjoyable and more versatile, a range of different
bot characters is used that each play the game in their own style, and provide different
challenges for the human player. In order to act like a human player the bot does not
only need to understand the rules of the game and how the game works. The bot also
needs basic abilities like navigating through the game environments, picking up items
and handling weapons. Quake III Arena includes team based game modes like regular
teamplay and Capture The Flag (CTF). The bot has to be able to play these game types
and has to operate in teams. In order to operate in a team, with both human players and
other bots, the bot needs to communicate with other players.
The bot lives inside the computer next to the game program and only appears as a
human player in the game. The same (game) rules that apply to human players in the
game, also apply to the bot. The bot does however not use the same input and output
devices as human players. Instead of the output devices human players use, like the
computer’s monitor and sound card, the bot receives information about the virtual world
directly from the game program as a set of variables. The bot also does not use the
commonly used input devices like the keyboard and mouse. The bot sends a sequence
of actions or intentions directly to the game program. These actions however, are very
similar to the actions a human player can input using the computer’s input devices. The
1. Introduction Quake III Arena Bot 2
bot uses knowledge that has been provided in advance and knowledge acquired during
gameplay to construct such sequences of actions.
1.3 Cognitive model
People often use different representations to deal with or remember different aspects of
the environment they live in. Some people have a better visual memory. To remember
things more easily they can try to visualize things that do not have a visual
representation by default. Such different representations for different purposes are used
a lot throughout life. In the same way the bot needs its own cognitive model of the virtual
world it lives in. This internal model plays an important role in how the bot perceives and
understands the virtual world. In particular, the bot cannot notice aspects of the world
that are not represented within its cognitive model.
Figure 1.1: View in Quake III Arena. Figure 1.2: Cognitive model.
Usually the cognitive model used by a bot is a simplified version of the virtual world. If
the bot were to live in the real world it would simply not be feasible to create a perfect
model, because the real world is too complicated. Some of the models, available to
model the real world, are quite sophisticated and accurate, but there are too many
variables in play which, makes it infeasible to model the real world perfectly. Since the
virtual world resides somewhere inside the computer, just like the bot itself, it is up to
some degree possible for the bot to have a perfect model of this world. There can still be
factors from outside the virtual world, for instance entities beyond the game program’s
control like human players, but most of the virtual world works according to explicit rules
which can be modeled perfectly. However, a perfect model of the virtual world is usually
not desired for several reasons. It would be rather computationally time consuming to
use a model that simulates every single aspect of the virtual world. The required
computation time grows very fast when the bot wants to evaluate a number of alternative
courses of actions, and their influence on how the virtual world advances. Using a
perfect model can also result in unrealistic behaviour of the bot. A bot would be able to
look into the future and precisely predict what is going to happen. The bot would also be
omniscient and could easily manipulate other entities in the world, and in effect set the
world to its hand. However it is not desirable for the bot to have such an ability, not
common to human beings. Aside from these problems, the representation used for
simulating the virtual world is usually not suitable as a cognitive model for the bot. A
different model is required, which allows the bot to perceive and understand aspects of
the virtual world more easily.
stairs
stairs
stairs
Team mate
1. Introduction Quake III Arena Bot 3
For Quake III Arena the bot needs a cognitive model which allows the bot to represent
the things required for autonomous behaviour within the virtual world. In it’s simplest
form this internal model can be a set of variables that represent the current state of the
world. This state of the world includes the position of the bot, position of enemies and
items, the weapons the bot has gathered etc. To be able to navigate through the virtual
world and find certain locations in the virtual world the bot also needs a representation of
the level or map the bot is situated in. Not all aspects of the 3D environment need to be
included in such a representation. The bot will most likely care less about the textures
and colors on the walls of the rooms the bot navigates through. Of course such colors
might make opponents harder to spot, depending on their outfit, or perhaps have an
influence on the mood of a player. However such influences are often not found to be
significant enough to be taken into account.
1.4 Domain knowledge
For autonomous behaviour the bot also needs to maintain an explicit representation of
how the virtual world changes. This knowledge is referred to as domain knowledge, and
is required to reason about the effects of different sequences of actions. The reasoning
is necessary for the bot in order to select actions, that are useful within the game and
allow the bot to achieve certain goals. Human players often think intuitively about the
effects of actions and make a lot of implicit common sense assumptions. A bot does of
course not have this common sense by default. A certain level of domain knowledge and
common sense will have to be built into the bot.
The Quake III Arena bot needs at least a basic level of domain knowledge in order to
operate in the game. The bot needs to know about certain aspects of the virtual world
that advance continuously as time passes. For instance when items are picked up by a
player they will respawn within a certain amount of time. No effort from the bot is
required for items to respawn, this happens automatically. Also some platforms in the
environment continuously move up and down or back and forth. When the bot knows
about the things that continuously advance or change, the bot can predict when certain
items reappear, and the bot will know how long to wait before it can hop onto a platform
in order to ride it.
A lot of things in the environment only change due to actions from players. Usually such
actions only have an effect on other players, and little or no effect on the geometry of the
environment. For instance when a player fires a weapon, another player might be hit and
get damaged, which results in a loss of health for that player. However the walls, floors
and ceilings of rooms in the environment show no or little change due to the impact of
projectiles fired. Usually an impact marker is displayed where projectiles hit the wall, but
the geometric representation of such a wall does not change. This means the bot cannot
create shortcuts to other rooms by blowing up a wall. Sometimes actions do have an
effect on the geometry in the environment. Some doors and bars are opened by pushing
a button. In some cases the player has to walk up to such a button and press it, in other
cases the player needs to shoot at a button in order to activate it.
How other players are likely to behave in reaction to certain events in the game world is
also part of the domain knowledge. A player can perform certain actions in an attempt to
influence other players. The player could walk into the direction of a certain item in order
to make another player believe he is going for that item, but instead set a trap by waiting
just around a corner. This kind of strategic domain knowledge is usually much harder to
represent.
1. Introduction Quake III Arena Bot 4
1.5 Knowledge acquisition
The bot does not only need basic knowledge in advance to be able to operate in the
virtual world, the bot also has to acquire knowledge while playing the game. The current
state of the world is one of the simplest kinds of knowledge the bot can acquire. This
knowledge acquisition is referred to as sensing. Human players acquire knowledge
about the current state of the world through the output devices of the computer. The
player can look at the 3D image projected on the monitor and listen to sounds generated
by the computer’s sound card. To acquire more, or specific knowledge the player might
need to look around or walk to a certain location for a better view or better acoustics.
The bot ho