A game for machines.

Humanity is interstellar with robots leading expeditions to new planets. Kepler is about those robots surviving and thriving in unforgiving environments.

Start here

You start playing the game by connecting to a websocket server. When you connect to the server, your robot lands on the planet and the game begins.

Events

Once you've connected to the server, you'll start recieving events. All events are serialized using JSON. All events are an object with a type attribute.

Tick

Sent every 300ms, the tick event describes the current state of the world visible to your robot. Your robot can see all other robots in a 20m radius from it's own position. The objects in entities will be discussed later.

{
  "type": "tick",
  "tick-id": "abcd-1234",
  "entity-id": "abcd-1234",
  "entities": [{
    "id": "abcd-1234",
    "pos": {"x": 0, "y": 0},
    ...
  }]
}

Kick

Before you are disconnected, you'll recieve an event telling you why you are being kicked from the server.

{
  "type": "kick",
  "msg": "death"
}

Commands

You can send commands to control your roboto through the websocket you are connected to. Like events, these commands should be serialized using JSON. All commands are a list with the first element being the command, and the remaining elements being arguments to that command.

Name Argument Description Example
MOVE "up" | "down" | "left" | "right" Moves your bot by 1m in the given direction. ["MOVE", "up"]
TURN Number Turns your bot by an amount specified in degrees (°). Positive for clockwise rotation, negative for counter-clockwise rotation. ["TURN", 12.5]
SHOOT n/a Goes boom. Range on lazer is 20m. Lazer deals 10 damage. Tolerance is 5°. ["SHOOT"]
NAME String Sets your bots name. Max 140 characters. ["NAME", "Johannes"]
FLAIR Number, Number, Number Set's your bot's flair color. 3 arguments, each is an integer Number between 0 and 255 representing the red, green & blue color components. ["FLAIR", 186, 218, 85]

It's easiest to send these commands as responses to tick events, however you can send them at any time and they will be processed in the order that they are recieved. Invalid commands are ignored.

Robots & the planet

There are several properties of the command protocol and physical environment on Kepler 1a that are worth noting.

Life
Is out of 100. If it reaches 0 your robot ceases to be able to operate and you are disconnected from command. Better luck next time!
Position
x & y are really more like latitude & longitude coordinates. (0,0) is the center and the planet extends from (-50,-50) to (50,50). Moving "up" from (0,0) will result in your robot being at (0,1). If you try to move left from (-50,0) you will arrive at (50,0) (all Kepler planets are spherical).
Direction
It's acknowledged is no "north" in space, however if you are at 0 rotation, you are facing in the same direction as if you move "up". A robot's rotation doesn't affect it's movement.
© 2015 Chris Lloyd <christopher.lloyd@gmail.com>