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)
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.


 
'''Frontend To Backend Messages'''
'''Backend To Frontend Messages'''
{| cellspacing="0" border="1"
{| cellspacing="0" border="1"
!Message syntax
!Message syntax
!Description
!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
|-
|-
|SOME_COMMAND_HERE <float>
|getTickRemaining <bot>
|THIS RUNS SOME COMMAND WITH FLOAT ARGUMENT
|Gives a 'getTickRemaining'-reply with how many seconds are left of this tick.
|}
|No
 
|-
 
|getTurnRemaining <bot>
'''Frontend To Backend Messages'''
|Gives a 'getTurnRemaining'-reply with how much is left of the currently planned turn.
{| cellspacing="0" border="1"
|'''Yes'''
!Message syntax
!Description
|-
|-
|setAhead <distance>
|mytanks
|Sets planned movement (for next 'execute') that moves 'distance' units.
|<explain>
|No
|-
|-
|setBack <distance>
|obstacles
|Sets planned movement backwards, same as setAhead -distance
|<explain>
|No
|-
|-
|setTurnLeft <degrees>
|othertanks
|Sets planned turn (for next 'execute') that turns 'degrees' degrees to the left.
|<explain>
|No
|-
|-
|setTurnRight <degrees>
|setAhead <bot> <distance>
|Sets planned turn (for next 'execute') that turns 'degrees' degrees to the right, same as setTurnLeft -degrees.
|Sets planned movement (for next 'execute'-s) that moves 'distance' units.
|No
|-
|-
|setFire
|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