Log inGet started
▣
module · drop-in viewer
asset⌬ modulemoduleprimary: init.luau·originates fromworld 5164eb76-1…

tracks

The three circuits of Mario Kart OrigoZ, built from code on every scene load — nothing is frozen into the scene, so a reload lands in the same world.

by◐Cxrn·posted 19d ago
What it does

tracks

The three circuits of Mario Kart OrigoZ, built from code on every scene load — nothing is frozen into the scene, so a reload lands in the same world.

require("game.tracks"), then Core.system("tracks").

The circuits

idCircuitLapsWhat it is
cheepPlaya Cheep Cheep4A wobbly sand ring floating in turquoise water, with posts down both edges, twenty-two Cheep Cheep (some swimming, some leaping), palm islands in the shallows and a start gantry.
mumuPradera Mu Mu3A big square dirt route over a grass meadow — a wandering path with rounded corners, a shortcut cutting straight across the middle, fences, hills, fourteen cows (one in a sombrero) and two turning windmills.
arcoirisSenda Arcoiris4 pointsOne long point-to-point rainbow ribbon through black space, never revisited: Earth huge and far off down the course, stars, clouds floating beside the road, three chained balls patrolling the last stretch, and a finish gantry ringed with heart-shaped clouds.

Only one circuit is in the world at a time; select clears every circuit tree — by name, so a hot reload of this file cannot orphan one — and builds the one you asked for.

API

CallContract
T.select(id)Build and show that circuit, set its environment (sun, ambient, sky, Earth, sea, meadow), take the others down. Idempotent: selecting what is already up does nothing.
T.active()The active circuit's record from Core.CIRCUITS.
T.activeCircuit()The internal record: ribs, reach, gates, origin, closed, laps.
T.startPose(id?){ pos = {x,y,z}, yaw = radians } — on the line, facing down the course.
T.surfaceAt(pos)"road" / "water" / "grass" / "space". On a loop, off the ribbon is the circuit's out surface; on the ribbon it is space.
T.heightAt(pos)Y of the racing surface, or nil when there is none within reach.
T.progressAt(pos){ u = 0..1, lateral, onTrack, width, y, rise }. u is the distance round the racing line; rise is the local slope, and rampAt is `
T.rampAt(pos)True where the path climbs hard enough to launch off.
T.nearest(pos){ pos, yaw } — the nearest drivable point, high enough to drop back onto. Lakitu's target.
T.crossed(prev, cur)The gate a move crossed this frame — stateless, so many karts can share it.
T.advance(prev, cur)Crossed a gate and advanced the race: calls Core.reachPoint, which banks the lap or finishes the circuit. Returns { crossed, point, finished }. The kart owns the previous position; this owns the meaning.
T.crates(id)The ? crate spots for the circuit, in lap order — 5 rows of 4 on a loop, 8 rows of 4 on the ribbon.

Environment

sun, ambient and sky belong to the scene and the tracks set them per circuit; what each circuit owns (the sea, the meadow, the Earth) is spawned by this module.

Fields that are stand-ins for polish

Cow, CowSombrero, CheepCheep, ChainChomp, Earth, Windmill, Palm and HeartCloud are blockouts. Each is a named entity at the right place, size and scale, waiting for a generated model at the same transform.

Interface

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

conforms to

zero/source-extract/v2

game.tracks — the three circuits of Mario Kart OrigoZ. Everything about the places lives here: the shape of each circuit, the racing surface, what lies beyond its edges, the ramps, the props that make each one recognisable, and the queries the kart drives on. The circuits are built FROM CODE on every scene load — nothing is frozen into the scene — so the world reloads into exactly the same place. Only the active circuit is in the world at a time; selecting another takes the first one down. The build reads its numbers from game.core: width, laps, surface and what lies beyond the edges all come from Core.CIRCUITS.

ModelCheepCheepSpinChomp

len2(x: ?, z: ?) → void

argtypedescription
x?
z?

yawTo(dx: ?, dz: ?) → void

argtypedescription
dx?
dz?

hsv(h: ?, s: ?, v: ?) → void

argtypedescription
h?
s?
v?

box(parent: any, name: string, pos: { number }, scale: { number }, colour: { number }, yaw: number?, material: any?) →

Spawn one painted box under a parent: the workhorse of the build.

argtypedescription
parentany
namestring
pos{ number }
scale{ number }
colour{ number }
yawnumber?
materialany?

ball(parent: any, name: string, pos: { number }, scale: any, colour: { number }, material: any?) → void

Spawn a shaded sphere (rocks, hills, clouds, heads).

argtypedescription
parentany
namestring
pos{ number }
scaleany
colour{ number }
materialany?

ringPath(seed: ?) → void

A rib is one drivable ribbon: a polyline of points plus a half-width. `ribs[1]` is the main circuit and is the one progress is measured on; further ribs are alternative routes and shortcuts, which are road too.

argtypedescription
seed?

squarePath( ) → void

shortcutPath( ) → void

ribbonPath( ) → void

makeCircuit(id: ?) → void

argtypedescription
id?

gateAt(u: ?, closed: ?) → void

argtypedescription
u?
closed?

projectOnto(c: ?, rib: ?, x: ?, z: ?) → void

argtypedescription
c?
rib?
x?
z?

ensure( ) → any

A hot reload of this file resets everything above; a query that arrives before anything has re-laid a circuit lays the one the flow is on rather than answering from nothing.

nearestOnActive(x: ?, z: ?) → void

argtypedescription
x?
z?

buildRibbon(parent: ?, c: ?, rib: ?, kind: ?) → void

argtypedescription
parent?
c?
rib?
kind?

buildRails(parent: ?, c: ?, rib: ?, colour: ?) → void

argtypedescription
parent?
c?
rib?
colour?

buildGate(parent: ?, c: ?, gate: ?, colour: ?) → void

argtypedescription
parent?
c?
gate?
colour?

palm(root: ?, name: ?, x: ?, y: ?, z: ?, scale: ?) → void

Every one of these is a named stand-in: the polish pass replaces the recognisable ones (the fish, the cow, the Chain Chomp, the Earth) with generated models at the same transform.

argtypedescription
root?
name?
x?
y?
z?
scale?

buildFish(root: ?, c: ?) → void

argtypedescription
root?
c?

buildMeadow(root: ?, c: ?) → void

argtypedescription
root?
c?

buildSpace(root: ?, c: ?) → void

argtypedescription
root?
c?

at(u: ?) → void

argtypedescription
u?

buildCircuitGeometry(c: ?) → void

argtypedescription
c?

setEnv(id: ?) → void

The light and sky entities belong to the scene; the tracks change them to suit the place. Their own pieces (sea, meadow, Earth, stars) are spawned here and are code-owned.

argtypedescription
id?

despawnNamed(name: string) → void

argtypedescription
namestring

select(id: string) → void

Build and show a circuit; take every other one down.

argtypedescription
idstring

active( ) → void

The active circuit's record, or nil.

activeCircuit( ) → void

The active circuit's internal record (ribs, gates, origin).

startPose(id: string?) →

Where a racer starts on the active circuit.

argtypedescription
idstring?

surfaceAt(pos: any) →

What the wheels are on at a world position.

argtypedescription
posany

heightAt(pos: any) → void

The Y of the racing surface under a position, or nil off the road.

argtypedescription
posany

progressAt(pos: any) →

How far round the circuit a position is.

argtypedescription
posany

pointAt(u: number) →

A point on the racing line, `u` of the way round, and the heading there.

argtypedescription
unumber0..1 along the circuit's main rib.

examples

local p = Core.system("tracks").pointAt(0.5)

rampAt(pos: any) → void

True where the path is climbing hard enough to launch off.

argtypedescription
posany

nearest(pos: any) →

The nearest drivable point, for Lakitu to put the kart back on.

argtypedescription
posany

signedDistToGate(g: ?, x: ?, z: ?) → void

argtypedescription
g?
x?
z?

crossed(prev: any, cur: any) →

The gate a move crossed this frame, if any. Stateless: the caller keeps the previous position, which is what makes it safe for many karts at once.

argtypedescription
prevany
curany

advance(prev: any, cur: any) →

Test a move against the gates and advance the race when the right one is crossed. Called once a frame by the local kart.

argtypedescription
prevany
curany

crates(id: string?) →

The positions of the item crates for a circuit, in lap order.

argtypedescription
idstring?

mount( ) → void

Build the starting circuit and register the slice.

Sub-parts

Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.

19items
▣
module · born here
❒asset
# core The shared contract of **Mario Kart OrigoZ**. Every slice reads its rules here, so no slice hard-codes a number that belongs to the game. `require("game.core")` from anywhere in this world. ## What it holds | Field | What it is | |---|---| | `TITLE`, `PROMPT`, `ART` | The game's name, the *pulsa J para jugar* prompt, and the art-direction sentence — word for word from the reference pass, reused by every prompt. | | `CIRCUITS` | The three circuits: id, name, laps, layout (`ring` / `square` / `ribbon`), racing surface, what lies beyond the edges, and half-width. | | `KART` | How a kart feels: max speed, acceleration, braking, turn rates, hop and gravity, drift multipliers, trick spin. | | `SURFACE` | What each surface does to you: `road` 100%, `water` 75%, `grass` 50%, `space` falls. | | `SPARK` | The drift charge table: blue at 1.0s (0.5s boost), orange at 2.5s (1.25s), rainbow at 4.0s (2.5s). | | `BOOST` | Trick 0.75s, mushroom 2.0s, feather 2.0s. | | `ITEMS` | Crate respawn (8s) and the mushroom / feather odds. | | `RESCUE` | How Lakitu puts you back: drop height, lift speed, lift duration. | | `PHASE`, `flow`, `race` | The flow state machine and the live race clock. | | `records` | The best time on each circuit, kept in `runtime_data.world` — shared and durable. | ## API - `M.circuits()`, `M.circuit(id)`, `M.circuitIndex(id)` - `M.register(name, api)` / `M.system(name)` — how slices reach each other - `M.on(name, fn)` / `M.emit(name, payload)` — the slices' event bus (`phase`, `circuit`, `lap`, `crate`, `boost`, `rescue`, `finish`) - `M.setPhase(p)`, `M.selectCircuit(id)`, `M.openControls()`, `M.beginRace()`, `M.startRace()`, `M.tick(dt)`, `M.reachPoint(total)`, `M.finishRace()` - `M.records.get(id)` / `M.records.set(id, ms)` / `M.records.all()` - `M.formatTime(ms)` → `"00:45.678"`, `M.countdownLabel(seconds)` - `M.clamp`, `M.lerp`, `M.approach` ## Who reads what - **kart** — `KART`, `SURFACE`, `SPARK`, `BOOST`, `RESCUE`, `race`. - **tracks** — `CIRCUITS`, `SURFACE`, `reachPoint`, `PHASE`. - **items** — `ITEMS`, `BOOST`, `FEATHER_LIFT`, `emit("crate")`. - **screens** — `flow`, `race`, `records`, `formatTime`, `PHASE`. - **audio** — `on("phase")`, `on("boost")`, `on("crate")`, `on("finish")`.
▲ 0↑ born
◇
component · born here
❒asset
# Chomp One-paragraph description of what this component does and what it attaches to. Mention any required sibling components (e.g. Model, Transform). ## Public fields - `exampleNumber: number` — what it controls, units, valid range. - `exampleString: string` — what it controls. - `exampleBool: boolean` — what it controls. ## Methods - `:methodName(arg)` — what it does and when to call it. ## Lifecycle - `awake()` — same-frame attach hook. What initial state this component sets up. - `start()` — first-frame-after-awake hook. Cross-component setup that needs the other components on the entity to have finished `awake`. - `update(dt)` — per-frame while the gameplay clock runs. What this component does each tick. - `onDestroy()` — cleanup performed on detach / entity despawn. See `man components` for the full hook list (`onEnable`, `fixedUpdate`, `onPropertyChanged`, etc.) and the timing details. ## Usage ```luau entity(id).component.add("Chomp", { exampleNumber = 1.0 }) entity(id).component.get("Chomp"):methodName("foo") ```
▲ 0↑ born
◇
component · born here
❒asset
# CheepCheep One-paragraph description of what this component does and what it attaches to. Mention any required sibling components (e.g. Model, Transform). ## Public fields - `exampleNumber: number` — what it controls, units, valid range. - `exampleString: string` — what it controls. - `exampleBool: boolean` — what it controls. ## Methods - `:methodName(arg)` — what it does and when to call it. ## Lifecycle - `awake()` — same-frame attach hook. What initial state this component sets up. - `start()` — first-frame-after-awake hook. Cross-component setup that needs the other components on the entity to have finished `awake`. - `update(dt)` — per-frame while the gameplay clock runs. What this component does each tick. - `onDestroy()` — cleanup performed on detach / entity despawn. See `man components` for the full hook list (`onEnable`, `fixedUpdate`, `onPropertyChanged`, etc.) and the timing details. ## Usage ```luau entity(id).component.add("CheepCheep", { exampleNumber = 1.0 }) entity(id).component.get("CheepCheep"):methodName("foo") ```
▲ 0↑ born
◇
component · born here
❒asset
# Spin One-paragraph description of what this component does and what it attaches to. Mention any required sibling components (e.g. Model, Transform). ## Public fields - `exampleNumber: number` — what it controls, units, valid range. - `exampleString: string` — what it controls. - `exampleBool: boolean` — what it controls. ## Methods - `:methodName(arg)` — what it does and when to call it. ## Lifecycle - `awake()` — same-frame attach hook. What initial state this component sets up. - `start()` — first-frame-after-awake hook. Cross-component setup that needs the other components on the entity to have finished `awake`. - `update(dt)` — per-frame while the gameplay clock runs. What this component does each tick. - `onDestroy()` — cleanup performed on detach / entity despawn. See `man components` for the full hook list (`onEnable`, `fixedUpdate`, `onPropertyChanged`, etc.) and the timing details. ## Usage ```luau entity(id).component.add("Spin", { exampleNumber = 1.0 }) entity(id).component.get("Spin"):methodName("foo") ```
▲ 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. This asset, its contents, and its direct deps are clean as of the latest commit.
⌬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.