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)
(Overview)
 
(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
=Overview=
 
=Overview=
This page describes the BZRobots Enhanced Protocol that is part of the Programmable Computer Player Client project for the [[Google Summer Of Code]].
+
This page describes the [[BZRobots]] Enhanced Protocol that forms the internals of the BZFlag Programmable Computer Player Client
  
=Protocol Description=
+
=Description=
 +
The [[BZRobots]] client currently consists of two parts called the "backend" and the "frontend". The "backend" is a lightweight game client that communicates with BZFS. It also runs a lightweight line-by-line text-based server, on which commands can be sent to control a robot. The "frontend" is an instance of a BZAdvancedRobot, including the necessary parts to communicate with the "backend".
  
 +
==Available Commands==
 +
See the [[BZRobots/API]] for the commands currently available to the BZRobots protocol.
  
'''Backend To Frontend Messages'''
+
==Legacy==
{| cellspacing="0" border="1"
+
Eventually, in an effort to simplify the internals of BZRobots, the "frontend" and "backend" will likely be altogether removed, thereby eliminating the internal protocol. It is recommended to develop bots in C or Python using the published API, rather than attempting to develop a seperate client for the BZRobot backend.
!Message syntax
+
!Description
+
|-
+
|SOME_COMMAND_HERE <float>
+
|THIS RUNS SOME COMMAND WITH FLOAT ARGUMENT
+
|}
+
 
+
 
+
'''Frontend To Backend Messages'''
+
{| cellspacing="0" border="1"
+
!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.
+
|}
+
 
+
=See Also=
+
[[BZRobots/About]] - Project Overview
+
 
+
[[BZRobots/Ideas]] - Feature suggestions / thoughts
+

Latest revision as of 06:14, 4 August 2009

Overview[edit]

This page describes the BZRobots Enhanced Protocol that forms the internals of the BZFlag Programmable Computer Player Client

Description[edit]

The BZRobots client currently consists of two parts called the "backend" and the "frontend". The "backend" is a lightweight game client that communicates with BZFS. It also runs a lightweight line-by-line text-based server, on which commands can be sent to control a robot. The "frontend" is an instance of a BZAdvancedRobot, including the necessary parts to communicate with the "backend".

Available Commands[edit]

See the BZRobots/API for the commands currently available to the BZRobots protocol.

Legacy[edit]

Eventually, in an effort to simplify the internals of BZRobots, the "frontend" and "backend" will likely be altogether removed, thereby eliminating the internal protocol. It is recommended to develop bots in C or Python using the published API, rather than attempting to develop a seperate client for the BZRobot backend.