Skip to content

Tracks & racing ​

Track lifecycle ​

A track stores ordered gates, sector boundaries, grid slots, corridors, props and cameras. Gates include position, heading, width, height and type (normal, sector, finish, pit, start).

Drafts are versioned. Saving includes expectedVersion, so an old editor cannot silently overwrite a newer save. Validation checks geometry and configured limits and reports errors, warnings and metrics. Publish makes a track available; staff verification is separate. Remix and hide routes preserve track identity/history semantics.

The creator frontend and client placement tools consume the same track contract. Session props register through np_prophandler and are removed with session cleanup. Fly-camera placement and GPS-native route generation feed the same geometry contract.

Creator design mockup

Event lifecycle ​

The server owns the phase sequence:

text
lobby → staging → countdown → live → finishing → results → closed

Hosts choose the track, discipline and permitted settings, invite drivers and check readiness. Host transfer and kick routes are authorization checked. Event kinds distinguish sanctioned/open/ranked/tournament sessions from street races; non-street races use routing buckets.

Lobby settings remain pre-start only. Ranked-kind events keep their discipline, class and ranked status; class/PI changes must admit every joined driver, and fees/buy-ins stay fixed after creation. Setting changes other than visibility clear readiness. Start rechecks the current vehicle/build. In-flight membership or refund operations may return join_pending/refund_pending; retry after they finish.

Start reserves the lobby throughout awaited validation, so new joins, readiness/settings changes, leave/kick and host transfer cannot overlap it. Join reserves capacity and rechecks phase, cancellation and crew access after awaited hooks, vehicle/provider checks and escrow charge. If eligibility disappears after charging, the server records a compensating exact-escrow refund; a persistence failure retains the obligation for cancel-pending recovery rather than accepting a late driver.

Crew visibility uses the host's authoritative stored membership captured by the server; callers do not supply a crew ID to authorize an event. Creation requires membership, joins must belong to the captured crew, switching an existing lobby to crew visibility requires every joined driver to belong to the host's crew, and start rechecks membership. Crew-restricted events are filtered from player event listings when the requester is outside that crew.

Circuit and sprint use ordered checkpoint progress. Starts include grid placement, frozen staging, participant-only countdown/release and jump-start penalties; reconnect grace defaults to 90 seconds. Drift uses server-sampled zones, clipping and tandem scoring. Drag uses staged timing. Time trials and elimination share the session infrastructure. In-world effects and controls still need live FiveM verification.

Timing and standings ​

The client tests the vehicle's segment against the bounded gate plane each frame. It interpolates the crossing fraction to avoid timing at only the end of a rendered frame. The server validates the ordered gate/lap sequence and position/timing plausibility and owns accepted progress and results.

Server ranking and standings snapshots default to 250 ms. The NUI receives standings, timing, world-marker and sector updates. Gap values follow shared progress/timing data rather than treating raw distance as a lap-time gap. Client reports and display telemetry never authorize payouts or records.

Matchmaking and the phone queue ​

queue.status (also core.queue.status) returns whether the authenticated player is queued, their discipline/class, advisory position/wait and up to eight valid verified candidate tracks. When not queued, requested filters default to circuit/D; while queued, the existing group takes precedence.

The phone exposes racing.queueStatus, racing.queueJoin, racing.queueLeave and racing.queueVote, mapping to the same authenticated backend checks. Join accepts circuit/sprint/drift/drag and a configured class; the current supported vehicle must match it, and an existing session or queue entry is rejected. Vote submits {trackId} for a verified valid track matching the queued discipline; incompatible votes return track_incompatible. Leave returns fresh unqueued status; supply filters if you want candidates for a particular group. Wait estimates are advisory seconds; vote deadlines use Unix seconds. See Exports & events for exact requests, replies and errors.

Street races ​

Street quick routes sample native GPS road nodes and are validated on the server: 2–512 route points, 100 m–30 km, segments at most 2.5 km and up to 720 interpolated gates. Endpoint proximity and route plausibility are also checked. A host consumes a USB to issue an in-memory one-use invite token; entered drivers may consume a flare for participant effects. Heat uses np_mechanic when available. Incidents emit np_racing:server:dispatch; supply a listener to route them to officers. Pink slips fail closed without a verified ownership provider; crypto stays off. Officer-count and speed-camera heat checks remain unimplemented.

Street race design mockup

Records and additional modes ​

Records are scoped by track version and class. Ghost saving uses a finished driver's server-recorded best-lap samples. Persistent replay traces support multi-driver playback and staff flag review; bounded or truncated traces may be unavailable.

Ranked settlement requires verified tracks and eligible event kinds. Matchmaking expands its rating window and accepts track votes. Seasons accumulate points, support configured dropped rounds and deliver top-three trophies with {seasonId, place} metadata; pending rewards retry on login. Crew management has its own persistence. Phone/tablet received-invitation cards display the crew name and expiry, then accept the stored recipient token without asking the player for a numeric crew ID. The server verifies and consumes that invitation. Tournament endpoints exist, but their exposed creation/bracket path remains under review.

Pending/failed prize and refund intents persist and retry on login; ambiguous delivery is held for staff reconciliation. Framework money calls and SQL acknowledgement are not one atomic transaction: a crash between them needs reconciliation. Existing vehicles and allowlisted rentals are supported; rentals grant no database ownership and use the current local vehicle service pending the shared handler.