Title : CTF Bot Filename : ctfbot12.zip Version : 1.2 Date : 3 Feb 97 Author : Drew 'BZ' Davidson Email : drew@interpath.com (Please see Bug Reporting section below before emailing me.) Homepage : http://www.interpath.com/~davidson/ctfbot.htm Type of Mod =========== Quake C : yes Sound : no MDL : yes (extra skins) Format of QuakeC ================ unified diff : no context diff : no .qc files : yes progs.dat : yes (in pak1.pak file) pak0.pak file : no pak1.pak file : yes (progs.dat, progs/player.mdl) Description of the Modification =============================== This is CTF Bot (aka Capture the Flag Bot), a bot that plays ThreeWave Capture the Flag 3.5. The unmodified ThreeWave CTF is available from: http://www.planetquake.com/quakex/threewave/ Before You Install the Modification =================================== You should have a basic knowledge of Quake things like how to edit and use config files, how to use the Quake console, how to load a specific map file, what autoexec.cfg files do, etc, before you try to install and use CTF Bot. It would also be very good if you had experience with installing and using Quake C patches. If you don't know this stuff, please go to the CTF Bot web page and check the "Links" section for web pages with general Quake info. If you've never played CTF before then you definitely should go to ThreeWave at http://www.planetquake.com/quakex/threewave/ and read about it because I assume you know what you are doing with regard to CTF, i.e. you know how to pick up the flag, what you have to do to capture the flag, how to use the hook, how to drop backpacks with ammo, what the runes are, etc. *IMPORTANT NOTE*: If you don't have the ThreeWave CTF client mod, you won't be able to play Capture the Flag with the bots, so go download that now before you install the bots. You can download ThreeWave CTF stuff from http://www.planetquake.com/quakex/threewave/ It would also be a good idea to download the ThreeWave server mod. The server mod contains documenation about the different teamplay options that are also available in CTF Bot. However, the server mod is not required for play. [SIDE NOTE: Technically, you don't *absolutely* need the ThreeWave CTF client or server mod to use CTF Bot. But you won't have any CTF maps to play on. You could use the non-custom CTF models (i.e. the flags look like keys) and then create your own CTF map with the dynamic map creation features of CTF Bot, but that would be very silly and you would miss out on the fantastic maps, models and graphics that greatly enhance the CTF experience. Also the bots will be much dumber because they only have waypoints for maps in the ThreeWave client mod. But just for the record you can set the teamplay variable in server.cfg so that CTF Bot does not require the ThreeWave CTF client side mod.] Quake may crash if it is given the default 8 Megs of memory. You should probably use the "-winmem 16" parameter to give Quake 16 megs of memory when using this bot. Also, this bot may play too slow on slower machines. If it plays too slowly, reduce the number of bots. I would like to hear if you have a slow machine and can get acceptable game play. How to Install the Modification =============================== First please read the "Before You Install the Modification" section above! The following installation procedure assumes you will be playing on a single machine that is not networked (i.e that you will be playing by yourself on the server). If you are playing with a network, you will have to follow the installation for *all* machines, not just the server. The pak1.pak file is required (and the ctfbot.cfg file is useful) for all clients also. See "CTF Bot on Network Servers" below for more information. 1) Unzip the CTF Bot zip into a *NEW* directory called "ctfbot" inside your Quake directory. This will install the following: - ctfbot [DIR /quake/ctfbot/ that you created ] ctfbot12.txt [ this file ] whatsnew.txt [ file describing new features in this version ] impulses.txt [ numerical list of impulse commands ] ctfbot.cfg [ CTF Bot default key config ] server.cfg [ CTF Bot server config ] autoexec.cfg [ execs ctfbot.cfg and server.cfg ] makebots.cfg [ exec this to make some bots ] pak1.pak [ brains of the bot & red/blue skins ] file_id.diz [ archive description ] src/ [DIR source code ] ents/ [DIR entities for converting maps to CTF ] 2) Copy the pak0.pak from the ThreeWave CTF client mod into the ctfbot directory. You can get the ThreeWave CTF client mod from http://www.planetquake.com/quakex/threewave/ DO *NOT* OVERWRITE YOUR EXISTING pak0.pak OR pak1.pak FILES IN THE id1 DIRECTORY! 3) OPTIONAL: Install More CTF Maps If you want to play on more maps that CTF Bot has waypoints for, create a directory in the ctfbot directory called "maps". Copy the bsp's (e.g. idctf1.bsp) into your new /ctfbot/maps/ directory. If you want to play CTF Bot on the id maps that have been converted to CTF, follow the instructions in "Converting Maps to CTF" below to convert your id bsp's into CTF bsp's. You will also need to edit the server.cfg file to change the percentage of custom CTF/id maps when playing if you want the id maps to show up when the level changes. See the ThreeWave server mod docs for more info on converting bsp's. Check the CTF Bot web page for the latest on maps CTF Bot has waypoints for. 4) Your final CTF Bot directory structure should look like this (excluding the files/directories not used for play): - quake [DIR /quake/ ] quake.exe [ Quake application ] q95.bat [ Q95 batch file ] - ctfbot [DIR /quake/ctfbot/ ] ctfbot.cfg [ CTF Bot default key config ] server.cfg [ CTF Bot server config ] autoexec.cfg [ execs ctfbot.cfg and server.cfg ] makebots.cfg [ F7 execs this file to make some bots ] pak0.pak [ copied from ThreeWave CTF client mod ] pak1.pak [ from CTF Bot zip file ] - maps [DIR /quake/ctfbot/maps/ ] idctf1.bsp [ if you got idctf1 CTF map ] koc1.bsp [ if you got koc1 CTF map ] e?m?.bsp [ if you converted id bsp's to CTF ] 5) Run Quake (or Q95.BAT if you want to play networked games) with the following command line parameters: -game ctfbot ==> to use CTF Bot resources (i.e. pak0.pak, pak1.pak) -listen ==> start a listen (i.e. deathmatch) server -winmem 16 ==> give Quake 16 megs of ram -zone 512 ==> give Quake more ram for config files (optional) 6) If you have trouble, consult the "Troubleshooting" section below. Converting Maps to CTF ====================== This procedure will allow you to convert your id bsp's into CTF bsp's so you can play CTF on id maps. If you already have converted your id bsp's to CTF with this procedure, you can just copy those over, you don't have to convert them again. 1) Unpack the pak0.pak and pak1.pak files from the quake/id1 directory to get the separate bsp's (e1m1.bsp, etc). You can get a unpaking utility at: http://www.cdrom.com/pub/quake/ 2) Copy the *.bsp files you extracted in step (1) to your /ctfbot/ents/ directory. You only need to copy the .bsp files that have corresponding .ent files. 3) Get a copy of QBSP, make sure that it is in your execution path, then run dobsp.bat. This will insert the *.ent files into the *.bsp files (that is, it will insert the CTF entities into the bsp files so that the flags appear in the maps). It shouldn't take more than a minute or two to convert all the bsp's. 4) Move the converted bsp's to your /ctfbot/maps/ directory. 5) For more detailed instructions on converting maps to CTF, read the ThreeWave server mod documentation. The ThreeWave server mod is available at: http://www.planetquake.com/quakex/threewave/files.html Troubleshooting =============== If the flags are not visible, one of the following two things has happened: either (1) you are in single player mode, or (2) the file server.cfg is not being exec'ed when you start Quake. You can solve (1) by adding the "-listen" param to the Quake command line. You can solve (2) by making sure that server.cfg is being exec'ed when you start Quake (e.g. make sure that autoexec.cfg in the ctfbot directory has the line "exec server.cfg"). The server.cfg file sets various server variables that are *REQUIRED* to run CTF correctly. Also make sure that you didn't exec another file that overrode the settings. If the bots are all one color (i.e. you can't tell the difference between the teams), somehow the progs/player.mdl in the CTF Bot pak1.pak is not being used by Quake. If you are running a server on a different machine, see "CTF Bot on Network Servers" below for how to fix this. If the bots are *still* all one color, you probably unpaked your pak files. Quake is probably using the player.mdl from the pak0.pak instead of the one from the pak1.pak. If you want to unpak any pak files (e.g. to use a custom progs.dat) then you should unpak the pak0.pak also, so that there are *no* pak files in the ctfbot directory. Sometimes it's tricky to know what files Quake is going to use. Having no pak files makes it much easier to control what Quake does. You should use everything from the pak0.pak, *EXCEPT* the player.mdl, which should come from the pak1.pak file (the player.mdl from the pak1.pak has extra skins required to see the bots as different colors). This is probably the case for clients also; don't unpak any of the pak files unless you unpak all of them. (Of course, on the client side there's no reason to unpak the files because clients don't use progs.dat files at all.) After you unpack everything, move the pak files to another directory so Quake won't see them. If you are playing on a map that you thought CTF Bot had waypoints for, but the bots are really dumb and you can't see the waypoints when you turn on bot debug, perhaps you renamed the bsp. CTF Bot knows what map it is playing on by the name of the bsp file, and if you rename the bsp file, the waypoints will not work. If you are playing by modem and are having trouble changing levels, try using the "changelevel" command instead of the "map" command to start a new level. It works just like the map command (i.e. in the console type "changelevel ctf1"). Also remember that both sides need the pak0.pak and pak1.pak. If you are getting a message that says something like "progs/star.mdl not found" then you either forgot to copy the ThreeWave pak0.pak file into the ctfbot directory, or you copied the wrong pak0.pak file (e.g. the one from the id1 directory) into the ctfbot directory, or you didn't include the "-game ctfbot" Quake command line parameter when you ran Quake. Please follow the installation instructions above. If you find that IPX or TCP/IP is disabled in the Multiplayer menu, try using Q95.BAT instead of Quake.exe. If you are trying to use CTF Bot with QuakeWorld, give up. CTF Bot currently doesn't work with QuakeWorld. (See "CTF Bot with QuakeWorld" for more info.) Customizing Controls and Settings ================================= The file autoexec.cfg execs ctfbot.cfg and server.cfg. If you have a cfg file containing your Quake key bindings, you may want to exec it from the autoexec.cfg file in the ctfbot directory. That is, add the line "exec blah.cfg" as the first line, where blah.cfg is the name of the config file containing your custom key bindings. Or, if you want to override the default ctfbot key bindings, exec your config as the last line. However, be careful if your config file changes various teamplay options, or CTF may not work correctly. The file ctfbot.cfg sets up some key bindings for you, so you can spawn bots quickly (hit F7). Tweak this file to change the settings, or just use the impules listed below to spawn bots and start killing. The file server.cfg sets up the various CTF server variables. You can tweak this to your liking, for example if you want to start in a different map by default, or if you want to disable observer mode or change the teamplay options. See the ThreeWave CTF server docs for more info on what teamplay options are available. Also see "Server Administration & Settings" below for useful bot-related server settings. CTF Bot on Network Servers ========================== If you are running a CTF Bot server on a different machine than you are playing on (i.e. if you're not playing on the server), you need to have the CTF Bot pak1.pak on all of the *CLIENT* machines also. The CTF Bot pak1.pak contains extra skins for the bots, and if it is not on a client's machine, that client will see all of the bots as the same color. (Also make sure all of the clients are using the "-game ctfbot" parameter so that Quake will actually see the pak1.pak.) Of course, the clients also need the ThreeWave client side mod (unless you have tweaked the server variables to not require the custom client-side models). HOWEVER, you can try a fix that may work. If you set teamplay bit 32768, CTF Bot will attempt to use the color maps of clients instead of using skins. Due to an inherent Quake limitation, client-side skins are required to have the bots show up as the correct colors in all situations, but this may work most of the time. Also keep in mind that you need to run Q95.BAT instead of Quake.exe to do most network stuff. Consult the Quake documentation for more info on running networked servers. If you are playing over a network, you may want to check out the "Server Administration & Settings" section below, because by default any player can execute any impulse (i.e. anybody can create a bot). CTF Bot has been primarily designed for play on a single machine or on a LAN. It has not been extensively tested on public Internet servers, and it probably has many shortcomings in that area. Note that if you want to have your server automatically select only certain maps (for example only the maps with waypoints) you will need to edit the source code (the RandomLevel routine) to select only the maps you want. If you don't do this you will probably select levels manually with the changelevel command or the admin change-level menu. Impulse Commands ================ See the file "impulses.txt" for a complete list of impulses in numerical order. More default keys set in ctfbot.cfg: F1-F4 sets skill 0-3 Help Impulses ============= Impulse ## Key Description ----------- --- ----------- impulse 199 = F1 = help Impulse 199 for help. This lists all impulses & default keys, including the impulses that are default ThreeWave impulses. Creating and Removing Bots ========================== Impulse ## Key Description ----------- --- ----------- impulse 100 = F5 = creates a bot on your team impulse 101 = F6 = creates a bot on the enemy team impulse 102 = F7 = exec makebots.cfg (makes several bots) impulse 105 = = creates a red bot (regardless of your team) impulse 106 = = creates a blue bot (regardless of your team) impulse 107 = = remove red bot (regardless of your team) [NEW!] impulse 108 = = remove blue bot (regardless of your team) [NEW!] Bot Debug ========= impulse 103 = F8 = bot debug mode (see what bot is thinking) impulse 104 = = turn bot debug off Maps [NEW!] =========== On some maps, bots use a waypoint scheme to navigate. The bots are much smarter (and thus much more fun) on waypoint maps than others. The waypoints are compiled into the bot code. You don't need special versions of the maps (bsp's) to use with CTF Bot (however, you *DO* need special versions of some of the bsp's to play CTF of course, for example the id maps). Currently the maps with at least some waypoints include: ctf1 - ctf8 idctf1 koc1 e1m1 e1m2 e1m3 e1m4 e1m5 e2m1 dm1 (new CTF version) dm3 dm6 maniac1 maniac2 satyr1ac (CTF version of satyr1a) mexx6c (CTF version of mexx6) martim5c (CTF version of martim5) See the section "Acknowledgements & Credits" below for complete information on who designed the above maps, and/or who converted them to CTF or added waypoints. See "Waypoints" section below for technical info on adding waypoints to a map. Playing Notes ============= Even on waypoint maps, the bots have certain limitations. They don't know they entire layout of maps. So, the moral is: help your bots. If you see a bot on your team with just a shotgun, then either lead it to a good weapon, or toss it your weapon. Otherwise, don't be surprised with your bot gets slaugtered. Use the "report in" order to find out what weapon your bots are using, and help them out if they can't seem to find anything good. Luckily on most of the default ctf good weapons are easily found. On some of the id levels the good weapons are not on the main path between bases and so the bots are unlikely to find them. Note that it is very helpful to have bots with you. If you can't get past a high-skill enemy bot, bring along some buddies. Let them grab the good weapons or toss them a rocket launcher and ammo and watch them kick ass while you get all the glory. :-) Check the CTF Bot web page for links to more maps, including more maps with complete waypoint support. On maps that do not contain waypoints, a lot of the time it is easy to capture their flag. If you go in their base, kill all the bots, and snag their flag, it may be easy to grab their flag again after that if they have all respawned away from their base, because they won't be able to find their way back. As a result, some non-waypoint maps work better than others with these bots. It can still be fun to play on non-waypoint maps, because the bots do use teamplay tactics. Skill Levels ============ The console variable "skill" is used as the skill of the next bot created. Type "skill #" in the console to change the skill, where # is a number from 0 to 3. Skill levels don't have to be an integer (i.e. 1.5 or 2.7 are legal). Skill has various effects on play. Lower skill levels misjudge target's velocity and position when firing, have smaller field of view, are less likely to make evasive maneuvers, are less likely to jump effectively, are less likely to see enemies far away, are less likely to see enemies with Ring of Shadows, plus tons of other things. Bots with a skill of 2 or higher use the "visor dude" CTF skin. Quick Spawning of Bots ====================== Included is a file that spawns a series of bots to demonstrate how you can make a config file spawn various differently-skilled bots easily. By default you can hit F7 to spawn 4 differently-skilled enemy bots and 2 bots on your team. Edit makebots.cfg to suit your skill level and desired number of bots. For some reason exec'ing this file from the console does not work. You have to bind it to a key in the console like this: bind F7 "exec makebots.cfg" and then hit that key. If you get telefragged when you spawn the bots in this manner, it is likely that all the bots did not get created, because as soon as you get telefragged, you are dead and so impulse commands no longer work. Start a new map and try again. Bot Orders [NEW!] ================= Impulse ## Key Description ----------- --- ----------- impulse 80 = f = report status & weapon impulse 81 = a = order more bots on your team to attack impulse 82 = d = order more bots on your team to defend impulse 83 = e = order closest bot to escort you impulse 84 = c = order closest bot to camp at your location impulse 85 = x = order closest bot to drop items for you impulse 86 = z = team status impulse 87 = s = order more bots on your team to roam When you give an order, the status of your team is printed so you can see how many bots are doing what. Bots will generally follow your orders, but will sometimes go AWOL and decide what to do on their own. When you give an order to attack, defend, or roam, you have no control over what bot will actually start attacking/defending/roaming. The bot will be taken out of the appropriate "pool" of other bots, for example, when you order more bots to attack, first they are taken out of the roaming pool, then if there are no roamers, they are taken out of the defender pool, then the camping pool, then the escort pool. If you keep pressing "more bots attack" eventually they will *all* attack. However, you will be overriding orders given to bots to camp and escort (orders which were possibly given to the bots by other humans on your team). So use teamwork with other humans on your team when giving bots orders. "Attack" means go toward the enemy base. "Defend" means go toward your base. "Escort" means follow you around. Bots will say things like "let's attack" while they are following you, so you know that you have their attention. They will sometimes get distracted by items though. Sometimes the bot wants something but can't get it, but if you grab it the bot will of course not want it anymore. If you are far above or below them, but they are still following you, they will try to jump down or hook their way up, so you can get them to follow you most places. Sometimes you have to just be patient while the dumb bot figures out how to get where you are, and sometimes you are just out of luck. Sometimes it helps to try to get your buddy to try a different route; e.g. get it to hook its way up somewhere easier and then lead it to where you want it to be once it gets up there. Note that you do *NOT* need to request escort when you have the enemy flag. When you have the enemy flag, bots will *always* try to escort you. "Camp" means stay at the location you specify. Bots will not just stand still, but will jump and hook around, and still pick up nearby stuff. Bots may get stuck behind something and not be able to get back to the camping location you specified. If they get lost for more than 30 seconds, they stop camping and say so. Camping and escorting work for 2 minutes and then the bots go about their normal business. "Roam" means just wander around and pick up stuff and kill. Bots currently don't explore as well as they attack and defend. They don't know where to go exactly and can tend to stay in one area, but may be drawn out of that area when they try to find good stuff or see an enemy, so there's no guarantee that bots will stay still. Bots with the flag are not affected by orders to attack, defend, or roam. They will camp and escort however. The bots are not smart enough to know whether or not the flag is in the base, and will happily defend (or attack) an empty base if you order them to. This can be helpful if you've got the enemy flag and the enemy has your flag... order your bots to attack and hope they can get your flag back. The bots have higher priorities than your orders, like fighting with enemies. You may issue your orders and find that the bots are too busy trying to kill to follow your orders. However, the bots remembered that you ordered them and will start attacking or defending when they have finished killing the enemy, or finished getting the items they are interested in. "Attack" and "Defend" work only on maps with waypoints. The other orders (including "Camp") work on all maps. When you order a bot to drop stuff, a bot nearby you may drop something for you. At most one thing will be dropped when you make this request, regardless of how many bots are nearby and regardless of how much good stuff they may have. Bots will *NOT* drop anything that you already have. This means that if you have a rune, bots won't drop a rune for you. If you have a rocket launcher, they won't drop a rocket launcher. So if a bot has a rune that you want, you'll have to drop your rune first before asking the bot for its rune. When you ask bots to drop stuff, they will try to give you a rune first. Note that when bots drop runes, they pop out of the bot just like when you kill a someone with a rune. This means that the rune may fall into lava or you might not be able to find it. Those are the breaks. If no nearby bot has a rune, they will try to drop a backpack containing a good weapon and some ammo for that weapon. Weapon priorities are: lightning gun, then rocket launcher, then grenade launcher, then super nailgun. When a bot drops a rune or backpack with a weapon, all bots on your team will ignore the item for 10 seconds, and then if its not picked up bots will try to get it. However, other bots may pick up the item accidentally, so this may be tricky in a crowd of bots. Currently bots won't drop just ammo, they will only drop runes and weapon/ammo backpacks. Also, if the teamplay flags are set so that rune and/or backpack dropping is not allowed, then this of course will work differently. Detailed Scores =============== Impulse ## Key Description ----------- --- ----------- Impulse 120 = i = prints detailed scores for you. Impulse 121 = u = prints detailed scores for everyone. Impulse 122 = TAB = print frag list Detailed scores includes number of frags (i.e. actual score), and also number of kills, deaths, suicides, captures, pickups, assists, recoveries, and bonuses. Bonuses are things like fragging the enemy flag carrier, or fragging the person hurting your flag carrier. Recoveries are returning your flag to base. Pickups are grabbing the enemy flag. Assists are things like returning your flag to base right before your team captures. For more info on CTF scoring, see the ThreeWave documentation. Increase/Decrease Bot Awareness/CPU Usage [NEW!] ================================================ impulse 75 = = decrease bot cpu usage/bot awareness impulse 76 = = increase bot cpu usage/bot awareness Impulse 75/76 decreases/increases bot cpu usage. On my machine this doesn't have much noticable effect, but I left it in there in case it may help someone. Decreasing/increasing CPU usage makes the bot awareness distances smaller/larger. So when you reduce the CPU usage, you are making the bots nearsighted. They don't look as far for items and enemies. Conversely, when you increase CPU usage you are making the bots see farther. Since the bots have been "tuned" for the default parameters, reducing or increasing bot awareness may have undesirable effects, like making the bots no longer use waypoints or the grappling hook as effectively. If this feature lets you run more bots on your machine, I'd like to hear about it. Increase/Decrease Bot Ping [NEW!] ================================= impulse 77 = < = decrease bot ping impulse 78 = > = increase bot ping Impulse 77/78 decreases/increases the crudely simulated bot ping. If you find that the bots on a network server are slaugtering all of the human players, you may want to increase the bot ping. Increasing bot ping increases their reaction time when they see enemies. That is, they will not start firing at an enemy for at least N/1000 seconds after it sees the enemy, where N is the bot ping. Bot ping has no other effect than reaction time. Note that bot skill also affects reaction time, so low skill bots will be even slower at reacting to enemies. The default bot ping is 0. Other Impulses [NEW!] ===================== Impulse ## Key Description ----------- --- ----------- impulse 40 = p = drop current rune impulse 41 = = rune status impulse 70 = = toggle normal/bot names impulse 71 = = toggle bot use of waypoints [NEW!] impulse 90 = F11 = toss out your weapon in backpack with ammo [NEW!] impulse 97 = = toggle no damage mode [NEW!] impulse 98 = = enter observer mode [NEW!] impulse 130 = o = toggle no target mode impulse 131 = = toggle always escort mode Impulse 40 (default key p) drops the rune you are carrying so you can pick up another. Note that it pops out of you just like when you kill a player with a rune, so be careful if you are dropping it for a teammate -- it may pop out and fall into lava. Impulse 41 prints what rune you have. Impulse 70 toggles between "normal" names (e.g. "Outlaw") and bot names (e.g. "RedBot1"). There are 100 different normal names that the bots use. Yes, some of the bots are girls. Deal with it. :-) Impulse 71 toggles bot use of waypoints. If waypoints are disabled, then bots will be much dumber. This can be useful however if you want all bots to be "roaming killers" to liven up the mix, instead of bots trying to capture and defend the flag. Also, if you want to move the flags on the maps that CTF Bot has waypoints for, you will need to turn off bot use of waypoints on those maps otherwise the bots will get very confused (e.g. defending the area where the flag used to be). Impulse 90 tosses out a backpack with your weapon with some ammo for it. This is useful for tossing stuff to bots. Impulse 130 toggles no target mode. When no target mode is on, enemy bots won't try to target human players, but otherwise everything is the same. You can still pick up stuff, and you can still be harmed by bot crossfire, you can still capture the flag, you can still kill bots, etc. This is very useful for debugging the bots. Impulse 131 toggles always escort mode. When always escort is on, bots will *always* try to escort you. You don't have to explicitly give them orders to request escort. This is like version 1.1 of CTF Bot, where bots always follow you around. Impulse 97 puts you toggles no damage mode. You take no damage. This is for debugging aspects of the bots where it would be hard to debug if the bots are killing you. Impulse 98 puts you in observer mode. Observer mode is like when you join the server, press 1 or 2 for red/blue team. When observer mode is on, you can fly and do not interact with the world at all. You can't execute impulses as an observer... you must press 1 or 2 to join a team or press jump to join a computer-selected team before you can execute impulses. In observer mode you can fly, the same as when you use the fly mode cheat in single player.Impulse 107/108 removes the red/blue bot with the fewest frags. Dynamic Map Creation/Modification ================================= Impulse ## Key Description ----------- --- ----------- impulse 115 = r = move/create red flag impulse 116 = b = move/create blue flag impulse 117 = a = create base stockpile impulse 118 = e = print entity list NOTE: By default the above keys are commented out in ctfbot.cfg... uncomment them to use the above key bindings. Impulse 115/116 creates a red/blue flag where you are standing. You can only create one red or blue flag. If you create another, the first one is removed. You can use this to move the maps in the existing CTF levels (e.g. ctf1-ctf8) if you feel like a change. (Of course if you are playing the bots then the waypoints will no longer work on those levels.) In addition to the flag, 9 team spawn points are created when you create or move a flag. This is done so that if you want to spawn some bots, they will appear near their flag. All other team spawn points in the level for that team are removed. If a spawn point is created in a wall, it is removed. Impulse 117 creates a respawning stockpile of 1 yellow armor, 1 super nailgun, 1 double shotgun, 2 large boxes of nails, 2 large boxes of shells, and 2 25-health boxes. The above items may behave strangely or will fall out of the level if they are spawned in a wall or on top of an object or player. Please step out of the way after creating the items. You will be warned and be given 2 seconds before the items are enabled. Your changes are *NOT* saved with the map. You have to recreate the flags and bases every time you quit and restart Quake. So don't worry about screwing up your maps; you can't permanently change the map. *HOWEVER*, if you want to permanently change a map, you can use impulse 118. Impulse 118 prints out all entities that you dynamically created. It prints them to the console in the format used by QBSP for inserting entities into a bsp file. If you want to use this feature to permanently modify a bsp file, start Quake with the -condebug command line option to save all console text to the file qconsole.log in the ctfbot directory. Then add flags or items to the map with impulses 115-117. Finally, use impulse 118 to list the entities that you created. Impulse 118 doesn't print out all the entities in the map, only entities that you created, so you will have to strip out the existing entities from the bsp file, paste them together with the entities printed out in qconsole.log, then use QBSP with the -onlyents parameter (i.e. as done by the dobsp.bat file in the ThreeWave server mod) to replace the entities in the bsp file. If you merely moved a flag instead of creating a new one, the old team spawn points will still be in the bsp file, so remember to delete them. Also, this will print out the waypoints in the map, so either delete them or use them depending on what you want to do. Obviously, don't try modifying your bsp files like this unless you know what you are doing! Server Administration & Settings [NEW!] ======================================= Total Freedom Mode (teamplay flag 2048) --------------------------------------- By default, a CTF Bot server is in "total freedom" mode. This means that anyone can create a bot, remove a bot, move the flag, etc. This is great if you are playing by yourself, but most of the time over a network you don't want to have this total freedom for everyone, just the admin. You can change the teamplay flags so that only a player who enters the admin password (which is a specific series of impulses) can do things like create bots, move flags and such. Toggle teamplay bit 2048 to turn total admin on or off. If the bit is set, all bot impulses are allowed for all players. If it is not set, all "naughty" bot impulses are disabled except for the admin, who can do anything. Some impulses still work for all players, like detailed scores, bot frags, rune status, rune dropping, etc. See the admin.qc source file for more information about admin mode, and how to set an admin password. There is a default password set in admin.qc, but you should change it because everyone who has downloaded CTF Bot knows what it is (duh). You will need to recompile the bot to use your new password. The default password is in server.cfg. By default you can type "admin" at the console to enter admin mode. Total Freedom Mode is on by default (i.e. the bit is set, and any player can do any impulse). Auto-Even-Teams (teamplay flag 4096) ------------------------------------ You can change the teamplay flags so that the red and blue teams are always even. Bots are used to pad out teams that are different in size. Toggle teamplay bit 4096 to turn even teams on or off. If the bit is set, when the teams are uneven bots will be added or removed so that the teams are even again. Every 2 seconds, the server checks the team sizes and adds or remove bots. When removing bots, the bot with the fewest frags is removed. The team size and default bot skill is determined by the console variable "sv_aim". When you want even teams, multiply the size of the team desired (1-8) by 4. Then add the skill of the bots that will be added in order to keep teams even. Note that skill does not have to be an integer. Examples: sv_aim 9 // team size 2, skill 1 = (2*4)+1 sv_aim 18 // team size 4, skill 2 = (4*4)+2 sv_aim 34.5 // team size 8, skill 2.5 = (8*4)+2.5 An additional tweak: if you then add 64 to the total, the bot skill you set will actually be the average skill, and bot skills will vary plus or minus 0.5. Thus, a skill of 2.5 will actually add bots that range (linearly) in skill from 2.0 to 3.0. The maximum skill is 3.0. sv_aim 98.5 // team size 8, skill 2.5, vary skill = 64+(8*4)+2.5 Note that when sv_aim is greater than or equal to 1 (which of course it will be if you use it in the above manner), all auto-aiming by Quake is disabled. If for some insane reason you *want* auto-aiming on your server (a horrible idea IMO), you'll have to reprogram the bot to use a different server variable than sv_aim, or not use the auto-even-teams capability. When auto-even-teams is on, you can't add or remove bots manually (i.e. with impulse 100 etc), even if you are the admin. Auto-Even-Teams is off by default (i.e. the bit is not set, and teams can be uneven). No Player Rune Dropping (teamplay flag 8192) -------------------------------------------- You can change the teamplay flags so that players and bots are not allowed to drop runes. Toggle teamplay bit 8192 to turn rune dropping off or on. If the bit is set, rune dropping is disabled. If the bit is not set, players and bots can drop runes. Note that bots will drop runes only if a player asks them to. Rune dropping is on by default (i.e. the bit is not set, and players can drop runes). No Bot Flag Pickups (teamplay flag 16384) ----------------------------------------- You can change the teamplay flags so that bots are cannot pick up the enemy flag. They can still return their own flag to base. This can be useful if humans are letting the bots too much work, or you feel that the bots are too dumb for the responsibility of carrying the flag. Toggle teamplay bit 8192 to bot flag pickups off or on. If the bit is set, bots can't pick up the enemy flag. If the bit is not set, bots can pick up the enemy flag. No Bot Flag Pickups is off by default (i.e. the bit is not set, and bots can pick up the enemy flag). Waypoints [NEW!] ================ Bots use waypoints to navigate on certain maps. Waypoints are basically "threads" that lead the bot into or out of a base. Waypoints are necessary because otherwise bots would have NO knowledge of a level when they are spawned. They would wander around randomly and probably not find their way to the enemy base. Without waypoints, enemy bots generally take your flag only if they happen to spawn in your base. With waypoints, however, bots know exactly how to get into your base and actually try to go there on purpose. This makes CTF much more interesting and challenging, as bots can actually use some CTF strategy (if "try to take the other team's flag" can be termed a strategy). How to Create Waypoints ----------------------- Most people will not want to try this because it is too technical. It's certainly not required to play the bots. Several maps already have waypoints defined, and even on maps without waypoints the bots can be fun. The waypoints for the maps the bots know about are compiled into the bot code and dynamically created when the map starts. They are not stored as entities in the bsp so there is no need to use QBSP to modify the bsp file. The bots know what map they are playing on and use the waypoints if they have them. If there are no waypoints for the map, the bots probably won't capture your flag, but they will try their best anyway. If you want to add waypoints to a map you will need to modify the code and recompile the bot. However, there are several impulse commands to help you add waypoints without having to think about programming at all. The tricky thing is then testing your waypoints and figuring out how to pick better points. A sequence of waypoints is called a path. Paths always start near a flag, with waypoint number 0. Waypoint 1 is then nearby, followed with increasing waypoint numbers as the path goes away from the flag. Generally paths lead to a central area. Any number of paths can exist in a map, but you need at least 2: one from the red flag to a central area and one from the blue flag to a central area. From each waypoint on a path you should be able to see the next waypoint. So generally you put waypoints in hallway corners. You should end a path when you can see the end of the other team's path. For doors and teleporters, you should put the waypoint close enough to the door/teleporter so that the bot will open the door or go through the teleporter. Remember to put waypoints on *both* sides of a door/teleporter, because paths are two-way! That is, the bots will follow the paths to get INTO and OUT OF a base. Red waypoint 0 should be near the red flag, blue waypoint 0 should be near the blue flag. Waypoint 0 is where the bots will tend to hang out when they are defending, so the closer to the flag the better. It is *NOT* necessary to make a path go all the way from one flag to the other flag. You need to make each team's path go only halfway across the map. The bots use the red path to get to the red flag and the blue path to get to the blue flag.... but if they can't find the red path, they go the opposite way on the blue path to try to get back to the central area where they can see the red path. However, having paths go all the way to the enemy flag will probably still work properly, and may even work better. But the bots weren't designed to work with paths that go all the way across the map, and future versions of the bots that use different ai techniques may not work as well with those maps. It's probably better to stick to the current waypoint conventions. Also, it's easier to do it the "right" way because there are half as many waypoint that you need to create. Also, the fewer the waypoints, the better the bots run on that map, because looking through waypoints takes time and having extraneous waypoints wastes CPU time. When making multiple paths, there is no reason to have a group of waypoint all in the same area. If there is already a waypoint #1 where you want it, then don't put another one there. The bots will use the waypoint that is already there. However, sometimes a couple of waypoints with the same number placed nearby can be helpful. Also, there is no reason to put waypoints every couple of feet. Place waypoints only where necessary. Bots will ignore the intermediary waypoints when following the path and go directly toward the "best" waypoint. Waypoints do *NOT* have to be numerically continuous... a path can go 0, 1, 2, 4, 16 and be perfectly valid. Sometimes it is necessary to make discontinuous paths in order to let the bots take an alternate path to the base. Bots will always go for the best waypoint, so bots will always go for the shorter path, unless you use discontinuous paths to fake the bot out. Examples: --------- Map with 1 Path from Base to Base (Just Enough Waypoints): ---------------------------------------------------------- red flag ->R0->R1->R2-> [central area] <-B2<-B1<-B0<- blue flag Map with 2 Paths from Base to Base: ----------------------------------- red flag-->R0->R1->R2-> [central area] <-B2<-B1<-+ +->R1->R2-> [central area] <-B2<-B1<-B0<- blue flag Map with More Waypoints Than Necessary: --------------------------------------- red flag ->R0->R1->R2->R3->R4->R5->R6-> <-B6<-B5<-B4<-B3<-B2<-B1<-B0<- blue flag Turn on bot debug (default key F8) to see the waypoints on the maps that have them. They are represented by bubble sprites. You should be able to see what is going on fairly well. Also when bot debug is on, when you walk over a waypoint it tells you the team and number of that waypoint. To create a path, start up Quake with the -condebug parameter so that all console text is logged to the file qconsole.log in the ctfbot directory. Then use the following impulses to create a path. You must be of the same color as the path (i.e. when you are red you make a red path). Impulse ## Key Description ----------- --- ----------- impulse 185 = n = start a new path of your team impulse 186 = w = create the next waypoint in current path impulse 187 = q = print waypoints to console (stop creating waypoints) impulse 188 = m = start a new general path impulse 189 = = remove closest waypoint NOTE: By default the above keys are commented out in ctfbot.cfg... uncomment them to use the above key bindings. Plus, when you are creating waypoints: impulse 1-20 = lay down specific waypoint number of your team Use impulse 187 to stop spawning waypoints and print waypoints to the console. When you print waypoints with impulse 187, they are printed in a format that you can pretty much copy and paste into the bot code (but you may have to clean up the vectors so that they compile). The routine to add the code snippet is SpawnWaypointsForMap in the file botway.qc. Note that *all* waypoints in the map are printed out, not just the ones you added, so if there are already waypoints in the map they will be printed too. Don't worry about the order in which the waypoints are printed/created, it doesn't matter. Use impulse 189 to remove the closest waypoint to you. This is useful if you make a mistake when laying down waypoints, or want to move a waypoint. When you are finished making waypoints, it would be good to test them. A good way to test them is to start the map, turn on "no target" mode so your presence won't affect the bots, add one red bot, and make sure the bot can capture the enemy flag. Then do the same with a blue bot. If you create a good group of waypoints for a map, please send them to me so that I can choose to incorporate them into the master CTF Bot code, so everyone can play with them. I will of course give you credit for creating the waypoints. Of course, don't try this unless you know what you are doing! You will have to recompile the bot, for this you will require a Quake C compiler, which you can get at http://www.cdrom.com/pub/quake/quakec/utils/ I recommend ADVQCC. Also see the "Source Code" section below for more info on recompiling the bot. General Waypoints [NEW!] ------------------------ When bots can't find red or blue waypoints, they look for a path made up of general waypoints. They always try to follow general waypoints in decreasing numbers looking for general waypoint zero. From general waypoint zero you should be able to see either a red or a blue waypoint. It is useful to have a general waypoint path visible from every respawn location in the map, so that no matter where bots respawn they can find their way back to the bases. Also, if the bots tend to get stuck somewhere because they fall in and can't see any red or blue waypoints from there, use a general waypoint path to lead them out. Sometimes just one strategically placed general waypoints will help bots know that they should grapple out of whatever hole they've fallen into. You can have any number of general paths in a map. Use impulse 188 to start a new general path. Just as when creating red/blue paths, you can use impulse 186 to lay down the next waypoint, or impulse 1-20 to lay down a specific number. Waypoints in .BSP files [NEW!] ------------------------------ If you want to make waypoints that are entities in the bsp file, instead of created by the bot code, that is also possible. This would make it possible to use custom maps with waypoints without having to recompile the bot. Note that the clients would *NOT* have to download the bsps that are modified in this manner. Only the server needs to have the bsp with waypoints, because the server controls the spawning of all entities. Most of the time it'd probably be better to put the entities into the bot code, because that way you don't have to muck about with different versions of the bsp files. Here is an example: { "classname" "waypoint" "origin" "0 0 0" "team" "5" "waypoint_num" "0" }; "classname" must be "waypoint". For "team", use 5 for red, 14 for blue, and -1 for general. "origin" needs to be the where you actually want it instead of '0 0 0' of course. "waypoint_num" needs to be a number as described above. Extra Waypoints --------------- In the file botway.qc, commented out, are several alternate waypoint sets sent to me by various people. I have not tested these extensively, but they may in fact work better than the default waypoints. Feel free to put them back in the code and try them out, or combine them with existing waypoint sets. Some of the alternate sets use techniques that the waypoints are not designed for, but it may work great for you anyway. Source Code =========== IMPORTANT NOTE: Keep in mind that the CTF portion of the CTF Bot source code is based on ThreeWave CTF 3.5, and any modifications you make to the code may be restricted in their distribution and use. Read the ThreeWave server mod readme for more info. The source code is in the src directory. Use the included progs.src which handles the different directories for the bot source code. You may have to edit progs.src to compile the progs.dat into the appropriate directory. The current code may not do super-smart things. A lot of it is a massive hack. Also there are many routines that could be heavily optimized for speed. The code is constantly evolving so if you think something is dumb, it probably is. Also, don't necessarily trust the comments, as the comments may be outdated. Note that all of the monsters have been removed by ThreeWave CTF 3.5. If you come up with any cool modifications to this bot, I'd appreciate it if you emailed them to me, so that I can choose to incorporate them into the master CTF Bot code. I will of course give you credit. All changes related to the bot (should be) marked with "CTFBOT", except in the new bot files of course. Changes that are not bot related, but are CTF improvements (like drop rune and CTF bug fixes), are marked with "CTFBOT EXTRAS". Of course, I may have missed a few, so do a global diff to see what really has changed. CTF Bot is very large and you may have trouble compiling the source code with most QCC compilers. I use ADVQCC which is available at: http://www.cdrom.com/pub/quake/quakec/utils/ If you are having trouble compiling the source with other compilers, you may have to remove sections (e.g. waypoints for maps you are not using). If you know of a better compiler than ADVQCC, please let me know. If you are working with recompiling the bot source code, you will almost definitely want to unpak your pak0.pak and pak1.pak, so that the ctfbot directory has no pak files in it. If there are pak files, Quake may use the progs.dat or player.mdl from the pak files instead of the ones sitting in the directory. Without pak files you will know for sure what files Quake will be using. Basically you need the player.mdl from the pak1.pak (which has extra red/blue skins required to see the bots as different colors) instead of the one from the pak0.pak. See the "Troubleshooting" section above for more info. CTF Bot with QuakeWorld ----------------------- I have no plans to convert CTF Bot to QuakeWorld. It could probably be done, but it may not be possible to get good performance. It was several weeks and lots of testing before the grappling hook was converted to work properly in QuakeWorld, and the bots are moving around in a much more complicated way. It may take a lot of tweaking and testing to make the bots work right with the QuakeWorld prediction model. Then again, perhaps it would be easy. Regardless, I don't have the necessary equipment or time to do a version myself. If you would like to try to convert CTF Bot to QuakeWorld, the CTF Bot code will have to be merged into the latest ThreeWave CTF QW server mod, available at ThreeWave. You will have to make the bots use the new grappling hook routines. QuakeWorld uses the same QCC compiler but the defs.qc file is different in QW, so the resulting progs.dat files are incompatible between Quake and QuakeWorld. Not Yet Added/Things To Do/Known Bugs ===================================== + bots may be too slow on slower machines, and take up a lot of memory + bots don't know how to swim up to avoid drowning (but they try to fire hook) + bots sometimes run slightly slower than normal + bot water levels are not correct (i.e. bot may be able to fire thunderbolt in water that a human can't, may not be affected by shallow lava, etc.) + red bot skins still glow slightly + bot's don't know about any teamplay damage modes other than the default CTF mode (i.e. can't hurt teammates at all) and will probably kill their friends fairly often if teamplay is changed so that teammates can be damaged. + bots can't travel over broken ground + bots sometimes try to use the hook to get to high places instead of just walking up the stairs/ramp + bots don't know when an item is inaccessible, and continue to try to get it + bots get telefragged when entering the game with makebots.cfg + sometimes bots move at normal running speed when being pulled by the hook, especially when going parallel to the floor (friction?) + bots don't necessarily start firing at an enemy that is firing at them; they have to notice the enemy first... if they are trying to get a good but inaccessible item they are unlikely to turn around and start firing at the enemy + bot player model doesn't pitch up/down quite properly when bot aims up/down + bots initially spawn in the floor in ctf2 (map problem???) + when bots try to talk to team members only, talk beep is heard by everyone + bots are not affected by sv_aim (not actually a bug because sv_aim should always be 1.0 anyway) + bots are not affected by and don't know about wind tunnels + bots jump into lava/slime too much + bot names are not saved between levels, or when bots are added/removed, they are always random + bots are not very smart about teleporters, buttons, or secrets + tons of other stuff of course Future Plans ============ + support new releases of ThreeWave CTF as they are created + waypoint support for more maps, plus improved waypoint schemes + more dynamic CTF map creation/modification support + make bots seem more human + make bots smarter in general + make bots know more about ctf strategy (i.e. don't leave the base undefended to just go exploring) + make bots use hook better + make bots kill the guy who took their flag with higher priority + carry bots over to next level (although this is sort of handled by the auto-even-teams thing) + make bots hook you intentionally + make bots communicate with other bots on its team... let them ask for ammo and/or weapons, tell them about a rune on the ground, tell them to come back to the base, etc. + make it so that if you try to play CTF on a map that has a CTF version, the flags etc. are automatically spawned, so there is no need to convert the maps to CTF with QBSP. Bug Reporting/Comments/Suggestions ================================== Send bugs, comments, suggestions, code snippets, ideas, techniques, whatever, to drew@interpath.com. For bug reporting, please be as specific as possible. I try to answer all email, but I am doing this in my spare time for fun, so sometimes I can fall behind in answering email. If you are having trouble, please read through this readme file and/or the ThreeWave CTF documentation for help before emailing me. Most of the time your question will be answered in the documentation. Also, please do *NOT* email me binary files without receiving my permission! No Warranty =========== This software has NO WARRANTY. Use this software at your own risk. The author or any co-author of this work is NOT RESPONSIBLE for any harm or damage done as a result of using this sofware, or following any of the procedures described in this document or any documents accompanying this software. Distribution & Use ================== The CTF portion of the CTF Bot source code is based on ThreeWave CTF 3.5, and any modification or use of the CTF portion of the code may be restricted. Read the ThreeWave server mod readme for more info. You may NOT modify CTF Bot and distribute your modification, UNLESS (1) your modification is publically available on the Internet for free, AND (2) the complete source code of your modification is publically available on the Internet for free, AND (3) the name of your modification is different. You may NOT distribute CTF Bot or a modification of CTF Bot as part of a commercial product or service (including but not limited to CD-ROMs and pay-to-play Quake servers) unless you get prior written permission from both Dave 'Zoid' Kirsch at zoid@threewave.com, and Andrew B. Davidson at drew@interpath.com before doing anything with CTF Bot. Please get permission from Andrew B. Davidson first before bothering Dave Kirsch. This readme file, other included files, and portions of the included source code created by Andrew B. Davidson are Copyright (C) 1996-1997 Andrew B. Davidson. Other portions of the source code are copyright their respective creators. All rights reserved. Acknowledgements & Credits ========================== First I'd like to thank id software for Quake and Quake C. Thanks to everyone who has sent me email saying that they liked the bot! Thanks to Dave 'Zoid' Kirsch and the co-creators of CTF for ThreeWave CTF and the great maps and models. koc1 Chthon's Capture House by Dave 'Zoid' Kirsch ctf1 McKinley Base by Dave 'Zoid' Kirsch ctf2 The Kiln by Brian Wight ctf3 DySpHoRiA by Chris 'b0rt' Thibodeaux ctf4 The Forgotten Mines by Brian Wight ctf5 Da Ancient War Grounds Matthew 'DaBug' Hooper ctf6 Vertigo by Dale 'Midiguy' B. ctf7 Tale of Two Cities by Jamie Mactaggart ctf8 The StrongBox by Brent '[Drizzt]' Mcleod CTF Skin man: Ryan 'Grey_Ghost' Lacouture Brian 'Whaleboy' Cozzens for flag models See also ThreeWave server mod docs for more CTF credits. Thanks to psycho killer Scott 'Fletch' Haynes for testing and invaluable assistance and suggestions. Thanks to Tim Willits for idctf1. Thanks to Eric Cherry and James Kupperian for graphics help. Testing, Converion to CTF of dm1, and waypoints for e1m3, dm1 and dm6 added by Kester 'MadKez' Baird . Thanks to the Clan Maniac guys for testing, and especially thanks to James Kupperian for testing, and for making maniac1, maniac2 and the waypoints also. Thanks to Fargo for cool ideas. satyr1a designed by Joe 'Satyr' Milton http://www.worldaccess.com/~jcm CTF conversion and waypoints by Brian Wight mexx6 designed by Marcus Dromowicz CTF conversion and waypoints by Brian Wight martim5 designed by: Marco van Schriek Tim van Hal Roel Tiemessen Kees Rosendaal http://www.dra.nl/~keros/martim CTF conversion and waypoints by Brian Wight Thanks to Karl Was for creating additional waypoints for e1m2 and dm3. Thanks to Hoon created the waypoints for e1m4 and e2m1. Thanks to everyone in the online Quake community providing free stuff to play with. You all kick ass. Availability ============ This modification is available from the following URLs: HOME: http://www.interpath.com/~davidson/ctfbot.htm WWW : http://www.cdrom.com/pub/quake/quakec/bots/