In RealTimeBattle, it is very simple to construct your own arenas. The
language consists of only eight commands, and there are essentially
three building blocks: line, circle and inner_circle. This is mainly
because of speed reason, for circles and lines it is very easy to
check if a collision has occured. Circle and inner_circle prevents
robots from entering into a circle or getting out of a circle
respectively. The line stops the robots from entering through the long
side, but no check is made on the short side, so you have to put
circles at each end of the line to make it a solid object. The
commands polygon
and closed_polygon
are intended to
simplify this procedure, always giving a proper object.
Note that RealTimeBattle does not check whether the arena file gives a correct arena, it is entirely up to you. However, it will complain if there are violations to the language rules.
Arena files should be given the postfix .arena
and be stored
in the arena directory, for RealTimeBattle to find them.
The bounce coefficient
and hardness
argument given to
all wall creating commands, determines the material of the wall. They
are both values between 0 and 1. Harder walls will injure colliding
robots more and higher bounce coefficient make them bounce better.
You are also encouraged to study the arenas included and learn from the examples.
A command consists of the command name and the arguments separated by whitespace. Be sure to give the right number of arguments!
In the command list, the arguments are given in square brackets.
This value times the arena scale will give the scale factor, by which all coordinates are multiplied. This command must be, if it exists, the very first in the file, default is 1.0.
The boundary encloses the area, in which robot,
cookies and mines are placed. It also determines the visible area in the
arena window. This command is required and may only be preceded by
scale
.
Robots are limited to the inside of this circle.
Circle shaped wall.
This will create a number of circles, connected by lines.
As a polygon
, but the first and the last vertices are also
connected by a line.
Creates a line. See the beginning of the chapter for more information.
When the arena inside the boundary consists of several separated areas, you should exclude all but one by inserting exclusion points. All points from which you can draw a straight line to an exclusion point without crossing a wall, are considered to be outside the arena.