This wiki was in read-only mode for many years, but can now be edited again. A lot of information will need to be updated.

BZRobots/Protocol: Difference between revisions

From BZFlagWiki
Jump to navigation Jump to search
Daxxar (talk | contribs)
Daxxar (talk | contribs)
Fixed some reply names, removed <bot>-references, GetBattleFieldWidth/Height -> GetBattleFieldSize
Line 13: Line 13:
!Implemented?
!Implemented?
|-
|-
|Execute <bot>
|Execute
|Runs a tick of the 'planned actions', and perhaps fires a shot (see SetFire).
|Runs a tick of the 'planned actions', and perhaps fires a shot (see SetFire).
|'''Yes'''
|'''Yes'''
Line 23: Line 23:
!style="background-color: #ff3333"|No
!style="background-color: #ff3333"|No
|-
|-
|GetBattleFieldHeight <bot>
|GetBattleFieldSize
|Gives a 'GetBattleFieldHeight'-reply with the height of the map in "units".
|Gives a 'BattleFieldSize'-reply with the size of the map in "units". (the map is size x size, and coordinates run from -size/2 to size/2)
|No
!style="background-color: #ff3333"|No
|-
|GetBattleFieldWidth <bot>
|Gives a '|GetBattleFieldWidth'-reply with the width of the map in "units".
|No
|No
!style="background-color: #ff3333"|No
!style="background-color: #ff3333"|No
Line 43: Line 38:
!style="background-color: #ff3333"|No
!style="background-color: #ff3333"|No
|-
|-
|GetDistanceRemaining <bot>
|GetDistanceRemaining
|Gives a 'GetDistanceRemaining'-reply with how much is left of the currently planned movement.
|Gives a 'DistanceRemaining'-reply with how much is left of the currently planned movement.
|'''Yes'''
|'''Yes'''
!style="background-color: #55ff55"|Yes
!style="background-color: #55ff55"|Yes
|-
|-
|GetGunHeat <bot>
|GetGunHeat
|Gives a 'GetGunHeat'-reply with how many seconds are left of the gun cooldown.
|Gives a 'GunHeat'-reply with how many seconds are left of the gun cooldown.
|'''Yes'''
|'''Yes'''
!style="background-color: #55ff55"|Yes
!style="background-color: #55ff55"|Yes
|-
|-
|GetHeading <bot>
|GetHeading
|Gives a 'GetHeading'-reply with heading of the tank.
|Gives a 'Heading'-reply with heading of the tank.
|'''Yes'''
|'''Yes'''
!style="background-color: #ff3333"|No
!style="background-color: #ff3333"|No
|-
|-
|GetHeight <bot>
|GetHeight
|Gives a 'GetHeight'-reply with height of the tank.
|Gives a 'Height'-reply with height of the tank.
|No
|No
!style="background-color: #ff3333"|No
!style="background-color: #ff3333"|No
Line 68: Line 63:
!style="background-color: #ff3333"|No
!style="background-color: #ff3333"|No
|-
|-
|GetNumRounds <bot>
|GetNumRounds
|To be defined (or removed?)
|To be defined (or removed?)
|No
|No
Line 83: Line 78:
!style="background-color: #ff3333"|No
!style="background-color: #ff3333"|No
|-
|-
|GetRoundNum <bot>
|GetRoundNum
|Returns the number of times the bot has died (or?).
|Returns the number of times the bot has died (or?).
|No
|No
Line 93: Line 88:
!style="background-color: #ff3333"|No
!style="background-color: #ff3333"|No
|-
|-
|GetSpeed <bot>
|GetSpeed
|Returns the current velocity, as per default - or as per last SetSpeed.
|Returns the current velocity, as per default - or as per last SetSpeed.
|No
|No
Line 103: Line 98:
!style="background-color: #ff3333"|No
!style="background-color: #ff3333"|No
|-
|-
|GetTickDuration <bot>
|GetTickDuration
|Gives a 'GetTickDuration'-reply with how many seconds makes up one tick.
|Gives a 'TickDuration'-reply with how many seconds makes up one tick.
|No
|No
!style="background-color: #55ff55"|Yes
!style="background-color: #55ff55"|Yes
|-
|-
|GetTickRemaining <bot>
|GetTickRemaining
|Gives a 'GetTickRemaining'-reply with how many seconds are left of this tick.
|Gives a 'TickRemaining'-reply with how many seconds are left of this tick.
|No
|No
!style="background-color: #55ff55"|Yes
!style="background-color: #55ff55"|Yes
|-
|-
|GetTime <bot>
|GetTime
|RoboCode: "Returns the game time of the current round, where the time is equal to the current turn in the round." - Will most likely return number of times you've 'execute'-d. Alternatively; return elapsed seconds / tickDuration (but tickDuration can change), or elapsed seconds.
|RoboCode: "Returns the game time of the current round, where the time is equal to the current turn in the round." - Will most likely return number of times you've 'execute'-d. Alternatively; return elapsed seconds / tickDuration (but tickDuration can change), or elapsed seconds.
|'''Yes'''
|'''Yes'''
!style="background-color: #ff3333"|No
!style="background-color: #ff3333"|No
|-
|-
|GetTurnRemaining <bot>
|GetTurnRemaining
|Gives a 'GetTurnRemaining'-reply with how much is left of the currently planned turn.
|Gives a 'TurnRemaining'-reply with how much is left of the currently planned turn.
|'''Yes'''
|'''Yes'''
!style="background-color: #55ff55"|Yes
!style="background-color: #55ff55"|Yes
|-
|-
|GetWidth <bot>
|GetWidth
|Gives a 'GetWidth'-reply with width of the tank.
|Gives a 'Width'-reply with width of the tank.
|No
|No
!style="background-color: #ff3333"|No
!style="background-color: #ff3333"|No
|-
|-
|GetX <bot>
|GetX
|Gives a 'GetX'-reply with x-coordinate of the tank.
|Gives a 'X'-reply with x-coordinate of the tank.
|'''Yes'''
|'''Yes'''
!style="background-color: #ff3333"|No
!style="background-color: #ff3333"|No
|-
|-
|GetY <bot>
|GetY
|Gives a 'GetY'-reply with y-coordinate of the tank.
|Gives a 'Y'-reply with y-coordinate of the tank.
|'''Yes'''
|'''Yes'''
!style="background-color: #ff3333"|No
!style="background-color: #ff3333"|No
|-
|-
|IdentifyFrontend 0001
|IdentifyFrontend <version>
|Greets the backend. (specifying protocol-version 0001)
|Greets the backend. (specifying protocol-version <version>, under development: 0001)
|No
|No
!style="background-color: #55ff55"|Yes
!style="background-color: #55ff55"|Yes
|-
|-
|SetAhead <bot> <distance>
|SetAhead <distance>
|Sets planned movement (for next 'execute'-s) that moves 'distance' units.
|Sets planned movement (for next 'execute'-s) that moves 'distance' units.
|No
|No
!style="background-color: #55ff55"|Yes
!style="background-color: #55ff55"|Yes
|-
|-
|SetFire <bot>
|SetFire
|Sets a planned shot (for next 'execute')
|Sets a planned shot (for next 'execute')
|No
|No
!style="background-color: #55ff55"|Yes
!style="background-color: #55ff55"|Yes
|-
|-
|SetResume <bot>
|SetResume
|Overwrites and restores the bots current actions (distance and turn) from a previous call to SetStop. This will fail if there are no previous SetStop-calls. Will not restore until you 'execute'. (If you call SetAhead, SetTurn etc before this, they will be overwritten unless SetResume fails)
|Overwrites and restores the bots current actions (distance and turn) from a previous call to SetStop. This will fail if there are no previous SetStop-calls. Will not restore until you 'execute'. (If you call SetAhead, SetTurn etc before this, they will be overwritten unless SetResume fails)
|No
|No
!style="background-color: #ff3333"|No
!style="background-color: #ff3333"|No
|-
|-
|SetStop <bot> <overwrite>
|SetStop <overwrite>
|Stores and clears the bots current actions (distance and turn). If you've previously called SetStop and not SetResume, this will fail unless you've Set overwrite to true. Does not store & clear until you call 'execute'. (You can call SetAhead, SetTurn etc after this, and they will become the 'new' values, instead of 0.)
|Stores and clears the bots current actions (distance and turn). If you've previously called SetStop and not SetResume, this will fail unless you've Set overwrite to true. Does not store & clear until you call 'execute'. (You can call SetAhead, SetTurn etc after this, and they will become the 'new' values, instead of 0.)
|No
|No
!style="background-color: #ff3333"|No
!style="background-color: #ff3333"|No
|-
|-
|SetSpeed <bot> <factor>
|SetSpeed <factor>
|Sets next actions speed, value between 0 and 1.0. (for future 'execute'-s)
|Sets next actions speed, value between 0 and 1.0. (for future 'execute'-s)
|No
|No
!style="background-color: #55ff55"|Yes
!style="background-color: #55ff55"|Yes
|-
|-
|SetTickDuration <bot> <seconds>
|SetTickDuration <seconds>
|Sets the duration of a tick, in seconds.
|Sets the duration of a tick, in seconds.
|No
|No
!style="background-color: #55ff55"|Yes
!style="background-color: #55ff55"|Yes
|-
|-
|SetTurnLeft <bot> <degrees>
|SetTurnLeft <degrees>
|Sets planned turn (for next 'execute'-s) that turns 'degrees' degrees to the left.
|Sets planned turn (for next 'execute'-s) that turns 'degrees' degrees to the left.
|No
|No
!style="background-color: #55ff55"|Yes
!style="background-color: #55ff55"|Yes
|-
|-
|SetTurnRate <bot> <factor>
|SetTurnRate <factor>
|Sets next actions turnrate, value between 0 and 1.0. (for next 'execute'-s)
|Sets next actions turnrate, value between 0 and 1.0. (for next 'execute'-s)
|No
|No

Revision as of 13:59, 9 July 2007

Overview

This page describes the BZRobots Enhanced Protocol that is part of the Programmable Computer Player Client project for the Google_Summer_of_Code.

Protocol Description

The protocol is linebased, and works on a request-reply basis. Below is a table of all available requests. The backend has something called a steady-state - this is basically when the backend is idle, and the tank likewise. Some commands will only work in this steady-state (because they will only make sense when the bot is not doing anything), and if one of these commands are sent when the bot is in active-state the backend will not reply until the backend has entered steady-state (and any commands sent after the first command are queued for handling until the blocking command has been handled). These commands are marked with "Yes" in the "Steady-state required?"-column.

Frontend To Backend Messages

Message syntax Description Steady-state required? Implemented?
Execute Runs a tick of the 'planned actions', and perhaps fires a shot (see SetFire). Yes Yes
GetBases <explain> No No
GetBattleFieldSize Gives a 'BattleFieldSize'-reply with the size of the map in "units". (the map is size x size, and coordinates run from -size/2 to size/2) No No
GetConstants <explain> No No
GetFlags <explain> No No
GetDistanceRemaining Gives a 'DistanceRemaining'-reply with how much is left of the currently planned movement. Yes Yes
GetGunHeat Gives a 'GunHeat'-reply with how many seconds are left of the gun cooldown. Yes Yes
GetHeading Gives a 'Heading'-reply with heading of the tank. Yes No
GetHeight Gives a 'Height'-reply with height of the tank. No No
GetMyTanks <explain> No No
GetNumRounds To be defined (or removed?) No No
GetObstacles <explain> No No
GetOtherTanks <explain> No No
GetRoundNum Returns the number of times the bot has died (or?). No No
GetShots <explain> No No
GetSpeed Returns the current velocity, as per default - or as per last SetSpeed. No No
GetTeams <explain> No No
GetTickDuration Gives a 'TickDuration'-reply with how many seconds makes up one tick. No Yes
GetTickRemaining Gives a 'TickRemaining'-reply with how many seconds are left of this tick. No Yes
GetTime RoboCode: "Returns the game time of the current round, where the time is equal to the current turn in the round." - Will most likely return number of times you've 'execute'-d. Alternatively; return elapsed seconds / tickDuration (but tickDuration can change), or elapsed seconds. Yes No
GetTurnRemaining Gives a 'TurnRemaining'-reply with how much is left of the currently planned turn. Yes Yes
GetWidth Gives a 'Width'-reply with width of the tank. No No
GetX Gives a 'X'-reply with x-coordinate of the tank. Yes No
GetY Gives a 'Y'-reply with y-coordinate of the tank. Yes No
IdentifyFrontend <version> Greets the backend. (specifying protocol-version <version>, under development: 0001) No Yes
SetAhead <distance> Sets planned movement (for next 'execute'-s) that moves 'distance' units. No Yes
SetFire Sets a planned shot (for next 'execute') No Yes
SetResume Overwrites and restores the bots current actions (distance and turn) from a previous call to SetStop. This will fail if there are no previous SetStop-calls. Will not restore until you 'execute'. (If you call SetAhead, SetTurn etc before this, they will be overwritten unless SetResume fails) No No
SetStop <overwrite> Stores and clears the bots current actions (distance and turn). If you've previously called SetStop and not SetResume, this will fail unless you've Set overwrite to true. Does not store & clear until you call 'execute'. (You can call SetAhead, SetTurn etc after this, and they will become the 'new' values, instead of 0.) No No
SetSpeed <factor> Sets next actions speed, value between 0 and 1.0. (for future 'execute'-s) No Yes
SetTickDuration <seconds> Sets the duration of a tick, in seconds. No Yes
SetTurnLeft <degrees> Sets planned turn (for next 'execute'-s) that turns 'degrees' degrees to the left. No Yes
SetTurnRate <factor> Sets next actions turnrate, value between 0 and 1.0. (for next 'execute'-s) No Yes

See Also

BZRobots/About - Project Overview

BZRobots/Ideas - Feature suggestions / thoughts