Chapter 3. GameBots text protocol

Table of Contents

Data types

GameBots text protocol features commands and messages. All commands and messages share common text format. Example of one GameBots messages is:

PLAYER {Name GoodBot} {Location 1400,500,0} {Rotation 32000,0,0} {Health 100} {Height 170.59} {IsHuman False}

The first characters up to first space (excluding it) are the message type. Then enclosed by a pair of vinculums ( characters “{“ and “}” ) come attribute pairs. Attribute pair consist of attribute name and attribute value. Attribute name is all characters after the left vinculum (character “{“) up to the first space (excluding the space). Attribute value is all characters after the first space up to the right vinculum (character “}”). This means attribute values may contain spaces. Attribute pairs should be always divided by a space.

So the correct parsing of our example above would be:

Number of attributes is not limited for messages. For commands the limit exists – for Pogamut GameBots it is 32.

Data types

Data types used by GameBots are UnrealScript common data structures. The most used types in GameBots are intergers or real numbers (attributes Health and Height), strings (attribute GoodBot), booleans (attribute IsHuman) and vector and angle structures (attributes Location and Rotation).

For measuring position and angles in UT04 so called unreal units were defined. One unreal unit corresponds roughly to 1 cm. For angles full rotation (by 360 degrees) corresponds to 65535 rotation unreal units. To convert to radians simply divide the number by 65535 and multiply by 2 * pi.

Vector structures are usually used to define positions (attribute Location in our example). Vector is a triple defining x,y and z coordinate in UT04 environment. Rotation structures are used to measure rotation of the objects (attribute Rotation in our example). Rotation structure is also a triple consisting of pitch, yaw and roll. Pitch is up and down, yaw is side to side and roll is the equivalent of doing a cartwheel.