Instructions

Bots are written in PHP, and hosted somewhere publicly accessible. A battle is started when a user selects various bots for the battle, invoking the Arena Master. The Arena Master will invoke each bot in turn, initializing them, then call them again for each round in the game until they are either destroyed or are victorious. Bots initiate actions (drive, scan, fire) by calling the Arena.
The arena will return the results of the actions in XML.

If you have any questions or just want to report on your progress, stop by the forum

How You Call The Server

Scanning

To scan the robot will call the arena giving the base degree to start at, the arena will scan 10 degrees and return back the position of any matching results.
A condition of each found bot is returned. This is a integer between 1 and 20.
Zero degrees is to the east (right), rotates counterclockwise.
Scanning consumes 7 Energy.

Parameters

method
scan
angle
The angle at which to scan from. Integer between 0 and 360

Sample return

<response>
 <requestValues>
   <method>scan</method>
   <clientKey>KEY</clientKey>
   <gameID>ID</gameID>
   <degree>230</degree>
 </requestValues>
 <responseValues>
   <hits>0</hits>
 </responseValues>
</response>	
<response>
 <requestValues>
   <method>scan</method>
   <clientKey>KEY</clientKey>
   <gameID>ID</gameID>
   <degree>230</degree>
 </requestValues>
 <responseValues>
   <hits>2</hits>
   <coords>
     <bot>
       <angle>235.007979801</angle>
       <distance>24.4131112315</distance>
       <condition>2</condition>
     </bot>
     <bot>
       <angle>235.784297868</angle>
       <distance>30.2324329157</distance>
       <condition>5</condition>
     </bot>
   </coords>
 </responseValues>
</response>

Firing

To fire the robot calls the arena giving the degree angle to fire on, a shot is fired and any bots within two degrees of that angle are hit. Any amount of energy (less than the total remaining) can be used to fire, the amount of energy used equals the amount of damage done.
Note that if multiple robots lie along that degree they will all receive damage equal to the amount of energy used.
Server will return the amount of damage done in total, and the number of bots that were hit.

Parameters

method
fire
angel
The angle at which to fire from. Int between 0 and 360
energy
The amount of energy to fire with

Sample return

<response>
 <requestValues>
   <method>fire</method>
   <degree>88</degree>
   <energy>24</energy>
   <clientKey>KEY</clientKey>
   <gameID>ID</gameID>
 </requestValues>
 <responseValues>
   <totalDamage>24</totalDamage>
   <botsHit>1</botsHit>
 </responseValues>
</response>
<response>
 <requestValues>
   <method>fire</method>
   <degree>88</degree>
   <energy>24</energy>
   <clientKey>KEY</clientKey>
   <gameID>ID</gameID>
 </requestValues>
 <responseValues>
   <totalDamage>0</totalDamage>
   <botsHit>0</botsHit>
 </responseValues>
</response>

Driving

To drive, you give the arena a direction and a distance to drive, each unit of distance consumes one point of energy. Running into a wall hurts.

Parameters

method
drive
direction
The direction to drive. They are as follows
  4
1 - 3
  2
distance
The distance to drive

Sample return

<response>
 <requestValues>
   <method>drive</method>
   <direction>4</direction
   <distance>25</distance>
   <clientKey>KEY</clientKey>
   <gameID>ID</gameID>
 </requestValues>
 <responseValues>
   <x>3</x>
   <y>5</y>
 </responseValues>
</response>

How The Server Calls Your

Start of the game

When the game starts, a call will be made to your bot with callType=gameInit.
This is so you are able to setup log and state files for the game id and whatever start-up operations you might need.
You should return the version number of your bot (used for stats).
If a empty page is returned, your bot is deactivated. Output longer than 50 chars is ignored

Parameters

callType
gameInit
serverKey
Your bot's key
gameID
A unique id for this game
serverURL
The url at which you should call the web-service
scanRange
A range in units of how far away scanning can see targets
scanDegrees
The number of degrees the scan covers
scanCost
The cost of a scan
driveCost
The cost to cover one unit when driving
driveBaseCost
The cost to start moving (that is, you have to use more energy to actually move)
fireWidth
The "width" of a shot. In degrees
fireRange
The range of your shots. Targets further away wont get hit
fireBaseCost
The cost to prepare your gun for fireing (that is, you have to use more energy to actually fire)

Each round

At each round, when your bot needs to do it's action, it is called with callType=round.
All output is ignored, and you should interact with the server via the webservice functions mentioned above.

Parameters

callType
round
serverKey
Your bot's key
gameID
A unique id for this game
url
The url at which you should call the web-service
armor
Your current level of armor
energy
The energy you have for this round

End of the Game

When the game is finished (that is, when your bot is below 0 armor), your bot is called with either callType=death or callType=victory.
There is no need for, nor is there any reason for output. If your bot died; weep silently. If you won; congratulate yourself silently.

Parameters

callType
death or victory
serverKey
Your bot's key
gameID
A unique id for this game

Notifications

Notifications aren't implemented yet, but will be in the near future.