1. Network Data Protocol

This page describes the network protocol used to communicate between a commander and the game server. JSON is used for the serialization of most data objects. Newline characters are used for separation between objects in the protocol, so should not be used as part of the JSON serialization. The details of the JSON serialization format for each object is described further below

1.1. Connection Handshaking

Immediately after connecting to the server socket the server and client exchange two messages. The first of these is sent from the server to the client, consisting of:

  1. A line containing the string <connect>
  2. A line containing the JSON serialized ConnectServer object.

Example:

<connect>
{"__class__": "ConnectServer", "__value__": {"protocolVersion": "1.2"}}

The second is a message from the client to the server containing:

  1. A line containing the string <connect>
  2. A line containing the JSON serialized ConnectClient object.

Example:

<connect>
{"__class__": "ConnectClient", "__value__": {"language": "python", "commanderName": "MyCommander"}}

1.2. Communication from the Game Server to the Commander

1.2.1. Initialize

At the start of the game, the game server will send an initialize message to each commander. The message consists of:

  1. A line containing the string <initialize>
  2. A line containing the JSON serialized LevelInfo object.
  3. A line containing the JSON serialized GameInfo object.

The following is an example initialize message:

<initialize>
{"__class__": "LevelInfo", "__value__": {"runningSpeed": 6.0, "flagSpawnLocations": {"Blue": [82.0, 20.0], "Red": [6.0, 30.0]}, "teamNames": ["Blue", "Red"], "blockHeights": [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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 1, 1, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], "height": 50, "characterRadius": 0.25, "walkingSpeed": 3.0, "fieldOfViewAngles": [0.0, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 0.0], "botSpawnAreas": {"Blue": [[79.0, 2.0], [85.0, 9.0]], "Red": [[3.0, 41.0], [9.0, 48.0]]}, "firingDistance": 15.0, "width": 88, "flagScoreLocations": {"Blue": [82.0, 20.0], "Red": [6.0, 30.0]}, "gameLength": 180.0, "initializationTime": 10.0, "respawnTime": 45.0}}
{"__class__": "GameInfo", "__value__": {"teams": {"Blue": {"__class__": "TeamInfo", "__value__": {"flagScoreLocation": [82.0, 20.0], "name": "Blue", "flagSpawnLocation": [82.0, 20.0], "flag": "BlueFlag", "members": ["Blue0", "Blue1", "Blue2", "Blue3", "Blue4"], "botSpawnArea": [[79.0, 2.0], [85.0, 9.0]]}}, "Red": {"__class__": "TeamInfo", "__value__": {"flagScoreLocation": [6.0, 30.0], "name": "Red", "flagSpawnLocation": [6.0, 30.0], "flag": "RedFlag", "members": ["Red0", "Red1", "Red2", "Red3", "Red4"], "botSpawnArea": [[3.0, 41.0], [9.0, 48.0]]}}}, "flags": {"BlueFlag": {"__class__": "FlagInfo", "__value__": {"position": [82.0, 20.0], "carrier": null, "name": "BlueFlag", "respawnTimer": 0.10000000149011612, "team": "Blue"}}, "RedFlag": {"__class__": "FlagInfo", "__value__": {"position": [6.0, 30.0], "carrier": null, "name": "RedFlag", "respawnTimer": 0.10000000149011612, "team": "Red"}}}, "enemyTeam": "Red", "team": "Blue", "bots": {"Red3": {"__class__": "BotInfo", "__value__": {"seenBy": [], "flag": null, "name": "Red3", "facingDirection": null, "state": 0, "health": 0.0, "seenlast": null, "team": "Red", "position": null, "visibleEnemies": []}}, "Red2": {"__class__": "BotInfo", "__value__": {"seenBy": [], "flag": null, "name": "Red2", "facingDirection": null, "state": 0, "health": 0.0, "seenlast": null, "team": "Red", "position": null, "visibleEnemies": []}}, "Red1": {"__class__": "BotInfo", "__value__": {"seenBy": [], "flag": null, "name": "Red1", "facingDirection": null, "state": 0, "health": 0.0, "seenlast": null, "team": "Red", "position": null, "visibleEnemies": []}}, "Red0": {"__class__": "BotInfo", "__value__": {"seenBy": [], "flag": null, "name": "Red0", "facingDirection": null, "state": 0, "health": 0.0, "seenlast": null, "team": "Red", "position": null, "visibleEnemies": []}}, "Red4": {"__class__": "BotInfo", "__value__": {"seenBy": [], "flag": null, "name": "Red4", "facingDirection": null, "state": 0, "health": 0.0, "seenlast": null, "team": "Red", "position": null, "visibleEnemies": []}}, "Blue1": {"__class__": "BotInfo", "__value__": {"seenBy": [], "flag": null, "name": "Blue1", "facingDirection": [0.06574580073356628, 0.9978364109992981], "state": 1, "health": 100.0, "seenlast": null, "team": "Blue", "position": [81.11000061035156, 6.492311954498291], "visibleEnemies": []}}, "Blue0": {"__class__": "BotInfo", "__value__": {"seenBy": [], "flag": null, "name": "Blue0", "facingDirection": [0.10403892397880554, 0.9945732355117798], "state": 1, "health": 100.0, "seenlast": null, "team": "Blue", "position": [80.45407104492188, 5.22149658203125], "visibleEnemies": []}}, "Blue3": {"__class__": "BotInfo", "__value__": {"seenBy": [], "flag": null, "name": "Blue3", "facingDirection": [0.22079943120479584, 0.9753192663192749], "state": 1, "health": 100.0, "seenlast": null, "team": "Blue", "position": [79.2674331665039, 7.929657459259033], "visibleEnemies": []}}, "Blue2": {"__class__": "BotInfo", "__value__": {"seenBy": [], "flag": null, "name": "Blue2", "facingDirection": [0.0015204440569505095, 0.9999988675117493], "state": 1, "health": 100.0, "seenlast": null, "team": "Blue", "position": [81.97264862060547, 2.010946273803711], "visibleEnemies": []}}, "Blue4": {"__class__": "BotInfo", "__value__": {"seenBy": [], "flag": null, "name": "Blue4", "facingDirection": [0.2348455935716629, 0.9720326662063599], "state": 1, "health": 100.0, "seenlast": null, "team": "Blue", "position": [79.1587905883789, 8.240152359008789], "visibleEnemies": []}}}, "match": {"__class__": "MatchInfo", "__value__": {"timeRemaining": 180.0, "timeToNextRespawn": 45.0, "combatEvents": [], "timePassed": 0.0, "scores": {"Blue": 0, "Red": 0}}}}}

The client should respond with a Ready message once the initialize message has been processed.

1.2.2. Tick

Periodically (eg every 0.1 seconds) the game server will send a tick message the current game state. The message consists of:

  1. A line containing the string <tick>
  2. A line containing the JSON serialized GameInfo object.

The following is an example tick message:

<tick>
{"__class__": "GameInfo", "__value__": {"teams": {"Blue": {"__class__": "TeamInfo", "__value__": {"flagScoreLocation": [82.0, 20.0], "name": "Blue", "flagSpawnLocation": [82.0, 20.0], "flag": "BlueFlag", "members": ["Blue0", "Blue1", "Blue2", "Blue3", "Blue4"], "botSpawnArea": [[79.0, 2.0], [85.0, 9.0]]}}, "Red": {"__class__": "TeamInfo", "__value__": {"flagScoreLocation": [6.0, 30.0], "name": "Red", "flagSpawnLocation": [6.0, 30.0], "flag": "RedFlag", "members": ["Red0", "Red1", "Red2", "Red3", "Red4"], "botSpawnArea": [[3.0, 41.0], [9.0, 48.0]]}}}, "flags": {"BlueFlag": {"__class__": "FlagInfo", "__value__": {"position": [82.0, 20.0], "carrier": null, "name": "BlueFlag", "respawnTimer": -7.450580596923828e-09, "team": "Blue"}}, "RedFlag": {"__class__": "FlagInfo", "__value__": {"position": [9.723822593688965, 28.638526916503906], "carrier": "Blue1", "name": "RedFlag", "respawnTimer": -7.450580596923828e-09, "team": "Red"}}}, "enemyTeam": "Red", "team": "Blue", "bots": {"Red3": {"__class__": "BotInfo", "__value__": {"seenBy": [], "flag": null, "name": "Red3", "facingDirection": [0.9375345706939697, -0.3478919267654419], "state": 6, "health": 0, "seenlast": 13.370665550231934, "team": "Red", "position": [35.6309928894043, 26.81215476989746], "visibleEnemies": []}}, "Red2": {"__class__": "BotInfo", "__value__": {"seenBy": ["Blue0"], "flag": null, "name": "Red2", "facingDirection": [0.9123391509056091, -0.4094350337982178], "state": 6, "health": 0, "seenlast": 0.0, "team": "Red", "position": [68.28890991210938, 25.360763549804688], "visibleEnemies": []}}, "Red1": {"__class__": "BotInfo", "__value__": {"seenBy": ["Blue0"], "flag": null, "name": "Red1", "facingDirection": [-0.9972056150436401, 0.07470673322677612], "state": 4, "health": 0, "seenlast": 0.0, "team": "Red", "position": [68.53483581542969, 25.27260398864746], "visibleEnemies": []}}, "Red0": {"__class__": "BotInfo", "__value__": {"seenBy": [], "flag": null, "name": "Red0", "facingDirection": [0.9994280338287354, -0.033820152282714844], "state": 6, "health": 0, "seenlast": 13.370665550231934, "team": "Red", "position": [34.46906280517578, 24.155515670776367], "visibleEnemies": []}}, "Red4": {"__class__": "BotInfo", "__value__": {"seenBy": ["Blue0"], "flag": null, "name": "Red4", "facingDirection": [0.912505030632019, -0.4090656042098999], "state": 6, "health": 0, "seenlast": 0.0, "team": "Red", "position": [68.30572509765625, 25.36515998840332], "visibleEnemies": []}}, "Blue1": {"__class__": "BotInfo", "__value__": {"seenBy": [], "flag": "RedFlag", "name": "Blue1", "facingDirection": [0.9242773652076721, -0.3817223310470581], "state": 3, "health": 100.0, "seenlast": null, "team": "Blue", "position": [9.723822593688965, 28.638526916503906], "visibleEnemies": []}}, "Blue0": {"__class__": "BotInfo", "__value__": {"seenBy": [], "flag": null, "name": "Blue0", "facingDirection": [-0.9890086054801941, 0.14785832166671753], "state": 1, "health": 100.0, "seenlast": null, "team": "Blue", "position": [81.625, 19.375], "visibleEnemies": ["Red2", "Red1", "Red4"]}}, "Blue3": {"__class__": "BotInfo", "__value__": {"seenBy": [], "flag": null, "name": "Blue3", "facingDirection": [-0.9994280338287354, 0.03381979465484619], "state": 1, "health": 0, "seenlast": null, "team": "Blue", "position": [48.790069580078125, 23.665205001831055], "visibleEnemies": []}}, "Blue2": {"__class__": "BotInfo", "__value__": {"seenBy": [], "flag": null, "name": "Blue2", "facingDirection": [-0.9112738966941833, 0.411800742149353], "state": 6, "health": 0, "seenlast": null, "team": "Blue", "position": [57.94633102416992, 32.63374710083008], "visibleEnemies": []}}, "Blue4": {"__class__": "BotInfo", "__value__": {"seenBy": [], "flag": null, "name": "Blue4", "facingDirection": [-0.9575538635253906, 0.2882544994354248], "state": 6, "health": 0, "seenlast": null, "team": "Blue", "position": [47.545501708984375, 19.977867126464844], "visibleEnemies": []}}}, "match": {"__class__": "MatchInfo", "__value__": {"timeRemaining": 148.42462158203125, "timeToNextRespawn": 13.427755355834961, "combatEvents": [{"__class__": "MatchCombatEvent", "__value__": {"instigator": "Blue3", "time": 14.939663887023926, "type": 1, "subject": "Red3"}}, {"__class__": "MatchCombatEvent", "__value__": {"instigator": "Red2", "time": 16.550338745117188, "type": 1, "subject": "Blue2"}}, {"__class__": "MatchCombatEvent", "__value__": {"instigator": "Red4", "time": 16.550338745117188, "type": 1, "subject": "Blue2"}}, {"__class__": "MatchCombatEvent", "__value__": {"instigator": "Red0", "time": 17.310344696044922, "type": 1, "subject": "Blue4"}}, {"__class__": "MatchCombatEvent", "__value__": {"instigator": "Blue3", "time": 18.036685943603516, "type": 1, "subject": "Red0"}}, {"__class__": "MatchCombatEvent", "__value__": {"instigator": "Red1", "time": 18.201021194458008, "type": 1, "subject": "Blue3"}}, {"__class__": "MatchCombatEvent", "__value__": {"instigator": "Blue0", "time": 28.15752601623535, "type": 1, "subject": "Red4"}}, {"__class__": "MatchCombatEvent", "__value__": {"instigator": "Blue1", "time": 28.15752601623535, "type": 2, "subject": "RedFlag"}}, {"__class__": "MatchCombatEvent", "__value__": {"instigator": "Blue0", "time": 28.616199493408203, "type": 1, "subject": "Red2"}}, {"__class__": "MatchCombatEvent", "__value__": {"instigator": "Blue0", "time": 29.308876037597656, "type": 1, "subject": "Red1"}}], "timePassed": 31.5719051361084, "scores": {"Blue": 0, "Red": 0}}}}}

1.2.3. Shutdown

At the end of the game the game server will send a shutdown message to the commanders. This can be used to clean up resources, such as closing the commander log file. The format for the shutdown command is as follows:

  1. A line containing the string <shutdown>

The following is an example tick message:

<shutdown>

1.3. Communication from the Commander to the Game Server

1.3.1. Ready

The ready message is used to indicate to the server that the client has processed the initialize message and is ready for the game to begin. Note, the server may start the game before it reaches this ready message depending on the game configuration. The ready commands is formatted as:

  1. A line containing the string ‘<ready>’
<ready>

1.3.2. Commands

Commands may be issued by the commander after processing a tick message. Commands should not be issued before the first tick message has been received (ie during processing of the initialize message) or after the shutdown message. Commands are formatted as follows:

  1. A line containing the string ‘<command>’
  2. A line containing a JSON serialized command object (one of Defend, Move, Attack, Charge)

The following are example command messages for each of the supported commands:

<command>
{"__class__": "Defend", "__value__": {"facingDirection": [-37.625, 5.625], "bot": "Blue0", "description": ""}}
<command>
{"__class__": "Move", "__value__": {"bot": "Blue1", "target": [[3.41611909866333, 14.919763565063477]], "description": ""}}
<command>
{"__class__": "Attack", "__value__": {"lookAt": [6.0, 30.0], "bot": "Blue3", "target": [[6.0, 30.0]], "description": ""}}
<command>
{"__class__": "Charge", "__value__": {"bot": "Blue0", "target": [[83.60645294189453, 18.423120498657227]], "description": ""}}

1.3.3. Visualizations

Not yet supported. We will soon be adding the ability to draw debug visualization objects through the network interface.

1.4. JSON Serialization Description

Below is a description of the JSON format for each of the objects expected to be sent in JSON form. Newline characters are not allowed in the JSON format communications between the commanders and the game server as newlines are used to separate top-level objects in messages.

For information about the semantics of each data member, please refer to the Python API documentation.

This document describes version 1.4 of the network protocol

1.4.1. ConnectServer

{
  "__class__": "ConnectServer",
  "__value__": {
    "protocolVersion": "1.4"                                                # the network protocol version number that this server supports
  }
}

1.4.2. ConnectClient

{
  "__class__": "ConnectClient",
  "__value__": {
    "commanderName": "MyCommander"                                          # the string name of the commander being run
    "language": "python",                                                   # the language in which the commander was written
  }
}

1.4.3. LevelInfo

{
  "__class__": "LevelInfo",
  "__value__": {
    "width": 88,
    "height": 50,
    "blockHeights": [[0, ..., 0], [0, ..., 0], ..., [0, ..., 0]],           # a 'width' list of 'height' lengthed list of integers
    "teamNames": ["Blue", "Red"],                                           # list of team names
    "flagSpawnLocations": {                                                 # map of team name to position
      "Blue": [82.0, 20.0],
      "Red": [6.0, 30.0]
    },
    "flagScoreLocations": {                                                 # map of team name to position
      "Blue": [82.0, 20.0],
      "Red": [6.0, 30.0]
    },
    "botSpawnAreas": {                                                      # map of team name to min and max positions
      "Blue": [[79.0, 2.0], [85.0, 9.0]],
      "Red": [[3.0, 41.0], [9.0, 48.0]]
    },
    "fieldOfViewAngles": [0.0, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 0.0],     # list of field of view angles for each state in BotInfo
    "characterRadius": 0.25,
    "walkingSpeed": 3.0,
    "runningSpeed": 6.0,
    "firingDistance": 15.0,
    "gameLength": 180.0,                                                    # the time (seconds) that a game will last
    "initializationTime": 5.0                                               # the time (seconds) allowed to the commanders for initialization
    "respawnTime": 45.0                                                     # the time (seconds) between bot respawns
  }
}

1.4.4. GameInfo

{
  "__class__": "GameInfo",
  "__value__": {
    "teams": {                                                              # map of team names to TeamInfo objects
      "Blue": {"__class__": "TeamInfo", "__value__": ... },
      "Red": {"__class__": "TeamInfo", "__value__": ... }
    },
    "team": "Blue",
    "enemyTeam": "Red",
    "flags": {                                                              # map of team names to FlagInfo objects
      "BlueFlag": {"__class__": "FlagInfo", "__value__": ... },
      "RedFlag": {"__class__": "FlagInfo", "__value__": ... }
    },
    "bots": {                                                               # map of bot names to BotInfo objects
      "Red0": {"__class__": "BotInfo", "__value__": ... },
      ...
      "Blue4": {"__class__": "BotInfo", "__value__": ... }
    },
    "match": {"__class__": "MatchInfo", "__value__": ... }                  # MatchInfo object
  }
}

1.4.5. TeamInfo

{
  "__class__": "TeamInfo",
  "__value__": {
    "name": "Red",
    "flag": "RedFlag",
    "members": ["Red0", "Red1", "Red2", "Red3", "Red4"],                    # list of bot names
    "flagSpawnLocation": [6.0, 30.0],                                       # (may be removed as this is available in LevelInfo)
    "flagScoreLocation": [6.0, 30.0],                                       # (may be removed as this is available in LevelInfo)
    "botSpawnArea": [[3.0, 41.0], [9.0, 48.0]]                              # min and max positions (may be removed as this is available in LevelInfo)
  }
}

1.4.6. FlagInfo

{
  "__class__": "FlagInfo",
  "__value__": {
    "name": "BlueFlag",
    "team": "Blue",
    "position": [82.0, 20.0],
    "carrier": "Blue0",                                                     # optional bot name, null if the flag is not being carried
    "respawnTimer": -7.450580596923828e-09
  }
}

1.4.7. BotInfo

{
  "__class__": "BotInfo",
  "__value__": {
    "name": "Red3",
    "team": "Red",
    "seenlast": 13.370665550231934,                                         # time since the object was last seen, null if the object was never seen
    "position": [35.6309928894043, 26.81215476989746],                      # the last known position of the bot
    "facingDirection": [0.9375345706939697, -0.3478919267654419],           # the last known facing direction of the bot
    "health": 0,                                                            # the last known health of the bot
    "flag": "BlueFlag",                                                     # optional flag name of the flag being carried by this bot, null if the bot is not carrying a flag
    "state": 6,                                                             # the last known state/action of the bot
                                                                            # values are 0 = unknown, 1 = idle, 2 = defending, 3 = moving, 4 = attacking, 5 = charging, 6 = shooting, 7 = taking_orders, 8 = holding, 9 = dead
    "visibleEnemies": ["Blue0", "Blue1"],                                   # list of bot names for bots which this bot can see
    "seenBy": ["Blue0", "Blue1"]                                            # list of bot names for bots which can see this bot
  }
}

1.4.8. MatchInfo

{
  "__class__": "MatchInfo",
  "__value__": {
    "timePassed": 31.57537841796875,                                        # time (seconds) since the start of the game
    "timeRemaining": 148.42462158203125,                                    # time (seconds) until the end of the level
    "timeToNextRespawn": 13.427755355834961,                                # time (seconds) until the next bot respawn wave
    "scores": {"Blue": 0.0, "Red": 0.0},                                    # map of team name to score value
    "combatEvents": [{"__class__": "MatchCombatEvent", "__value__": ... }]  # list of MatchCombatEvent objects
  }
}

1.4.9. MatchCombatEvent

{
  "__class__": "MatchCombatEvent",
  "__value__": {
    "type": 1,                                                              # values are 0 = none,
                                                                            #            1 = bot killed,
                                                                            #            2 = flag picked up,
                                                                            #            3 = flag dropped
                                                                            #            4 = flag captured,
                                                                            #            5 = flag restored,
                                                                            #            6 = bot respawned
    "instigator": "Blue3",                                                  # optional bot name that caused the event,
                                                                            # null if the event was automatic (eg flag restored, bot respawn)
    "subject": "Red3",                                                      # bot or flag name that was the subject of the event
    "time": 14.939663887023926
  }
}

1.4.10. Defend Command

{
  "__class__": "Defend",
  "__value__": {
    "bot": "Blue0",
    "facingDirections": [[[1.0, 0.0], 1.0],                                 # an optional list of facingDirection (Vector2), time (float) pairs
                         [[0.0, 1.0], 1.0],
                         [[-1.0, 0.0], 1.0],
                         [[0.0, -1.0], 1.0]],
    "description": ""
  }
}

1.4.11. Move Command

{
  "__class__": "Move",
  "__value__": {
    "bot": "Blue1",
    "target": [[3.4, 14.9]],                                                # a list of 2 float arrays, these are a series of waypoints
    "description": ""
  }
}

1.4.12. Attack Command

{
  "__class__": "Attack",
  "__value__": {
    "bot": "Blue3",
    "target": [[6.0, 30.0]],                                                # a list of 2 float arrays, these are a series of waypoints
    "lookAt": [6.0, 30.0],                                                  # optional, null if the bot should look in the direction it is moving
    "description": ""
  }
}

1.4.13. Charge Command

{
  "__class__": "Charge",
  "__value__": {
    "bot": "Blue0",
    "target": [[83.6, 18.4]],                                               # a list of 2 float arrays, these are a series of waypoints
    "description": ""
  }
}

1.5. Change Notes

1.5.1. Protocol 1.4

released (January 15, 2012)

  • Changed some of the properties of BotInfo so they are no longer optional. These include seenLast, position, facingDirection, health. These values are either the current state or (for enemy bots which are not visible) the last known state. Current information is also known about enemy bots in the frame when they respawn.
  • Added STATE_DEAD to BotInfo.

1.5.2. Protocol 1.3

released (December 20, 2012)

  • Added STATE_HOLDING to BotInfo. This state is specified in BotInfo.state if an attack behavior is paused because the Bot would walk into the cone of fire of a visible enemy. See the python API BotInfo documentation for a description of each of the states.
  • Replaced FOVAngle in LevelInfo with fieldOfViewAngles. This is a list of field of view angles for each of the states a bot can be in.

1.5.3. Protocol 1.2.1

released (December 4, 2012)

  • Added respawnTime field to the LevelInfo object.
  • This change does not modify the required protocol versions. Existing network clients should still work with this change.

1.5.4. Protocol 1.2

released (November 21, 2012)

  • Added additional combat event types to MatchCombatEvent for flag restored and bot respawned events.
  • Renamed Defend command facingDirection to facingDirections. Modified this field be a list of direction (Vector2) and time(float) pairs.
  • Bumped the required protocol version to 1.2

1.5.5. Protocol 1.1

released (November 16, 2012)

  • Added ready message for the client to signal to the game when it is ready for the game to start.
  • Added initializationTime field to the LevelInfo object.
  • Added gameLength field to the LevelInfo object.
  • Bumped the required protocol version to 1.1

1.5.6. Protocol 1.0

released November 15, 2012

  • Initial version.