Sides are described by text files. The filenames usually end in .gb.
A file is structured by tags, which begin with a #
. Tags mark the beginnings of sections and the end of the file, and also supply particular interesting bits of information.
Semicolons start comments, which continue to the end of the line. Comments are allowed anywhere, even after tags. Text that is not in a hardware or code section is also a comment; semicolons are not required.
Typical structure of a side file:
#side name
;information about the side
#seed 1 2 3 ;seeding order for the different types
#type name of a type
;information about the type
#hardware
;hardware definition
#code
;code
#type another type
;definition of this type
;and so on...
#end
See the hardware and code pages for information of the content of those sections. Also look at some sides.
Tags must be the first non-whitespace on a line.
Example | Meaning |
---|---|
#side Plant with scavengers
| Specifies the name of the side. Must be the first tag in the file. |
#author Somebody or other
| A convenient machine-recognizable way to identify a side or type's author. Optional. |
#date Spring 2026
| Was supposed to tell when a side was written. Deprecated because no one can remember to update it. |
#seed 3 1 1 2 1 #seed 1 | Optional. The numbers are the IDs of the types to seed, in order. The list implicitly repeats if there are not enough types listed. Energy not used for robots goes as a fetus inside the first robot seeded. If this tag is omitted, the seeding order is simply all the types, in order, excluding types with bombs. |
#color ccf
| Specifies the color of the side or type as a hexadecimal RGB or RRGGBB color string. |
#type fighter plus dodging
| Starts a type and specifies its name. |
#decoration FF0000 dot
| Sets a type's decoration, which is one of none , dot , circle , square , triangle , cross , x , hline , vline , slash , or backslash .
|
#hardware
| Starts a type's hardware section. Multiple hardware sections in a type are allowed. |
#code
| Starts a type's code section. If there is no code section, robots will be passive. There can be multiple code sections in a type. |
#const c 299792458 ;m/s
| Declares a constant. Valid only in code sections. |
#var arrival-time
| Declares a variable. Initial value defaults to 0 if omitted. Valid only in code sections. |
#vector target
| Declares a vector variable. Initial value defaults to (0, 0) if omitted. Valid only in code sections. |
#start
| Specifies where execution starts. If a label name is supplied, execution starts at that label; otherwise it starts after the #start tag. If omitted, start at the first instruction. Valid only in code sections.
|
#comment
| Starts a comment section, where text is ignored. Useful for commenting out blocks of code. #side and #type implicitly start a comment section.
|
#end
| Must be the last tag in a file. |