Log inGet started
World

Chairshift GP

Branchmain
Branchesmain
Commit5bdfb0c2a6

README.md

HARBOUR NIGHT

The circuit CHAIRSHIFT GP is raced on: 1121 m of street track, eleven corners, run under floodlights.

  START/FINISH   216 m of pit straight, the boost straight
  T1  MARINA     r 20   hard right off the straight, the harbour outside it
  T2  QUAYSIDE   r 34   long open right past the container yard
  T3/T4 CHICANE  r 13   left-right flick under the sponsor arch
  T5  SWEEPER    r 70   97 m of one radius, flat out, main grandstand
  T6  KINK       r 55   barely a lift, onto the 135 m north straight
  T7  CATHEDRAL  r 26   entry past the spire
  T8  HAIRPIN    r 15   40 m of arc round the hotel, the slowest point
  T9  RAMPART    r 16   exit along the old wall
  T10 DOCKSIDE   r 30   under the cranes
  T11 HARBOUR    r 30   long, slow, and it opens onto the straight

Every corner carries a lit board on its approach, and every corner has something beside it you can only find there — the marina, the containers, the grandstand, the spire, the hotel, the cranes, the pit lane. You should never have to look at a map to know where you are.

How it is built

The circuit is a closed polygon of eleven corner vertices, each fitted with a circular arc of a stated radius; the straights are whatever is left of the edges between them. The polygon closes, so the lap closes — a radius can be changed without re-solving the whole shape. CORNERS at the top of init.luau is the whole design.

That path is walked at a uniform 2.2 m step. Every other sample becomes the racing line published to the rest of the game through GP.setCentreline(points, { halfWidth = 8 }), which is the only thing any other slice reads from here.

The road, kerbs, walls, glowing panels and every piece of scenery are built as runtime meshes, one per material, rather than as thousands of cubes. A 1121 m circuit with a city around it costs 19 mesh entities, 26 floodlights and 13 lit boards.

Numbers worth knowing

Lap1121 m
Road16 m wide (halfWidth 8)
Verge2 m either side, then the wall
Wallinner face at 10 m — exactly where a chair is held
Longest straight216 m

The wall is drawn at halfWidth + 2, which is the same number the chair and the rivals clamp themselves to, so the barrier a driver hits is the barrier a driver sees.

Exports

  • Track.build() — publishes the racing line, then lays the circuit.
  • Track.update(dt) — re-publishes the line if the shared module reloads and resets it.
  • Track.teardown() — removes the circuit and the night grade.
  • Track.cornerAt(t) — the corner number and name at a lap fraction, or 0, "STRAIGHT".
  • Track.CORNERS — the design itself.