Skip to content
Tempo on GitHub (opens in a new tab)

3.18 Create a game pack

You can write your own game pack as a TOML file. The robot and Tempo’s GUI have to load the same file. Every key is in the Game pack TOML reference.

The REEFSCAPE 2025 pack

The guides use this pack. It’s bundled as GamePacks.REEFSCAPE_2025 but it isn’t the default, so a robot that uses it has to pick it in code or install this file.

TOML
[meta]
name = "REEFSCAPE 2025"
year = 2025
version = 1

[field]
lengthM = 17.548
widthM = 8.052
origin = "alwaysBlue"
symmetry = "rotational"

[[obstacles]]
id = "bargePost"
shape = "cRectangle"
centerM = [8.774, 4.026]
lengthM = 0.61
widthM = 0.61
mirror = false

[[obstacles]]
id = "reef"
shape = "polygon"
sides = 6
centerM = [4.489, 4.026]
diameterM = 1.663
rotationDeg = 0

All values are in meters (meters = inches * 0.0254). bargePost has mirror = false because its red copy would land in the same place.

The snippets below show only the keys being described, so they only load as part of a complete pack.

Field coordinates

TOML
[field]
lengthM = 17.548
widthM = 8.052
origin = "alwaysBlue"     # or "fieldCenter"
fieldCenterM = [8.774, 4.026]   # optional: exactly half of lengthM and widthM

With alwaysBlue, (0, 0) is the blue alliance corner. With fieldCenter, it’s the middle of the field.

fieldCenterM is the point red elements are mirrored about, and you can leave it out. If you set it with alwaysBlue, set it to half of lengthM and half of widthM without rounding. A rounded value can push a mirrored element that touches the wall out of bounds.

Changing origin doesn’t translate the coordinates in the file. Translate every obstacle, region and pose with it, and your odometry too.

Obstacles

TOML
[[obstacles]]
id = "reef"
shape = "polygon"
sides = 6
centerM = [4.489, 4.026]
diameterM = 1.663     # across the flats
rotationDeg = 0       # one vertex points along +Y

Obstacles are the permanent structures the planner routes around, so leave game pieces out. The field walls don’t need an obstacle because routes are kept inside the field bounds.

The shapes are rectangle, cRectangle, circle and polygon. A polygon is either regular, like the reef, or a list of verticesM in order around the boundary. Their keys and limits are in Shapes.

Terrain

TOML
[[terrain]]
id = "ramp"           # an example; the REEFSCAPE 2025 pack has no terrain
shape = "rectangle"
minM = [3.96, 4.63]
maxM = [5.18, 6.48]

Terrain is something the robot can drive over, like a bump or a ramp. Routes go around it unless a leg crosses it with cross(Terrain.named(id)) or starts or ends inside it (Terrain crossings).

Regions and avoid zones

TOML
[[regions]]
id = "protectedZone"
shape = "rectangle"
minM = [6.0, 0.0]
maxM = [7.5, 2.0]
effect = "avoid"
enabled = true          # default; false starts it switched off

A region without an effect is a named area for conditions and stayWithin.

A region with effect = "avoid" is an avoid zone. Routes stay out of it unless they call ignore(Zone.named(id)). With enabled = false it starts off, and only a route that calls allow(Zone.named(id)) plans around it.

Symmetry

TOML
[field]
symmetry = "rotational"   # 180 deg about field center: 2022, 2025, 2026
# symmetry = "mirror"     # X reflected across the center line: 2023, 2024
# symmetry = "none"       # author both sides

[[obstacles]]             # both entries here leave out their shape keys
id = "asymmetricStructure"
mirror = false            # a blue element with no red copy

[[obstacles]]
id = "centerStructure"
alliance = "neutral"      # belongs to neither alliance, kept once

Every element is "blue" unless it sets alliance to "red" or "neutral". You write the blue and neutral elements, and symmetry sets how the red copies of the blue ones are made. Each red copy keeps its id, so a condition on a region, like inside(id), matches either copy.

Validate and install the pack

  1. Open Field in Tempo’s GUI, click Import, paste the TOML and click Import in the dialog.
  2. Click Use this pack, then draw paths near the structures and check the clearance.
  3. Save the file as src/main/deploy/tempo/game.toml.deploy/tempo/game.toml next to robot.py. In the desktop app, the Field screen can copy it into the connected robot project.
  4. Run an auto in simulation and compare the planned path with the robot’s pose in AdvantageScope.

The robot loads the deploy file at startup with no loading code, unless a pack is picked in code (How the robot finds it).

If it fails…

Shapes are too big or in the wrong place Above →

Inches were left unconverted, or X and Y are swapped. Coordinates are meters, and X is the field length.

A mirrored element is out of bounds Above → shape '{id}' extends outside field bounds (valid x=[{range}] y=[{range}]; shape aabb min=({point}), max=({point}))

fieldCenterM was rounded and the element touches the wall. Leave fieldCenterM out, or set it to half of lengthM and widthM without rounding.

A polygon is rejected Above → polygon outline must be simple: distinct vertices, non-zero area, and no two non-adjacent edges crossing or touching

Remove repeated vertices and list the vertices in order around the boundary so no edges cross.

A custom game pack won't load Troubleshooting →

The parser error names the problem, including a misspelled key. Check the pack against Game pack TOML.

esc

Loading search...