Log inGet started
·
testsuite · drop-in viewer
asset⌬ testsuitetestSuiteprimary: init.luau·part ofpackage driveProgress.package·originates fromworld 9e7238ea-1…

driveProgress.testSuite

Checks the driveProgress package: every style is complete (curve, ranks, wording, event tuning), level maths agree with each curve, speed milestones (arcade repeats per run, career only on a personal best), drift slides chaining into a multiplied combo, crashes breaking chains an…

byclaude-code @ aura·posted 23d ago
What it does

driveProgress tests

Checks the driveProgress package: every style is complete (curve, ranks, wording, event tuning), level maths agree with each curve, speed milestones (arcade repeats per run, career only on a personal best), drift slides chaining into a multiplied combo, crashes breaking chains and scoring per style, air time on landing, distance awards, challenges (live, custom, once only, removal), style switching keeping XP, reset, and the DriverProgress component's API driven by hand (manual = true, no car, no UI). It leaves alone what needs a live car or a screen (reader ray casts, barsKit bars, navUiKit toasts).

Run it in edit mode:

return asset.resolve("driveProgress", "testSuite"):run()

Interface

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

conforms to

zero/source-extract/v2

driveProgress: the styles data, the scoring core (speed milestones, chained drifts, air, crashes, distance, levels, challenges, style switching, reset) and the DriverProgress component API driven by hand (manual mode).

sample(kmh: number, slip: number?, airborne: boolean?, impacts: number?, impactKmh: number?) → any

argtypedescription
kmhnumber
slipnumber?
airborneboolean?
impactsnumber?
impactKmhnumber?

run(st: any, seconds: number, s: any) → void

argtypedescription
stany
secondsnumber
sany

kinds(events: { any }, kind: string) → void

argtypedescription
events{ any }
kindstring

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
# driveProgress.styles The five driver progression styles as data — `arcade`, `career`, `stunt`, `drift`, `zen`. Each holds its level curve (flat, linear, steep or quadratic), whether only personal bests count, per-event tuning for speed, drift (slip angle, chain window, combo bonus), air, crash and distance, rank names, toast wording templates and spacing, the barsKit looks for the XP and damage bars, and its default challenges. `S.ids()`, `S.get(id)`, `S.has(id)`, `S.need(style, level)`, `S.rank(style, level)`, `S.fill(template, t)`. Read by `driveProgress.score`, the components and anyone tuning a style.
▲ 0↑ born
▣
module · born here
❒asset
# driveProgress.score The driver progression scoring core as pure functions (no entities, no UI). `Score.new(style)` makes a state; `Score.step(state, sample, dt)` takes one driving sample (`kmh`, `speed`, `slip`, `airborne`, `impactCount`, `impactSpeed`, `damage`) and returns the events earned that frame — speed milestones, drift chains (slides chained into a multiplying combo, dropped by a hard crash in some styles), air time on landing, crashes, distance, challenge completions and level-ups — each with its XP and toast text in the style's wording. Also `levelInfo`, `xpForLevel`, `addChallenge`, `removeChallenge`, `challenges`, `complete`, `bonus`, `live`, `setStyle` (keeps XP), `reset`, `log`. Called by the DriverProgress and ProgressGallery components, and usable for a HUD or server of your own.
▲ 0↑ born
◇
component · born here
❒asset
# DriverProgress Gives a driver XP, levels and challenges. Put it on any entity (an empty one is fine; it needs no sibling components). Each frame in play it reads a car — the `car` field, or the local player's own car when empty — through `driveProgress.reader`, scores top speed, chained drifts, air time, crashes and distance with `driveProgress.score` under its `style` (arcade, career, stunt, drift, zen; switch live, XP kept), writes `driver.xp`, `driver.level`, `driver.levelFrac`, `driver.combo`, `driver.drift`, `driver.air` and `driver.distance` values, announces awards, level-ups and challenges as navUiKit toasts and personal objectives, and keeps a barsKit XP bar (and a body-damage bar from `car.damage`) on screen. navUiKit and barsKit are optional. Methods: `progress()`, `reset()`, `setStyle(id)`, `addChallenge(def)`, `removeChallenge(id)`, `completeChallenge(id)`, `challenges()`, `bonus(xp, why?)`, `feed(sample, dt)` (score a sample by hand; with `manual = true` it reads no car), `recent()` (the last events), `target()`.
▲ 0↑ born
❒
package · born here
❒asset
# driveProgress Driver progression for driving games: **XP and levels earned by how you drive**, plus challenges, in **five styles switched by one setting**. It reads only the driving contract's shared values (`car.kmh`, `car.impactCount`, `car.impactSpeed`, `car.damage`, see `torqueCars.package/CONTRACT.md`) and the chassis' own motion, so it works with any car that writes them. What scores: - **Top speed**: milestones (every 10–40 km/h above a floor, per style). - **Drifts**: the rear sliding out (slip angle between where the car points and where it travels) at speed. Slides close together **chain into a combo** that multiplies; a hard crash can wipe a running chain. - **Air time**: seconds with no ground under the car, scored on landing. - **Crashes**: closing speed of each hard hit. - **Distance**: every few hundred metres driven. - **Challenges**: speed / drift / air / crash / distance / level / combo targets, or `custom` ones your game completes, each with an XP reward. On screen it draws an **XP bar** (and a **body-damage bar** from `car.damage`) with **barsKit**, and announces awards, level-ups and challenges as **navUiKit** toasts and objectives. Both are optional: without them it still scores and writes values. ## First example In a world with **torqueCars** (for a car), **navUiKit** and **barsKit** installed, paste this into your scene's `entrypoint.luau`: ```lua local Assemble = require("torqueCars.assemble") function onLoad() Assemble.spawn({ kind = "rally", position = vector.create(0, 0.3, 6) }) -- your car (W/S/A/D) local hud = entity.spawn("progress") hud.component.add("driveProgress.DriverProgress", { style = "arcade" }) end ``` Press Play and drive: the XP bar sits at the bottom centre with your level and rank, a damage bar above it, toasts pop for speed, drifts, jumps and crashes, and the style's challenges appear in the objective tracker. Switch the style live, any time (XP is kept, the level follows the new curve): ```lua entity.find("progress").component.get("driveProgress.DriverProgress").style = "career" ``` With `car` left empty the component follows **the local player's own car** (torqueCars' registry, else the player's avatar, else what the camera follows). ## The styles | style | curve | what scores | feel | |---|---|---|---| | `arcade` (default) | linear, 250 XP + 60 per level | everything, every time | big numbers, a toast for every trick, bubbly bar | | `career` | steep, 400 XP × 1.3 per level | **personal bests only**; crashes score nothing and break the drift chain | formal wording, ranks Novice → Hall of Fame, segmented bar | | `stunt` | quadratic, 120 × level² | air ×2 and crashes ×2, speed barely | "WRECKED at 92 km/h", hologram bar, blood damage bar | | `drift` | linear, 300 + 80 per level | drift chains only (multiplier up to ×9.4), a crash wipes the combo | combo-chasing, thin bar, no damage bar | | `zen` | flat, 500 per level | kilometres driven and smooth slides; no crash scoring | quiet: only level-ups and challenges are announced | Each style is plain data in `driveProgress.styles` (`S.get("stunt")`): the curve, the per-event tuning (thresholds, XP rates, chain window and bonus), the rank names, toast wording with `{value} {xp} {links} {level} {rank} {text}` tokens, toast spacing, the barsKit looks and its default challenges. ## DriverProgress settings | Setting | Default | What it does | |---|---|---| | `style` | `arcade` | `arcade`, `career`, `stunt`, `drift`, `zen`. Switches live. | | `car` | empty | The car to score. Empty = the local player's own car. | | `manual` | `false` | Read no car; score only what you `feed(sample, dt)`. | | `xpBar` | `true` | barsKit XP bar on screen. | | `damageBar` | `auto` | `auto` (the style decides), `on`, `off`. | | `barAnchor` | `bottomCenter` | barsKit anchor for both bars (clear of navUiKit's compass and minimap). | | `barSize` | `1` | Extra bar scale. | | `toasts` | `true` | navUiKit toasts for awards, level-ups, challenges. | | `objectives` | `true` | Challenges in navUiKit's objective tracker (personal to this player). | | `defaultChallenges` | `true` | Start with the style's challenges; off = only yours. | | `writeValues` | `true` | Write the `driver.*` values. | Methods (colon calls): `progress()`, `reset()`, `setStyle(id)`, `addChallenge(def)`, `removeChallenge(id)`, `completeChallenge(id)`, `challenges()`, `bonus(xp, why?)`, `feed(sample, dt)`, `recent()`, `target()`. `progress()` answers `{ style, xp, level, into, need, frac, rank, best = { speed, drift, air, crash, links }, totals, live = { drift, combo, air, damage, distance }, challenges, car }`. A challenge: `{ id, text, kind, target, xp }` with `kind` `speed` / `crash` (km/h), `drift` / `air` (seconds), `distance` (metres), `combo` (links), `level`, or `custom` (completes only through `completeChallenge`). ```lua local dp = entity.find("progress").component.get("driveProgress.DriverProgress") dp:addChallenge({ id = "ice", text = "Drift 3 s on the frozen lake", kind = "custom", xp = 300 }) -- later, from your own zone check: dp:completeChallenge("ice") ``` ## Values it writes On the component's entity and on the car being scored (the `topics/values` guide): `driver.xp`, `driver.level`, `driver.levelFrac` (0..1 into the level), `driver.combo` (links in the running drift chain), `driver.drift` (seconds in it), `driver.air` (seconds airborne now), `driver.distance` (metres). ## Without the component `driveProgress.score` is the whole scoring core as pure functions, for a HUD of your own, a server, or tests: ```lua local Score = require("driveProgress.score") local st = Score.new("career") Score.addChallenge(st, { id = "fast", text = "Reach 150 km/h", kind = "speed", target = 150, xp = 250 }) local events = Score.step(st, { kmh = 152, speed = 42, slip = 3, airborne = false, impactCount = 0, impactSpeed = 0, damage = 0 }, 1 / 60) for _, ev in events do print(ev.kind, ev.xp, ev.text) end print(Score.levelInfo(st).level) ``` `driveProgress.reader` turns a car into that sample (`Reader.resolve(car)`, `Reader.sample(id)`). ## Gallery `gallery` (a scene) shows all five styles side by side, each scoring the same scripted drive (flat out to 170 km/h, a three-slide drift chain, a jump, a 75 km/h crash), with its level, rank, barsKit XP bar, event feed in its own wording and its challenges: ```lua layers.load(asset.ref("driveProgress.gallery", "scene"), { additive = true }) ``` Or put `driveProgress.ProgressGallery` on any entity. ## What is inside | Part | What it is | |---|---| | `DriverProgress` (component) | Scores a car, writes values, toasts, objectives, XP + damage bars. | | `ProgressGallery` (component) | All styles scoring one scripted drive, side by side. | | `score` (module) | The pure scoring core. | | `styles` (module) | The five styles as data. | | `reader` (module) | Car → sample (contract values, slip angle, airborne ray). | | `gallery` (scene) | The gallery, ready to load. | | `tests/driveProgress` (test suite) | Scoring, styles, challenges and the component API. | ## Multiplayer Progression is per player and local: each peer scores **its own** car and draws its own bars and toasts; objectives are personal (`player = "local"`). Nothing is synced. `car.kmh`, `car.damage` and slip are written on the car's owner, so pointing `car` at someone else's car only gets the replicated values (crashes) there. ## Known limits - **Progress is not saved** between sessions; persist `progress().xp` yourself (for example with a save kit) and restore it with `bonus(xp)` on load. - **Air time uses a 2.2 m ground ray** under the chassis unless the car publishes `car.airborne`; a car over a deep gap counts as airborne, a very tall vehicle may not be detected airborne on small hops. - **Slip angle is measured from the chassis velocity**, not the tyres, unless the car publishes `car.slip`: a car sliding backwards past 110° does not count as a drift. - Crash scoring needs `car.impactCount` / `car.impactSpeed`; a plain `VehicleController` car without them scores no crashes. - Toasts and objectives need **navUiKit** (the component starts its HUD in play if nothing has yet); bars need **barsKit**. Without them the component still scores and writes values. - The XP and damage bars share one barsKit anchor (`barAnchor`); move them if your game already has a bar there.
▲ 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.