Repository navigation
Expand file tree
/
Copy pathremote_protocol
More file actions
38 lines (29 loc) · 1.72 KB
/
Copy pathremote_protocol
File metadata and controls
38 lines (29 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
This document describes the protocol with which the remote AI ("AI") and the controller communicates.
Every message is a line, with \n at the end.
Every turn begins with controller -> AI "BEGIN" and ends with AI -> controller "END".
Communication is always happens by one line alternating query/command and reply/ack.
AI -> controller
commands:
get speed
get coords
get team
get enemies
get friends
get bullets
get context
speed x y #sets the speed vector, will be limited with max speed if larger, x and y are floating point numbers
shoot x y #x and y are floating point numbers
end
controller -> AI
speed x y #x and y are floating point numbers
coords x y #x and y are floating point numbers
team n #n is int, 0 means everyone is enemy
enemies [team x y ]* #team is int, x and y are floating point numbers
friends [x y ]* #x and y are floating point numbers
bullets [team fx fy bx by ]* #team is int, fx, fy, bx and by are floating point numbers, giving the Front and Backof the bullet
context sizex sizey shipsize shipspeed\ #sizex and sizey are int, giving the size of the playground, shipsize gives the radius of the ships, shipspeed gives the maximum velocity
bullets cooldown laserlen \ #bullets give the maximum number of bullets shot before cooldown, cooldown is the recharge period required to bullets, laserlen is the length of the bullet
laserspeed deadtime #laserspeed is the speed the lasers travel each round, deadtime is the rounds spent dead when hit
ack
dead
begin