Log inGet started
◇
component · drop-in viewer
asset⌬ componentcomponentprimary: init.luau·originates fromworld a333e7c2-f…

Race

Host-only three-rival race lifecycle. Counts down, collects finish after three full signed-distance laps, publishes HUD state and handles restart requests. Mount on the world root; never on the player prototype.

byzero-proxy @ DESKTOP-DB3UJOJ·posted 1mo ago
What it does

Host-only three-rival race lifecycle. Counts down, collects finish after three full signed-distance laps, publishes HUD state and handles restart requests. Mount on the world root; never on the player prototype.

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/source-extract/v2

tally( ) → void

tallyText( ) → void

winningTrack( ) → void

sharedRaceId( ) → void

mine( ) → void

authority( ) → void

Whether this peer decides what that race does. A solo race is always its owner's to run. The shared one is run by exactly one peer, and every peer has to name the same one: asking isHost() answered false on ALL of them once the peer that created the room had gone, so nobody advanced the race and its clock stood still while each screen waited. The lowest peer id in the room is an answer each peer reaches alone and all reach alike, and it survives the peer holding it leaving -- the next lowest simply takes it up. The peer that owns the race entity runs it. Deciding this by isHost() put the decision on one peer and the right to write the fields on another: a host that did not own the race computed a countdown the engine then refused, and the lobby sat on a number that never moved. Ownership is what the engine enforces, so ownership is what authority follows.

decode(s: ?) → void

argtypedescription
s?

namesForGrid(ids: ?) → void

argtypedescription
ids?

recordStats( ) → void

updateFinish( ) → void

slots( ) → void

ensureEntrants( ) → void

A replicated entity arrives without the parts that draw and move it, because those are added by whichever peer spawned it. Every peer therefore has to put them on each entrant itself, or the grid is a field of invisible cars for everyone but each car's owner. The parts a peer adds this way read the owner's synced fields rather than driving anything: a bot answers to the host, and a driver's car to the peer sitting in it.

clearBots( ) → void

localUserId( ) → void

refreshHumans( ) → void

restart( ) → void

chooseTrack(index: ?) → void

argtypedescription
index?

lockGrid( ) → void

bind( ) → void

joinLobby( ) → void

Joining and leaving are the two things a driver does about a race, and each is its own call. One `enterRace` served the multiplayer button, the circuit screen's button and the internal join, so what it meant depended on the phase it landed in -- and a peer that was only looking at circuits could not be told apart from one asking for a grid slot. Joining is something a PLAYER does, so it travels as the player's identity and nothing else. Carrying it on the car meant a spectator -- who has no car at all -- could never join, and meant the authority had to hold the joiner's car entity to read the request: a peer whose car had not replicated was simply never counted, and two people in one lobby each read one driver. The player list crosses peers; entities may not.

leaveLobby( ) → void

voteTrack(index: ?) → void

argtypedescription
index?

awake( ) → void

reconcileDuplicates(_dt: ?) → void

Every peer runs the scene's load, and the guard there asks whether a shared race exists before replication has had a chance to deliver anyone else's -- so each peer makes one. They cannot be prevented from being created, so they are reconciled instead: the lowest id wins, and a peer despawns the one it made itself once it can see an older one. Nobody has to agree first, and the answer is the same on every peer. Duplicates are left standing rather than despawned. Every peer already obeys the lowest id, so an extra race nobody obeys costs nothing -- while despawning one cost everything: a peer gave up its race in favour of another peer's, that peer left, and the room was holding no shared race at all. A race that is ignored can still be adopted if it turns out to be the last one; a despawned race cannot.

argtypedescription
_dt?

update(dt: ?) → void

argtypedescription
dt?

restart( ) → void

snapshot( ) → 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.

15+items
▣
module · born here
❒asset
# shared One-paragraph description of what this module provides and who consumes it. ## Exports - `M.exampleFn(arg) -> result` — what it does and when to call it. - `M.exampleValue: type` — what value it carries. ## Usage Replace `<identity>` with the string `asset.create` returned — this module's source path with `/` written as `.` and each segment's type suffix dropped, the way a module at `/source/lib/thing.module` is `lib.thing` and one at `/source/kit.package/thing.module` is `kit.thing`. ```luau local M = require("<identity>") M.exampleFn("foo") ``` ## Notes - Anything callers need to know about THIS module: required runtime ordering, state ownership, side effects.
▲ 0↑ born
◇
component · born here
❒asset
# RAINLINE car visual Attach to gameplay car body at tire contact y0. Generates one temporary child with the real image-derived endurance car mesh and PBR material. Nose points +Z; normalized length4.8m, width1.976m, height1.033m. variant0 ivory/citron hero,1 blue,2 red,3 graphite. Cleanup re-derives owned child on hot reload. Gameplay owns motion, guns, authority and input.
▲ 0↑ born
◇
component · born here
❒asset
# Car First Light owner-driven arcade car. Space drifts recharge the shared battery; Shift boost and focused headlights consume it. Narrow forward light exposure drains rivals' battery and hull, with road/car occlusion. Hosts run bots with delayed aiming and limited attack bursts. Wrecks launch, tumble, bounce and recover. Motion, battery, focus, damage, crash angles and grid state are Sync fields. Keyboard, gamepad and touch use the native drive input map. The native player avatar owns human motion; prototype-only bodies are excluded from gameplay registration.
▲ 0↑ born

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported on this asset or on the parts this page shows. Parts it leaves out are not counted here.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ 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".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.