Bots

From Q4MAX

Contents

Getting them to run

To use bots, you must first have an AAS file for each map you want to play - in q4max's case, a .maxaas01 file. For all of the standard q4 maps, and a number of commonly played maps, q4max provides additional pk4s which contain the AAS files, so you do not need to worry about creating these files.

If you're playing on a map which you have no AAS file for, you must first use the command "runBotAAS" to create an AAS file for the map. This command takes a parameter of the map name, eg "runBotAAS mp/l4dm1_1", and should be run from console while at the menu. Note that this command only works on Windows, not on Linux or Mac OS X, due to a limitation of Q4.

After successfully using runBotAAS, you should have a file "maps/mp/l4dm1_1.maxaas01" (or similar for whichever map you created). To use this on a server, you should add this to a pk4 file, and make it available for download. If you are just playing on your own, you can set si_pure 0 so that it does not need to be packaged.

If you're a mapper, you can add the .maxaas01 file into your map's pk4. Never add it to an already released pk4 though as this will make the pk4 incompatible with the original version.

Managing bots


Via the Console

To add a bot, you can use the console command "addbot botname" to add a bot with the name you supply. If the name you provide is a bot that has been configured with a specific personality then this will be used, otherwise a bot will be created with the default bot profile.

Another way to add bots is via the bot_minPlayers cvar. If this cvar is set to > 0, q4max will automatically ensure that there are this many players on the server, and if there aren't enough, add some bots to fill the remaining slots. So, if you want to play duels, set bot_minPlayers 2, and you'll always have a duelling partner. Or set it to 8, and you can play 4v4 TDM, and if there are not enough humans, the bots will pad the teams.

To remove bots, you can just kick them using the normal "kick" command. Note however that if you've set bot_minPlayers, another bot will just join to pad back up to the old number! If you set bot_minPlayers to a lower number than its current value (but still > 0), q4max will automatically kick bots to get it back to the number you're specifying.

To adjust the bots' skill level, you can adjust bot_skill, which ranges from 1 to 5. This cvar affects how accurate the bots are when firing. Also, at lower levels the bots disable some of their advanced skills, like dodging and item timing.

Create Server Menu

When creating a server through the menu you can set the "min bots" value (bot_minPlayers), therefore automatically adding bots to the server when it is created.

We still don't particularly recommend listen servers, however we recognize that when playing against bots, listen servers are the easiest way to start a game. Keep in mind a number of things will not behave properly, so consider creating a dedicated server, and connecting to it (see Server Setup).

Ingame Admin Menu

If you're not using the bot_minPlayers setting, you can add bots via the ingame Admin menu. This shows a list of the bots which you can add - just select the one you want, and hit add.


Bot personalities

Overview

As mentioned above, some bots have a "personality" configured, while other bots pick up the default settings. For most users, you probably want to stick to the default settings, or use a bot that we've configured with a personality already. Advanced users may wish to tweak the various properties to make the bots behave differently.

To do this, you must create a new .def file, with an entitydef which inherits from player_marine_mp_bot, and your entitydef must be named bot_*. See def/player_bot.def in the q4max media pk4 for an example of this.

To use the custom bots on a server, the .def file must be placed in a pk4, and all players must download the pk4 to be able to connect, so we would recommend that this is preferred for offline play only.

Keys

In this section you can find a description of most keys that can be used in the bot personalities. Note it would be best to look at def/player_bot.def while reading this, as this includes (close to) the full set of keys that can be used.

Userinfo

Any cvar which is userinfo can be set on the bots - in general, this means ui_*, and is used for changing ui_model, ui_name etc on the bot. Simply prefix the userinfo cvar name with bot_ in the def. Eg:

	"bot_ui_name"				"Failed Transfer"
	"bot_ui_model"				"failed"

Item Weightings

When selecting which item is best, the bots factor in how much they like particular items. There are all sorts of complexities, but basically you can tweak which items the bot will prefer by tweaking values for each item. The keys to use in the bot personality file are the entity name as used throughout Q4 (eg "weapon_shotgun"), prefixed with bot_weight. Eg:

	"bot_weight_weapon_grenadelauncher"	"2"
	"bot_weight_weapon_nailgun"		"2"
	"bot_weight_weapon_rocketlauncher"	"4"
	"bot_weight_weapon_railgun"		"4"

These settings make the bot twice as likely to go for the RG or RL than the NG or GL, all being equal.

Weapon Accuracies

The bots can have a different accuracy with each different weapon. This affects not only how accurate they are at hitting, but also the bots weapon choices (they won't tend to pick weapons which they're not very good with!). These values are in the range 0 to 1, with 1 being the best they can be (within the confines of bot_skill). Eg:

	"bot_accuracyWeapon6"			"0.5"
	"bot_accuracyWeapon7"			"0.7"

Weapon Selection

There are a number of specific values which you can tweak which affect when the bots will use some weapons. For example, "bot_rangeNotRG" can be used to specify a minimum distance the enemy must be away from the bot for it to consider using the RG.


Aggressiveness

The bots have a concept of agressiveness. Sometimes they'll prefer to go for items they need instead of entering combat. Other times they'll head into combat, ignoring picking up yet another HB. There are three settings which you can adjust which affect how agressive bots are, which tweak the importance the bots plae on having good health/armor/weapons before entering combat.

	"bot_weight_aggressive_health"		"4.0"
	"bot_weight_aggressive_armor"		"3.0"
	"bot_weight_aggressive_weapon"		"0.2"

Note that the weapon value doesnt quite work in the same way as the H/A values, so the default settings (shown) dont really mean that the bots consider weapons really unimportant compared to H/A.


Misc other settings

There are number of values you can tweak to affect how bots dodge, although these values may be a bit too subtle for most tweakers. Feel free to play though.

There are a few other settings around - for example some special case weightings to get game-mode specific behaviour - for example, there are special weightings, "bot_weight_flag_return", "bot_weight_flag_capture", "bot_weight_flag_pickup" which are used when the bot is deciding whether to try to get a CTF flag, and "bot_weight_item_timing" which is used as a bias towards timed items (you can use this to make some bots not as good as others at timing items).


Debugging Weightings

If you are tweaking the various weightings on agressiveness or on items, you may wish to see the choices that the bots are making. To do this, run a listen server, go spectator, and add bots. Then, use bot_debug 1, bot_debugWeightings 1 and hud_useSuperhud 1, and when following bots you will see a significant amount of information. This includes a sorted list of the items in priority order. Changing the weightings will change the way the lists are sorted - although obviously the weightings are only one factor the bots take into account.