Nuclide
Software Development Kit for id Technology
Bots

Bots are CPU controlled opponents. They can be useful for development, debugging but can also fun to play with.

They're 'fake' client entities, traversing the level, and acting upon objectives they either figure out themselves, or are told to to act a certain way.

We encourage any multiplayer game to support them, because they often also fill in the function of balancing teams. There's a whole slew of benefits of supporting bots, and players will generally thank you for including them.

Technical Info

Bots are handled by BotLib, located under src/botlib/ in the source tree.

Nuclide's BotLib takes some inspiration from Quake III Arena its bots, but shares no code or specific ideas or implementations. We do not use AAS for navigation, we leverage the route/pathfinding system FTEQW provides. Bots also share some code with regular NPC/Monster type entities through the use of the NSActor class.

Note
Games are allowed to handle how they want to integrate bots themselves, but for development purposes there are ways to force bots to spawn also.

Console Commands

addBot [profile name]

Adds a bot to the current game.

killAllBots

Force kills and respawns bots in the current game.

resetAllBotsGoals

Force reset bots current trajectory and goals.

Bot Console Variables

bot_enable

Enable (1) or disable (0) usage of bots in the game. Default is 1.

bot_pause

Enable (1) or disable (0) an interrupt for the Bot AIs thinking. Default is 0.

bot_noChat

Enable (1) or disable (0) a suppression of any bot chatter. Default is 0.

bot_fastChat

Enable (1) or disable (0) bot chatter that does not stop other inputs. Default is 0.

bot_debug

Enable (1) or disable (0) bot debug features that otherwise won't work. Default is 0.

bot_developer

Enable (1) or disable (0) bot debug text in console. Default is 0.

bot_minClients

When set, ensures to fill the server with this many players/bots. Default is -1.

bot_aimless

Enable (1) or disable (0) bot not knowing where to go. Will keep generating a new place to walk to.

bot_crouch

Enable (1) or disable (0) the forcing of bots crouching down.

bot_walk

Enable (1) or disable (0) the restriction of bots to walking speed.

bot_prone

Enable (1) or disable (0) the forcing of bots to crawl/prone.

bot_dont_shoot

Enable (1) or disable (0) bot pacifist mode.

Profiles

Nuclide has support for bot profiles, like in Quake III Arena. They work differently although they appear compatible by design. You can define them in a script that looks something like this and is located at scripts/bots.txt in your game directory:

{
name Albert
model zombie01
topcolor 0xeff
bottomcolor 0xff0020
}
{
name Susie
model police02
topcolor 0xff6b00
bottomcolor 0xff0b00
}
{
name Dog
funname ^4D^2o^1g
model dog01
topcolor 0x9200ff
bottomcolor 0xc800ff
}

Only the name key is required. The only other special key is funname which sets the nickname to be different from the internal name. The other keys are set as user info (setinfo) keys on the bot client.

This will allow games to add whatever extra keys they wish that they can then recognize anywhere in the client/server codebase. No additional networking or APIs necessary. Simply query bot properties via their userinfo.

Bot Waypoints

Bots will read from the same navmesh as the rest of the artificial intelligence.

You can edit the navmesh using the way_menu command.

Nuclide's way_menu Interface

You can then use the slot keys (usually bound to numbers 1 - 9 including 0) to navigate the menu.

Nodes

Nodes make up the smallest part of the navmesh, but they define all the paths that are walkable.

Links

Links are connections between nodes. You can have as many links between nodes as you wish. Those connections being made can also have special flags.

Flags available on links

The Jump flag will ensure that the bot will jump when it hits point A, before arriving at point B. You want to ensure those nodes are close to the edge of a gap for example.

The Crouch flag will force the bot to crouch while traversing point A to point B.

The Walk flag will force the bot to walk while traversing point A to point B.

The Aim flag will force the bot to forcefully look at the next node directly while traversing point A to point B. This is useful to control where they're looking at in order to make ladders climbable by them.

The Use flag will trigger the bot into simulating a use action (simular to +use) to the nearest usable object in proximity of point A.

The Hazardous flag will mark a path between two points as dangerous, and thus will be avoided by bots at specific times.