Chapter 4. GameBots connections

Table of Contents

GameBots connection types
Starting the GameBots server
Connecting to the GameBots server
Initiate the communication with GameBots (GameBots handshake)

There are three types of connections in GameBots.

To initiate the communication with GameBots three steps needs to be done. They are as follows.

First we will describe a bit more three GameBots connection types and then we will go through the three steps needed to set up and connect to a GameBots server.

GameBots connection types

Bot connection. Bot connection is used for creating and controlling a bot in the environment and at the same time for receiving information about bot surroundings (things or players he sees and his inner state – health, armor, team and etc.).

After the handshake server starts to send synchronous batch messages (standard synchronous batch enveloped by BEG and END messages) with information about what the bot can see in the environement (players - PLR, items - INV, navigation points - NAV, movers - MOV, etc.)

Default port is 3000.

Control connection. Control connection (or control server connection) is used to control the game mechanics. It may pause the game, change the map, kick the players and more.

After the handshake server will send ALIVE message every second. If STARTPLRS message is received, the server starts to send a synchronous batch containing information about all players on the server (standard synchronous batch enveloped by BEG and END messages).

Note that for control server to work a variable bAllowControlServer=true needs to be set in GameBots2004.ini file (by default control server is on). Default port is 3001.

Observer connection. Observer connection (or observing connection) is used to observe bots or players in the game. Information about what player or bot does will be exported through standard GameBots messages.

To start observing a player command INIT {Name PlayerName} or INIT {Id PlayerUnrealId} needs to be sent. After that the server starts to send synchronous batch messages (enveloped by BEG and END messages) with information about what observed player or bot can see in the environement (messages PLR, INV, NAV...).

To stop observing a player command DISC needs to be sent. Or another INIT command to observe a different player will cease to observe current player and start to observe a different one. Message QUIT quits the connection.

Note that for observer server to work a variable bAllowObservingServer=true needs to be set in GameBots2004.ini file (by default observer server is on). Default port is 3002.