This wiki is archived and useful information is being migrated to the main bzflag.org website

Difference between revisions of "BZRobots/Protocol"

From BZFlagWiki
Jump to: navigation, search
(Protocol Description)
(Protocol Description)
Line 3: Line 3:
  
 
=Protocol Description=
 
=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.
'''Backend To Frontend Messages'''
+
{| cellspacing="0" border="1"
+
!Message syntax
+
!Description
+
|-
+
|SOME_COMMAND_HERE <float>
+
|THIS RUNS SOME COMMAND WITH FLOAT ARGUMENT
+
|}
+
 
+
  
 
'''Frontend To Backend Messages'''
 
'''Frontend To Backend Messages'''
Line 19: Line 10:
 
!Message syntax
 
!Message syntax
 
!Description
 
!Description
 +
!Steady-state required?
 
|-
 
|-
|setAhead <distance>
+
|agent 1
|Sets planned movement (for next 'execute') that moves 'distance' units.
+
|Greets the backend.
 +
|No
 
|-
 
|-
|setBack <distance>
+
|bases
|Sets planned movement backwards, same as setAhead -distance
+
|<explain>
 +
|No
 
|-
 
|-
|setTurnLeft <degrees>
+
|constants
|Sets planned turn (for next 'execute') that turns 'degrees' degrees to the left.
+
|<explain>
 +
|No
 
|-
 
|-
|setTurnRight <degrees>
+
|execute <bot>
|Sets planned turn (for next 'execute') that turns 'degrees' degrees to the right, same as setTurnLeft -degrees.
+
|Runs a tick of the 'planned actions', and perhaps fires a shot (see setFire).
 +
|'''Yes'''
 
|-
 
|-
|setFire
+
|flags
 +
|<explain>
 +
|No
 +
|-
 +
|getDistanceRemaining <bot>
 +
|Gives a 'distanceRemaining'-reply with how much is left of the currently planned movement.
 +
|'''Yes'''
 +
|-
 +
|getGunHeat <bot>
 +
|Gives a 'getGunHeat'-reply with how many seconds are left of the gun cooldown.
 +
|'''Yes'''
 +
|-
 +
|getTickDuration <bot>
 +
|Gives a 'getTickDuration'-reply with how many seconds makes up one tick.
 +
|No
 +
|-
 +
|getTickRemaining <bot>
 +
|Gives a 'getTickRemaining'-reply with how many seconds are left of this tick.
 +
|No
 +
|-
 +
|getTurnRemaining <bot>
 +
|Gives a 'getTurnRemaining'-reply with how much is left of the currently planned turn.
 +
|'''Yes'''
 +
|-
 +
|mytanks
 +
|<explain>
 +
|No
 +
|-
 +
|obstacles
 +
|<explain>
 +
|No
 +
|-
 +
|othertanks
 +
|<explain>
 +
|No
 +
|-
 +
|setAhead <bot> <distance>
 +
|Sets planned movement (for next 'execute'-s) that moves 'distance' units.
 +
|No
 +
|-
 +
|setFire <bot>
 
|Sets a planned shot (for next 'execute')
 
|Sets a planned shot (for next 'execute')
 +
|No
 
|-
 
|-
|setTurnRate
+
|setSpeed <bot> <factor>
|Sets next actions turnrate. (for next 'execute')
+
|Sets next actions speed, value between 0 and 1.0. (for future 'execute'-s)
 +
|No
 
|-
 
|-
|setSpeed
+
|setTickDuration <bot> <seconds>
|Sets next actions speed. (for next 'execute')
+
|Sets the duration of a tick, in seconds.
 +
|No
 
|-
 
|-
|getDistanceRemaining
+
|setTurnLeft <bot> <degrees>
|Gives a 'distanceRemaining'-reply with how much is left of the currently planned movement.
+
|Sets planned turn (for next 'execute'-s) that turns 'degrees' degrees to the left.
 +
|No
 +
|-
 +
|setTurnRate <bot> <factor>
 +
|Sets next actions turnrate, value between 0 and 1.0. (for next 'execute'-s)
 +
|No
 
|-
 
|-
|getTurnRemaining
+
|shots
|Gives a 'turnRemaining'-reply with how much is left of the currently planned turn.
+
|<explain>
 +
|No
 
|-
 
|-
|execute
+
|teams
|Runs a tick of the 'planned actions', and replies with a 'tick over' when the tick has passed.
+
|<explain>
 +
|No
 
|}
 
|}
  

Revision as of 16:14, 27 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?
agent 1 Greets the backend. No
bases <explain> No
constants <explain> No
execute <bot> Runs a tick of the 'planned actions', and perhaps fires a shot (see setFire). Yes
flags <explain> No
getDistanceRemaining <bot> Gives a 'distanceRemaining'-reply with how much is left of the currently planned movement. Yes
getGunHeat <bot> Gives a 'getGunHeat'-reply with how many seconds are left of the gun cooldown. Yes
getTickDuration <bot> Gives a 'getTickDuration'-reply with how many seconds makes up one tick. No
getTickRemaining <bot> Gives a 'getTickRemaining'-reply with how many seconds are left of this tick. No
getTurnRemaining <bot> Gives a 'getTurnRemaining'-reply with how much is left of the currently planned turn. Yes
mytanks <explain> No
obstacles <explain> No
othertanks <explain> No
setAhead <bot> <distance> Sets planned movement (for next 'execute'-s) that moves 'distance' units. No
setFire <bot> Sets a planned shot (for next 'execute') No
setSpeed <bot> <factor> Sets next actions speed, value between 0 and 1.0. (for future 'execute'-s) No
setTickDuration <bot> <seconds> Sets the duration of a tick, in seconds. No
setTurnLeft <bot> <degrees> Sets planned turn (for next 'execute'-s) that turns 'degrees' degrees to the left. No
setTurnRate <bot> <factor> Sets next actions turnrate, value between 0 and 1.0. (for next 'execute'-s) No
shots <explain> No
teams <explain> No

See Also

BZRobots/About - Project Overview

BZRobots/Ideas - Feature suggestions / thoughts