# Track Spec

A race track for slRaceTrack, written in Markdown. Hand this file to an agent with a
photo, map or description of a circuit and ask for a spec; paste the result into
[racetrack.candyjams.com](https://racetrack.candyjams.com).

```markdown
# Oak Hill GP

kind: circuit
parcel: 256 x 256
ground: 22

## Points
- 125, 30 | start
- 220, 30 | radius 30
- 220, 140 | radius 30 | bank 6
- 130, 140 | radius 30
- 130, 220 | radius 30
- 20, 220 | radius 30
- 20, 30 | radius 30
```

## How the points work

Each point is a **corner**. The track runs in straight lines from corner to corner and
rounds each corner off with a circular arc, so you describe a circuit the way you'd
sketch it: click the corners, say how tight each one is. A point on a straight
(like the `start` above) is just a marker and adds no corner.

Points go in driving order; the loop closes itself. `x` runs east and `y` north, in
metres from the parcel's south-west corner.

## Settings

| Setting | Values | Default |
|---|---|---|
| `kind` | `circuit`, `kart`, `oval`, `elevated` | `circuit` |
| `parcel` | `W x H` in metres | `256 x 256` |
| `ground` | terrain height in metres (region Z) | `22` |
| `width` | road width, metres (4–30) | by kind: 13 / 8 / 16 / 11 |
| `verge` | grass each side before the barrier, metres | by kind: 8 / 3 / 4 / 1.5 |
| `barrier` | `armco`, `concrete`, `tyres`, `none` | by kind |
| `kerbs` | `on`, `off` | on (oval: off) |
| `lights` | floodlight spacing in metres, or `off` | by kind: 48 / off / 40 / 32 |
| `gravel` | `on`, `off` — gravel traps on the outside of corners | on (circuit only) |
| `gantry`, `stands`, `pits` | `on`, `off` — start gantry, grandstands, pit building on the start straight, where they fit | on (elevated: off) |
| `props` | `off` turns gantry, stands and pits all off | — |

## Point options

After the coordinates, separated by `|`:

| Option | Meaning |
|---|---|
| `radius N` | corner radius in metres; left out, the corner takes the largest arc that fits |
| `start` | start/finish line here |
| `bank N` | degrees, raised on the outside of the turn |
| `z N` | height above ground, metres |
| `width N` | road width from here on |
| `loops N` | a **helix**: this corner turns N extra full circles, climbing from the height you arrive at to its own `z` as you leave it (needs 5.9 m per turn) |
| `jump N` | a **jump**: this point, on a straight, is the lip; the road kicks up into it, then an N m gap (3–30), then a landing no higher than the lip |
| `steep` | allows slopes up to 18% (instead of 12%) either side of this point — a corkscrew drop |

A helix is carried on a concrete core column; a jump's gap has no road, barrier or physics.

`z` and `width` left out are interpolated from the nearest points that set them, so
a ramp written at two points climbs evenly across the points between. `radius` and
`bank` belong to their own corner: left out, the corner is auto-radius and flat.
Everything eases smoothly from one corner to the next.

## Heights, embankments and bridges

`z` lifts the road above the ground. What holds it up is chosen for you:

| When | You get |
|---|---|
| on the ground | the slab sits in the terrain |
| raised, in open ground, up to 6 m | an earth embankment with grass slopes (1 in 1.5) |
| raised over another part of the track, near the parcel edge, or over 6 m | a bridge deck on concrete piers |
| `kind: elevated` | bridge everywhere — a skyway on piers |

The lap may cross itself **as a flyover**: where two parts pass over each other, their
road surfaces must be at least **5.9 m** apart (a 1.2 m deck plus 4.5 m headroom). Put a
point at the crossing on each side and give one of them the height, e.g. `z 8`, the other
`z 0`: heights ease from point to point, so each is level where they cross. Slopes may
not exceed 12%.

## Rules the builder enforces

- Points at least 2 m apart.
- A corner's `radius` must fit: its arc cannot use more of a straight than its neighbour leaves.
- Corner radius at least half the width + verge + 1.3 m, or the inside barrier folds over the road.
- Barriers inside the parcel.
- The track may not cross or run close to itself, except as a flyover with 5.9 m between decks.
- Slopes at most 12%.

A 180° hairpin is two 90° corners next to each other, e.g. `238, 78 | radius 50` then
`238, 178 | radius 50`: 100 m apart, so both 50 m arcs fit exactly.
