copyright © 1997 mike warren
mbwarren@acs.ucalgary.ca
http://www.ucalgary.ca/~mbwarren
the Client-Side Quake Bot FAQ


If you have any suggestions for new questions or corrections to existing answers, please email me at mbwarren@acs.ucalgary.ca or use the feedback form.

Contents


FAQ Information

0.1 Copyright
All the content contained in this FAQ was created by Mike Warren (mbwarren@acs.ucalgary.ca) and is copyright © 1997. All rights reserved. Permission is granted to copy and redistribute this FAQ in any form provided it is not altered in any way and provided no money is received for said redistribution.

0.2 Availability

The FAQ is available at:

0.3 Disclaimer

This FAQ is intended to be accurate and up-to-date. However, the author cannot be held responsible for any untoward events stemming from information contained in this document.


General Questions

1.1 What is a client-side bot?
A client-side bot is a completely independent program written in a "real" language like C or C++ (opposed to quake-C) which connects to quake servers like a "real" quake client. Servers cannot distinguish[1] between an actual quake client and the fake quake clients which are client-side bots.

1.2 Why not use quake-C?

Quake-C, the interpreted language used by the Quake engine, is fairly robust, and bots have been written using it. However, client-side bots offer a few advantages: they can access files, hog all the CPU power on a machine and not bog down the server, and have far less ability to "cheat". See 3.1 What can client-side bots see?

1.3 What is a proxy-bot?

A proxy is a program which sits between the client and server and passes messages between the two. A proxy-bot (like Stooge Bot) does basically the same thing, with one important difference: it edits the packets, in Stooge's case it changes the client-to-server movement packets and aims for the player. Proxy-bots are usually frowned upon as "cheating".

1.4 What is a Quake Bot?

A Quake Bot is a program written to simulate a human player in id software's game Quake. They can either be client-side or server-side. Server-side bots are written in the interpreted language quake-C used by Quake and are sometimes referred to as QuakeC Bots.

1.5 Why?

The reasons I created mikeBot are mainly because I am interested in both AI and Quake and mikeBot was a good way to learn more about both at the same time. I imagine most authors make bots for the AI aspect, which was my main motivation.

1.6 How do I detect a client-side bot?!

Detecting a client-side quake bot is very difficult. Autonomous bots tend to not navigate very well, so if you see a player constantly just running staight at things (irregardless of walls) or following players very closely or following walls all the time, it may be an autonomous bot.

"Cyborg" bots like Stooge are even harder to detect, since a human player is doing all the navigating. Some clues include tracking the lightning gun perfectly on airborn targets or hitting all the time with the shotgun. A clue to be taken with much salt is firing "around corners" (i.e. shooting a rocket such that it hits you as you emerge from behind a wall). This is not very reliable, as many players fire blind rocket shots all the time (I know I do...) However, if a rocket meets you from below as you jump over a ledge, there's a good chance that the killer is using a cyborg-bot. Note that a good player with a good connection can absolutly devastate a server full of mediocre players with medium-fast connections; rocketing up the rankings in a few minutes is no indication that the player is a bot.

A very good indication that someone is using a "home-made" bot is if the bot shoots at players a little behind walls; I have seen a couple home-made bots which don't do line-of-sight calculations, or do them incorrectly, so shoot walls regularily. Note that an extremely-lagged player may also have this problem ;)

Note too that Stooge is by far the most-used cyborg bot and has many safeties. Say " humans only please" and any Stooges will immediatly disconnect. Homebrew bots are often inferior and easy to spot.


Various Bots

2.1 What is Stooge-Bot?
Stooge Bot, at http://www-graphics.stanford.edu/~quake, is a client-side "helper" bot. What is does, and what most people think of when you say "bot", is aim for a human driver. Quite possibly the best such bot, it is frowned on by most people, but is easily recognizable by the "SBot" prefix put in front of its name. Servers can ban it by center-printing "no bots please" and players can kick Stooge by saying "humans only please". Executables for windows 95, SGI Irix and Linux are available at the well-designed Stoogebot Project pages, as is a .DEMo recording proxy and some .DEMos of Stooge in action.

2.2 What is QuakeBot C/S?

Programmed by Jim Rorie and John Simmerman, QuakeBot C/S is a client-side bot written in C++ for Windows 95, with some support for unix (I compiled it on SunOS with g++, but it consistenly seg faulted right away...) The source code is availiable, making it an excellent base for people who want to immediatly start programming AI. The AI which comes with the bot is fairly limited but is currently being improved. It is availiable from http://www.coe.uncc.edu/~jfrorie/quakebot.htm.

2.3 What is mikeBot?

mikeBot is programmed by Mike Warren, this FAQ maintainer, and is perhaps one of the most advanced client-side bots available. It is programmed in C++ for unix, but includes Windows 95 support; MSVC++, g++, CC, and cc on AIX all compile it. It has been run on SunOS, Solaris, AIX 4, Windows 95 and Linux. mikeBot includes partial source, with skeleton AI, allowing fast development of your own bot. Also, observer mode with unlimited[2] observers, .DEMo recording, BSP loading and line-of-sight functionality are all included in the source. Visit the mikeBot Project at http://www.planetquake.com/mikeBot/. You can download .DEMos, source and read descriptions of algorithms and furture plans for mikeBot, which include using a Genetic Algorithm for target selection and adaptive skill levels which will make mikeBot less likely to hit less-skilled players and more likely to hit better players. There is not yet a binary available.

2.4 What is mystery bot?

This mysterious bot by Ripper is based on QuakeBot C/S code, although there is mention that he is switching to Terminator source on his site at http://mystery.telefragged.com. Mystery bot has advanced line-of-sight algorithms and is the only bot I know of which uses the grappling hook intelligently. It also understands CTF rules and entities and normal quake powerups. There is both a linux and windows 95 executable available.

2.5 What is JavaBot

The only client-side bot written in Java, JavaBot doesn't shoot walls (line-of-sight), uses predictive firecontrol and tracks all entities. Ben Schwartzlander is currently working on BSP-based navigation. JavaBot can also record .DEMos, some of which are downloadable from his site at http://www.cis.ohio-state.edu/~swartzla, which further explains JavaBot's capabilities. No source or .exe are available, but Ben plans on releasing both when they are presentable.

2.6 What is Terminator

Terminator is both an autonomous bot and a "helper" like Stooge. It was made well before Stooge, however, so can lay claim to being the first proxy-bot and one of the first quake bots period. It is written in ANSI C and the source code is available. There is Windows 95, SunOS, AIX and Linux support. Terminator can be found at http://www.ens.fr/~cridlig/bot/index.html, which also explains parts of the Quake World protocol and has links to the author's QW proxy, CamlBot.

2.7 What is Loef Bot

Loef Bot is a proxy-bot much like Stooge, heavily based on the Terminator source. Source code is available at http://www.mindspring.com/~jamesloe. Regrettably, Loef Bot does not include the "no bots" safeties that Stooge does. Executable for windows 95.

Client-Side Bot Abilities

3.1 What can client-side bots see?

Client-side bots can see a little more than human quake players. Because of lag considerations, the server sends entity updates for every potentially visible entity; for every entity in the bot's current leaf's PVS[3], the bot gets an entity update. Also, of course, the bot can see in 360 degrees around it. One (partial) solution for this would be to fileter out entity updates which you can't see (by performing a line-of-sight calculation on it). Or, a proxy packet filter could do this...(none exist, but I may make one). It is important to note that client-side bots can see far less than server-side bots, which can potentially see every entity in the entire level.

3.2 Bots are cheating, right?

Wrong!. Yes, Proxy bots, like Stooge and Loef are cheating because the bot is doing the aiming for a human player, but there are many fully autonomous bots which are complete Quake players. It is no more cheating to have a bot playing than it is to play against a really good (human) Quake player. Autonomous means the bot does everything itself, from navigation and fireing to weapon selection.

3.3 How do bots navigate?

Currently, there are no bots which navigate based on the BSP tree; most bots just run straigt at whatever they want. Some first see if there is a line-of-sight to the entity. Client-side bot navigation is still very rudimentry.

3.4 How do bots aim?

Client-side bots can aim very well. By calculating where a player will be when the projectile they are firing will hit them, bots can "lead" their targets with deadly accuracy. Also, bots like Stooge and mikeBot compensate for lag when aiming. For exact algorithms, check out the Stooge Bot or the mikeBot Project. Both URLs are available in the Various Bots section of the FAQ.


Resources

4.1 How does the client-server architecture work?

When you play quake, all the entity movement calculations are performed at the server end. The client tells the server where the players wants to move and displays the level and entities the server tells it to. There are more detailed explanations here:
http://www.upd.edu.ph/~oliber/quake/qnp.html
Description of control packets and the connection handshake procedure.

http://www.coe.uncc.edu/~jfrorie/QuakeSpecs.htm
This excellent handbook by QuakeBot C/S author Jim Rorie explains everything from connecting to runtime packets. Very useful.

http://www.physik.uni-leipzig.de/~girlich/games/doc/dem.html
A description of the .DEM file format, which also happens to be the same as the server-to-client protocol. An invaluable resource.

4.2 Can I get a "quick start" into the AI?

Yes. Both QuakeBot C/S and the mikeBot Project have C++ source available which is designed for you to add AI routines and have a working client-side quake bot. Terminator has C source available, and although not intented as a base for new client-bot development as QuakeBot C/S and mikeBot are, you can easily strip the AI routines and add your own. All URLs are in the Various Bots section.

4.3 www.botauthors.org

A newly-launched website at http://www.botauthors.org is aiming to become the client-side bot resource. Check it out.

Footnotes
[1] * Bots which move indepently of where they are firing (most client-side bots, whether autonomous or not) can be detected with some quake-C patches. However, the server cannot tell through the protocol whether a client is a bot or not.

[2] * Depending on CPU power and bandwitdh. Up to 10 or so should be no problem.

[3] * Potentially Visible Set. See the Quake Specifications for more.


This FAQ is copyright © 1997
Mike Warren. All rights reserved.
mbwarren@acs.ucalgary.ca