Table of Contents
There are three types of connections in GameBots.
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.).
Control connection - is used to control the game mechanics. It may pause the game, change the map, kick the players and more.
Observer 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 initiate the communication with GameBots three steps needs to be done. They are as follows.
Start the UT04 server with GameBots on.
Connect to UT04 through TCP/IP to port 3000 (default port for bot connection), 3001 (default port for control connection) or 3002 (default port for observer connection).
Initiate the communication with GameBots by the handshake (differs a little for bot, control and observer connection).
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.
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 (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 (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.