In RealTimeBattle, it is very simple to construct your own arenas. The
language consists of only eleven commands, and there are essentially
four building blocks: line, circle, inner_circle and arc. 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 and the arc stop the robots from entering through
the long side ( the curved for the arc ), 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
, closed_polygon
and
poly_curve
are intended to
simplify this procedure, always giving a proper object.
All angles are by default in radians but can be changed to degrees by the
command angle_unit degrees
.
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.
Switches to the selected angle unit, which
can be either of degrees
or radians
. Default is radians.
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.
Creates a line. It only prevents the robot from passing through to long side, so remember to put circles at the short ends.
An arc is a sector of a ring within two angles. Like the line, it needs circles at both the ends.
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.
The poly_curve
is the most powerful of the arena commands. It is
used to build walls with lines and arcs. At each step you have a current
position and direction, which are affected by the subcommands. The last
subcommand must be C
or Q
.
Draw a line with given length in the current direction.
Turn the current dircetion.
Draw an arc.
Finish by connecting with the starting point.
Quit.
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.