This wiki is archived and useful information is being migrated to the main bzflag.org website
Difference between revisions of "BZRobots/Protocol"
(→Protocol Description) |
|||
Line 37: | Line 37: | ||
|No | |No | ||
!style="background-color: #55ff55"|Yes | !style="background-color: #55ff55"|Yes | ||
+ | |- | ||
+ | |getBattleFieldHeight <bot> | ||
+ | |Gives a 'getBattleFieldHeight'-reply with the height of the map in "units". | ||
+ | |No | ||
+ | !style="background-color: #ff3333"|No | ||
+ | |- | ||
+ | |getBattleFieldWidth <bot> | ||
+ | |Gives a '|getBattleFieldWidth'-reply with the width of the map in "units". | ||
+ | |No | ||
+ | !style="background-color: #ff3333"|No | ||
|- | |- | ||
|getDistanceRemaining <bot> | |getDistanceRemaining <bot> | ||
− | |Gives a ' | + | |Gives a 'getDistanceRemaining'-reply with how much is left of the currently planned movement. |
|'''Yes''' | |'''Yes''' | ||
!style="background-color: #55ff55"|Yes | !style="background-color: #55ff55"|Yes | ||
Line 47: | Line 57: | ||
|'''Yes''' | |'''Yes''' | ||
!style="background-color: #55ff55"|Yes | !style="background-color: #55ff55"|Yes | ||
+ | |- | ||
+ | |getHeading <bot> | ||
+ | |Gives a 'getHeading'-reply with heading of the tank. | ||
+ | |'''Yes''' | ||
+ | !style="background-color: #ff3333"|No | ||
+ | |- | ||
+ | |getHeight <bot> | ||
+ | |Gives a 'getHeight'-reply with height of the tank. | ||
+ | |No | ||
+ | !style="background-color: #ff3333"|No | ||
|- | |- | ||
|getNumRounds <bot> | |getNumRounds <bot> | ||
Line 82: | Line 102: | ||
|'''Yes''' | |'''Yes''' | ||
!style="background-color: #55ff55"|Yes | !style="background-color: #55ff55"|Yes | ||
+ | |- | ||
+ | |getWidth <bot> | ||
+ | |Gives a 'getWidth'-reply with width of the tank. | ||
+ | |No | ||
+ | !style="background-color: #ff3333"|No | ||
+ | |- | ||
+ | |getX <bot> | ||
+ | |Gives a 'getX'-reply with x-coordinate of the tank. | ||
+ | |'''Yes''' | ||
+ | !style="background-color: #ff3333"|No | ||
+ | |- | ||
+ | |getY <bot> | ||
+ | |Gives a 'getY'-reply with y-coordinate of the tank. | ||
+ | |'''Yes''' | ||
+ | !style="background-color: #ff3333"|No | ||
|- | |- | ||
|mytanks | |mytanks |
Revision as of 17:13, 28 June 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? |
---|---|---|---|
agent 1 | Greets the backend. | No | Yes |
bases | <explain> | No | Yes |
constants | <explain> | No | Yes |
execute <bot> | Runs a tick of the 'planned actions', and perhaps fires a shot (see setFire). | Yes | Yes |
flags | <explain> | No | Yes |
getBattleFieldHeight <bot> | Gives a 'getBattleFieldHeight'-reply with the height of the map in "units". | No | No |
getBattleFieldWidth <bot> | getBattleFieldWidth'-reply with the width of the map in "units". | No | No |
getDistanceRemaining <bot> | Gives a 'getDistanceRemaining'-reply with how much is left of the currently planned movement. | Yes | Yes |
getGunHeat <bot> | Gives a 'getGunHeat'-reply with how many seconds are left of the gun cooldown. | Yes | Yes |
getHeading <bot> | Gives a 'getHeading'-reply with heading of the tank. | Yes | No |
getHeight <bot> | Gives a 'getHeight'-reply with height of the tank. | No | No |
getNumRounds <bot> | To be defined (or removed?) | No | No |
getRoundNum <bot> | Returns the number of times the bot has died (or?). | No | No |
getSpeed <bot> | Returns the current velocity, as per default - or as per last setSpeed. | No | No |
getTickDuration <bot> | Gives a 'getTickDuration'-reply with how many seconds makes up one tick. | No | Yes |
getTickRemaining <bot> | Gives a 'getTickRemaining'-reply with how many seconds are left of this tick. | No | Yes |
getTime <bot> | 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 <bot> | Gives a 'getTurnRemaining'-reply with how much is left of the currently planned turn. | Yes | Yes |
getWidth <bot> | Gives a 'getWidth'-reply with width of the tank. | No | No |
getX <bot> | Gives a 'getX'-reply with x-coordinate of the tank. | Yes | No |
getY <bot> | Gives a 'getY'-reply with y-coordinate of the tank. | Yes | No |
mytanks | <explain> | No | Yes |
obstacles | <explain> | No | Yes |
othertanks | <explain> | No | Yes |
setAhead <bot> <distance> | Sets planned movement (for next 'execute'-s) that moves 'distance' units. | No | Yes |
setFire <bot> | Sets a planned shot (for next 'execute') | No | Yes |
setResume <bot> | 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 <bot> <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 <bot> <factor> | Sets next actions speed, value between 0 and 1.0. (for future 'execute'-s) | No | Yes |
setTickDuration <bot> <seconds> | Sets the duration of a tick, in seconds. | No | Yes |
setTurnLeft <bot> <degrees> | Sets planned turn (for next 'execute'-s) that turns 'degrees' degrees to the left. | No | Yes |
setTurnRate <bot> <factor> | Sets next actions turnrate, value between 0 and 1.0. (for next 'execute'-s) | No | Yes |
shots | <explain> | No | Yes |
teams | <explain> | No | Yes |
See Also
BZRobots/About - Project Overview
BZRobots/Ideas - Feature suggestions / thoughts