DriveGame
The Nürburgring car controller. It sits on the car root `nring_car`, which is the body of the scene's PlayerPrototype, so every joining player gets their own car.
DriveGame
The Nürburgring car controller. It sits on the car root nring_car, which is
the body of the scene's PlayerPrototype, so every joining player gets their
own car.
On the car this player owns it runs the pure-Luau vehicle physics
(nring.physics, 240 Hz fixed step), lap and sector timing, the HUD
(nring.hud) and settings panel, engine / tyre / wind audio, and poses the
car's wheels, lights and cockpit through nring.carvis. Other players' cars
are posed by replication; this component only voices their engine from the
synced rpm / throttle fields.
Controls come from the nring_drive input map (keyboard, gamepad and touch
for every control) and nring_shift while the manual gearbox is selected.
The camera is the player camera's NringChaseCam behaviour.
Per-player best lap and settings are kept in runtime_data.player, the
world lap record in runtime_data.world (nring/record).
Edit mode does nothing: the car template sits still in the editor.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2DriveGame: the Nürburgring car controller. Lives on the car root (`nring_car`), which the scene's PlayerPrototype clones for every joining player. The clone this peer owns is driven here: pure-Luau vehicle physics at 240 Hz (nring.physics, a port of esc5221/drive-game), lap timing, the HUD, engine audio and the car's visual pose. Other players' clones are posed by replication; this component only voices their engine from the synced rpm. Input comes from the `nring_drive` input map (keyboard, gamepad and touch for every control) and, with the manual gearbox, `nring_shift`. The camera is the player camera's NringChaseCam behaviour, which reads the local car through nring.gamestate.
flash(text: string, seconds: number?) → void
| arg | type | description |
|---|---|---|
| text | string | |
| seconds | number? |
stepTo(cur: number, target: number, rate: number, dt: number) → number
| arg | type | description |
|---|---|---|
| cur | number | |
| target | number | |
| rate | number | |
| dt | number |
updateInput(dt: number) → void
| arg | type | description |
|---|---|---|
| dt | number |
applyControls( ) → void
setView(v: string) → void
| arg | type | description |
|---|---|---|
| v | string |
invalidateRun( ) → void
a reset, a rewind or a restart spoils the lap and the BTG run in progress
recover(reason: string?) → void
| arg | type | description |
|---|---|---|
| reason | string? |
rewindSteps(snapshots: number) → number
step the car back `snapshots` rewind slots; returns how many it went back
| arg | type | description |
|---|---|---|
| snapshots | number |
rewindJump( ) → void
one tap (HUD button, or Reset pressed and let go quickly): back 3 s, or back on track when there is nothing to rewind
updateRewind(dt: number) → boolean
held Reset: the car runs backwards through the ring at 1.5x until released. Returns true while the physics is paused for it.
| arg | type | description |
|---|---|---|
| dt | number |
applyBrakeAssist( ) → void
braking assist: never faster into a corner than the racing line's target speed (which already carries its braking curve), looking a moment ahead for the brake to build
setManual(manual: boolean) → void
| arg | type | description |
|---|---|---|
| manual | boolean |
setTc(on: boolean) → void
| arg | type | description |
|---|---|---|
| on | boolean |
setAbs(on: boolean) → void
| arg | type | description |
|---|---|---|
| on | boolean |
setQuality(q: string) → void
| arg | type | description |
|---|---|---|
| q | string |
othersOnMap( ) → void
snapshot( ) → void
showMenu(open: boolean) → void
| arg | type | description |
|---|---|---|
| open | boolean |
refreshMenu( ) → void
initMapProj( ) → void
addLoop(name: string, clip: ?, volume: number, spatial: boolean) → void
| arg | type | description |
|---|---|---|
| name | string | |
| clip | ? | |
| volume | number | |
| spatial | boolean |
setupAudio(spatial: boolean) → void
| arg | type | description |
|---|---|---|
| spatial | boolean |
setIfChanged(src: ?, field: string, key: string, value: number, eps: number) → void
| arg | type | description |
|---|---|---|
| src | ? | |
| field | string | |
| key | string | |
| value | number | |
| eps | number |
band(x: number, a: number, b: number) → number
| arg | type | description |
|---|---|---|
| x | number | |
| a | number | |
| b | number |
updateEngineAudio(rpm: number, throttle: number) → void
three engine layers crossfaded by rpm, each pitched from its own recording
| arg | type | description |
|---|---|---|
| rpm | number | |
| throttle | number |
oneShot(clip: ?, volume: number, pitch: number?) → void
| arg | type | description |
|---|---|---|
| clip | ? | |
| volume | number | |
| pitch | number? |
updateAudio(dt: number) → void
| arg | type | description |
|---|---|---|
| dt | number |
localName( ) → string
loadSaved( ) → void
saveGhost(store: ?, key: string, lap: ?) → void
best-effort save of a ghost lap (a large value; a refusal is logged, not fatal)
| arg | type | description |
|---|---|---|
| store | ? | |
| key | string | |
| lap | ? |
lapCompleted(r: ?) → void
| arg | type | description |
|---|---|---|
| r | ? |
ghostRef( ) → void
the ghost this player races: their best, or the track record holder's
updateGhostLap( ) → void
record the lap being driven, refresh the live delta, pose the ghost car
setGhostMode(mode: string) → void
| arg | type | description |
|---|---|---|
| mode | string |
setLineMode(mode: string) → void
| arg | type | description |
|---|---|---|
| mode | string |
setBrakeAssist(on: boolean) → void
| arg | type | description |
|---|---|---|
| on | boolean |
setTimeOfDay(key: string) → void
time of day / weather: a per-player look preset (nothing synced)
| arg | type | description |
|---|---|---|
| key | string |
paceNote( ) → void
colourSector(i: number, t: number?, valid: boolean) → void
| arg | type | description |
|---|---|---|
| i | number | |
| t | number? | |
| valid | boolean |
sectorTick(r: ?) → void
| arg | type | description |
|---|---|---|
| r | ? |
boardRows(prefix: string) → void
laps, nring/btg/<id> for Bridge to Gantry), so two players finishing at
| arg | type | description |
|---|---|---|
| prefix | string |
refreshBoard( ) → void
boardPosition(prefix: string, t: number) → number
where a time places on a board, counting everyone else's best (the write of this player's own new row may not have landed yet)
| arg | type | description |
|---|---|---|
| prefix | string | |
| t | number |
postToBoard(t: number) → void
| arg | type | description |
|---|---|---|
| t | number |
btgTick(s0: number) → void
passing under the bridge starts the clock (interpolated back to the line)
| arg | type | description |
|---|---|---|
| s0 | number |
btgFinish( ) → void
the lap line is the gantry: stop the clock. Call before distAccum is zeroed (the anti-shortcut check reads it).
buildSummary(r: ?, prevBest: number?) → void
| arg | type | description |
|---|---|---|
| r | ? | |
| prevBest | number? |
titleSnapshot( ) → void
showTitle( ) → void
startCountdown( ) → void
restartLap( ) → void
countdownTick(dt: number) → void
start lights: one light every 0.9 s, all five out together after a random hold
| arg | type | description |
|---|---|---|
| dt | number |
revOnTheLine(dt: number) → void
| arg | type | description |
|---|---|---|
| dt | number |
updateMusic(dt: number) → void
| arg | type | description |
|---|---|---|
| dt | number |
updateTags( ) → void
startDriver( ) → void
lapInvalid( ) → void
awake( ) → void
writeRoot( ) → void
adaptQuality(frameDt: number) → void
| arg | type | description |
|---|---|---|
| frameDt | number |
update(engineDt: number) → void
| arg | type | description |
|---|---|---|
| engineDt | number |
onCallback(id: string, _data: any) → void
| arg | type | description |
|---|---|---|
| id | string | |
| _data | any |
onDestroy( ) → void
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Showing up to 3 levels deep. Open a part to see what it holds further down.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.