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
(BZRobots Enhanced Protocol)
m (BZRobots Enhanced Protocol)
Line 31: Line 31:
 
|setFire
 
|setFire
 
|Sets a planned shot (for next 'execute')
 
|Sets a planned shot (for next 'execute')
 +
|-
 +
|setTurnRate
 +
|Sets next actions turnrate. (for next 'execute')
 +
|-
 +
|setSpeed
 +
|Sets next actions speed. (for next 'execute')
 
|-
 
|-
 
|getDistanceRemaining
 
|getDistanceRemaining

Revision as of 16:11, 23 June 2007

BZRobots Enhanced Protocol

This is a draft of the protocol that's being planned for the new bzrobots as a part of GSoC. The protocol is inspired by the API it will convey the messages of, which in turn is inspired by RoboCode. ;-)

Backend -> frontend messages
Message syntax Description
SOME_COMMAND_HERE <float> THIS RUNS SOME COMMAND WITH FLOAT ARGUMENT
Frontend -> backend messages
Message syntax Description
setAhead <distance> Sets planned movement (for next 'execute') that moves 'distance' units.
setBack <distance> Sets planned movement backwards, same as setAhead -distance
setTurnLeft <degrees> Sets planned turn (for next 'execute') that turns 'degrees' degrees to the left.
setTurnRight <degrees> Sets planned turn (for next 'execute') that turns 'degrees' degrees to the right, same as setTurnLeft -degrees.
setFire Sets a planned shot (for next 'execute')
setTurnRate Sets next actions turnrate. (for next 'execute')
setSpeed Sets next actions speed. (for next 'execute')
getDistanceRemaining Gives a 'distanceRemaining'-reply with how much is left of the currently planned movement.
getTurnRemaining Gives a 'turnRemaining'-reply with how much is left of the currently planned turn.
execute Runs a tick of the 'planned actions', and replies with a 'tick over' when the tick has passed.