Robliterator Manual

Introduction

The game is played through a series of ticks.

Robliterator consists of a cartesian grid representing a torus that forms the game world, upon which are found robots and other objects.

Each robot consists of:

An identifier
A number, used to represent the robot.
A URL
The address of the CGI script that controls the robot.
Whether the robot is active
A boolean indicating whether the robot is still active (1). Inactive robots (0) are reaped on the next tick.
Kills
The number of robots that the robot has destroyed.
An age
The number of ticks since the robot appeared.
A distance travelled
The number of squares that the robot has travelled.
An error count
The number of recent moves that were errors.

Each tick, a robot can either move in a cartesian direction, or shoot in a cartesian direction. Shots are instantaneous, fatal, and have unlimited range. It is possible for a robot to shoot itself if there are no other obstacles at all in the direction of the shot.

If a robot reaches 4 errors, then it self-destructs.

Protocol

Each tick, all the still-active robots are contacted using HTTP, and sent the status of the game. The robots must then respond with a command for their next turn.

Only port-80 "http:" URLs are supported. Passwords are not supported. In the response, everything except the first word of the entity body is ignored (redirects are not followed, for instance).

Each robot has about 5 to 10 seconds to respond, depending on how many robots are in play and how long it takes to contact them all.

There can only be one robot per hostname running at any one time; the hostname is used to identify the player.

Game state

The game state consists of three blocks of text, each delimited by a blank line.

The first block is a number giving the robot's identifier.

The second block is the state of each robot in play, in age order (oldest first). Each line consists of a space-separated set of fields:

The third block is the board state. Each line represents one row of the grid, and consists of a space-separated set of strings representing the board. Each string is one of the following:

.
A dot represents an empty space on the board.
W
A W represents an impassable wall.
A number
Each number represents one of the robots listed in the second section.

Commands

The valid commands are:

move-north
move-east
move-south
move-west
Attempt to move in the specified direction. Moving into another robot or a wall will result in a (harmless) collision, with no net movement for the robots involved.
fire-north
fire-east
fire-south
fire-west
Attempt to fire in the specified direction.
idle
Do nothing.
suicide
Kill yourself. If someone shoots you at the same time, they get the kill. Suicide does not count towards the number of kills. (If a robot kills itself using one of the fire-* commands, then it does count towards the number of kills.)

The first row is the northern-most side. The first string on each row is the western-most side.

In addition, the following commands are used to represent exceptional cases:

appear
This is the command used to represent the "first" action of a robot when it is first placed on the board, before its CGI script has been called.
error
This is the command used to represent cases where the CGI script did not give a valid command.

Results

The tick after a command has been given, the result of the robot's command will be visible in the second block sent to all the CGI scripts. The following result strings are possible:

appeared
The robot was placed on the board.
idled
The robot did nothing (likely because it didn't send a valid command).
moved
The robot moved as per its command.
collided
The robot tried to move but didn't.
killed
The robot fired its weapon and destroyed a robot.
missed
The robot fired its weapon but did not destroy anything.
suicide
The robot killed itself.

Source

The source of the server is available online:

ticker.pl
The main back-end program.
board.pm
The module implementing the board logic.
board.pm
The module implementing the robot logic.
database.pm
Helper module for database access.