Δ9Φ963 · design canon

Haven Rally v1.3

Arcade racer in this browser. Four live chassis, three circuit highways, an endless start-to-finish run with traffic and guns, and a real drag strip. Ghost of your best heat. Local ledger. No account. This page is the spec the live client follows. RESOURCE on the public page; dual ledgers / Star Chart stay CANON.

Play Arcade Ledger

1. Loop

Circuits. Countdown 3–2–1–GO (Options can skip). Full heats: Pine Coil 24 laps, Coral Coast 20, Singularity Ring 30. After the track pick: Solo ghost, 2P split-screen, vs AI (Reed / Mira / Kai), or 2P+AI. Pass sector gantries, then the start line. Slide charges boost. Beat the ghost in Solo for this circuit + craft.

Custom race. Choose 1–60 laps and a seed (roll or type hex). The client builds a closed four-lane polar loop from that seed, same seed is the same ribbon. Then the same grid card (solo / split / AI). Ghosts key off custom-<seed>|craft.

Endless. One seeded start-to-finish highway, ~28,000 yd (~16 mi), four lanes, checkpoints, tunnel, FINISH gantry. Light traffic as obstacles. Right Shift spends the boost bar for speed and front guns; empty bar fires nothing. Wrecks sip boost, add score, and raise an uncapped combo. Each combo point is +5 mph top speed. Ram a car or leave the asphalt and the chain (and the bonus speed) dumps. Boost trickles slowly on-track; drift still charges it. Original announcer vocals fire on the streak ladder. High score stays in this browser.

Drag. Stage, READY, sportsman Christmas tree, AI in an inner lane. Trap speed and ET write to the local hall.

2. Controls

InputAction
W / ↑Throttle (solo). Split: P1 is W only; P2 is ↑
Space / S / ↓Brake. Split: P1 Space/S; P2 ↓
A / ←Steer left. Split: P1 A; P2 ←
D / →Steer right. Split: P1 D; P2 →
Left ShiftE-brake / drift (kills grip, extra yaw, sparks)
Right ShiftBoost (meter). Endless: also fires twin nose guns while the bar lasts
RRestart heat / return to staging on drag
FDrag: snap both lanes to the line and run the tree
CCycle P1 camera: Chase, Close, Hood, Bumper, Cockpit, TV
VSplit: cycle P2 camera
GamepadLeft stick steer, RT throttle, LT brake, A throttle, B / LB e-brake, RB / Y boost. One pad is P2; two pads are P1 then P2
EscClose sheet, then menu

Dock Options (and the title card) open the configuration sheet. Race clock freezes while any overlay is open. First pointer or key arms procedural SFX and announcer buffers.

Grid (circuits). After picking Pine / Coral / Ring: Solo ghost, 2P split (left/right cameras), vs AI (Reed, Mira, Kai on stacked chassis + driver bonuses), or 2P+AI. Bots read curvature ahead, brake to a corner speed, cut an inside line, pass if blocked, and dump boost on the straight. Drag AI is a separate tree/shift model. Cars bump. Heat ends when every human has finished (18 s grace after the first human). Ghosts stay solo-only.

3. Physics (math first)

World yards; engine SI. Every craft is craftNorm’d so new cars only need stats. Apex Mk I is the GT baseline; Boxcut Mk I is the short-box truck.

Engine. Torque curve (N·m) peaks at tqRpm from torque lb-ft. Fuel cut at redline. Wheel force T × gear × final × η / r. Aero top speed v³ = P / (½ ρ Cd A), plus combo bonus on Endless.

Gears (launch pack). Shared six-speed [3.28, 2.08, 1.48, 1.16, 0.97, 0.84]. 1–2–3 are the hole-shot: tall enough to stay in, extra drive so they slingshot (1st can light the rears; 2nd/3rd hook). Upshift ~96.5% redline in those three, with a small speed kick on the 1→2 and 2→3. 4th-on is the boat: softer torque, earlier shift (~91.5% redline), speed piles on instead of launching. Clutch open ~0.09–0.14 s on a shift. Downshift when RPM would sit under the torque peak.

Drive. rwd / fwd / awd sets which axle gets torque. Traction μ N_driven with weight shift. If drive force exceeds that, wheelSlip rises: RWD yaws (spin), FWD pushes wide, AWD holds longer. Future HP upgrades without extra μ will spin.

Brake / slide. brakeMu × mass × g × 0.72. E-brake is extra rear μ and a slide. Lateral: vh chases heading at a rate from μ. On-track slip charges boost; Right Shift spends it. Off-track is time-scaled dump, not a per-frame kill.

Boost. Bar 0…boostTank (Apex 1.00, Sleet 1.15, Boxcut 1.42, Flick 1.85). Drain is the same rate, so Flick’s bar lasts longest. While Right Shift is down: extra torque BOOST_TQ × boostPower (0.78×), top-speed cap × (1 + 0.28 × boostPower), and aero drag is scaled so that cap is reachable. Apex is the 1.00× baseline; Boxcut 1.25×; Flick 1.50×; Sleet 1.08×. Endless wrecks add ~0.11 tank (tractor wrecks ×4). On-road trickle is slow on Endless, faster on circuits.

Nearest-segment project onto the densified path gives along-track s and signed lateral. |lat| > width is off-track. Every course is four lanes: half-width 2 × 4.4 yd, painted dividers, yellow edges. Sectors fire when s crosses their fraction.

4. Courses

IdFeel
pine-coilParkland dusk highway, four lanes, flowing esses, ~0.9 mi lap
coral-coastFour-lane coastal, long straights, water + hotels
singularity-ringNight city ring, four lanes, neon walls
custom-*Player-seeded closed circuit. Laps 1–60. Theme (parkland / coast / night) from the seed
ridge-*Endless. Seeded point-to-point, ~28,000 yd, 3 checkpoints, traffic, guns, FINISH
drag-eighth1/8 mile, 660 ft (220 yd). AI in an inner lane
drag-10001000 ft (NHRA Top Fuel trap length)
drag-quarter1/4 mile, 1320 ft (440 yd)

All courses: four lanes, guardrails, lamps, gantries, arcade dusk dress. Open paths do not wrap finish-to-start. Drag is a linear strip. Sportsman tree: READY (~2.15 s), pre, stage, three ambers at 0.5 s, then green. Foul only on ambers (not during READY). F restages both cars and runs the tree. AI launches on its reaction (rare red-light).

5. Crafts

Four live chassis. Same powertrain: set HP, torque, mass, drive, μ, gears, boostTank, boostPower, performance follows. Drive is the personality: RWD yaws on slip, FWD pushes, AWD holds. Old Mira/Reed/Kai saves map to Apex.

StatApex Mk IBoxcut Mk I
RoleLattice GTOriginal short-box race truck (C10 short-fleetside stance, Haven lattice, not a licensed Chevy)
LayoutRWD · 6-spd · 1380 kgRWD · 6-spd · 1520 kg
Power / torque470 hp @ 7200 · 420 lb-ft @ 4200 · redline 7800405 hp @ 6000 · 495 lb-ft @ 3600 · redline 6800
Final / wheel3.73 · r 0.33 m3.90 · r 0.35 m
AeroCd 0.52 · A 2.1 m²Cd 0.62 · A 2.55 m² (slower top)
Grip / turnμ 1.32 · turn 2.05μ 1.40 · turn 2.22
Boost tank1.001.42 (same drain, longer bar)
Boost hit1.00×1.25× on Right Shift
StudioPBR loft GTPBR short-box: cab, short bed, hoop, round lamps
StatFlick Mk ISleet Mk I
RoleOriginal FWD pocket hatch. Tightest circuits. Worst at the tree.Original AWD rally coupe. Hooks. Rain/weather already has a home.
LayoutFWD · 6-spd · 1120 kgAWD (40/60) · 6-spd · 1340 kg
Power / torque355 hp @ 7100 · 318 lb-ft @ 4800 · redline 7600438 hp @ 6400 · 468 lb-ft @ 3800 · redline 7200
Final / wheel4.05 · r 0.31 m (short)3.85 · r 0.33 m
AeroCd 0.37 · A 1.98 m²Cd 0.48 · A 2.22 m²
Grip / turnμ 1.38 · turn 2.42 (best)μ 1.50 · turn 2.18
Boost tank1.85 (largest)1.15
Boost hit1.50× (50% over Apex)1.08×
Drive feelSlip kills yaw (push). Front burnout marks.Both axles share torque. Launch slip rarely lights. Almost no burnout theater.
StudioPBR short hatch, tall cabin, steep tailPBR flared coupe, hood/roof scoops, fogs

upgHp / upgTq add to the engine later; extra power without μ = wheelspin (RWD), push (FWD), or a late break (AWD).

6. Endless arcade

~24–64 traffic on the highway (dense in the first stretch): sedans, vans, box haulers, and a few slow tractors. Ram dumps speed and breaks combo. Guns (Right Shift + fuel) hitscan ~52 yd ahead. Wrecks are 100 × combo × type (tractor ×4). Tractor also refills 4× boost and takes many more hits. Combo has no cap. Each point adds 5 mph to top speed. Wall or ram: COMBO BREAK, bonus speed gone.

Announcer (original Haven VO, not ripped samples). Fires on wreck:

StreakCall
1FIRST BLOOD
2DOUBLE KILL
3MULTI KILL
4MEGA KILL
5ULTRA KILL
6MONSTER KILL
7LUDICROUS KILL
8KILLING SPREE
9RAMPAGE
10DOMINATING
12UNSTOPPABLE
15GODLIKE
18WICKED SICK
20, 25…BEYOND GODLIKE
Break ≥3SHUT DOWN

Score, wrecks, and best chain write to save.arcade and the local ledger hall.

7. Ghost + ledger

Each heat records {x,y,h,t} samples. Best finish time per circuit|craft keeps the ghost; best lap keeps its sector splits under save.bests and feeds the live delta. A ghost is only trusted if its recording covers the heat distance. Endless also writes save.arcade: bestScore, bestCombo, last 20 wreck-runs. Ledger key lygo-haven-rally-v1 in localStorage. RESOURCE on the public page; this browser is the hall. No fake global board.

8. Studio + presentation

Title screen matches Lattice Golf: full-bleed still of the selected craft, right panel, operator name, garage chip, mode cards, radio, PayPal.me/ExcavationPro + Patreon. Garage is a live 3D studio (drag to orbit) with four bays. 2.5D Three.js follow-cam; 2D top-down fallback if WebGL fails.

Cameras (C or Options): Chase, Close, Hood, Bumper, Cockpit, TV. Chase distance/height sliders scale Chase and TV.

Weather (Options): Clear, Dusk, Overcast, Rain, Storm. Skydome + fog + sun height change with the pick. Rain/storm wet the asphalt (more metal, darker) and cut μ. AWD (Sleet) keeps more of it. Storm flashes. Reduce-effects hides rain streaks.

World. Gradient skydome, textured land, hill ring on the horizon. Trees are layered crowns + bushes. City tracks get windowed towers and roof caps; coast gets sand + water; parkland gets lodges.

FX. Headlights and brake lamps. First-gear launch lays black burnout marks and spins the rears. Right Shift with fuel: tailpipe flames. The body leans on lateral g and pitches under power and braking. Reduce-effects hides sparks, gun tracers, extra lights, rain, and new skids.

HUD: commercial race cluster bottom-right (tach, gear, mph or km/h). Endless adds score, combo, wrecks, browser best.

9. Options

Persistent sheet. Schema is the OPTIONS list in game.js. Each row is toggle, range, or soon. Enhancements add a row; they do not rewrite the menu. Values live under save.options. Load merges defaults so old saves pick up new keys.

KeyGroupNow
ghostRaceShow best-heat ghost
countdownRace3–2–1 lights; off goes green immediately
invertSteerControlsSwap A/D and arrows
camViewCameraChase, Close, Hood, Bumper, Cockpit, TV. C cycles
camDist / camHeightCameraChase / TV distance and height multipliers (2.5D)
showPilot / showHintHUDPilot plate and on-track hint
metricHUDSpeed: mph (off) or km/h (on)
reduceFxGraphicsHides drift sparks, underglow, extra lights, gun tracers
assist / abs / weather, soon placeholders

10. Audio

Procedural Web Audio (no sampled engines): RPM/throttle, gear clunk, tire band on slip, city bed that ducks when radio plays. Endless guns: noise bursts. Announcer: original OGG lines under assets/vo/. Radio is the on-page Excavationpro stream, same as Lattice Golf.

11. Phase 10: Steward

Lap origin. A heat seeded its lap counter at s=0 while the car stood on the grid, and the start/finish seam of a closed lap is about equidistant to both of its ends, so the projected arc position flipped between s≈0 and s≈len from one frame to the next. The gate test compared the two numbers separately (prev ≤ target && now > target, else prev ≤ target || now > target), and a flip in either direction reads as "past" all three gates at once. The log showed three sectors at 0:00.017, a 17 ms "best lap" and a heat that finished a lap short, and that short heat is what got saved as the ghost and posted to the hall. Three things changed: the grid now sits 11 yd behind the line so the first crossing begins lap 1 instead of ending it, the lap origin is derived from the grid geometry instead of a projection, and the crossing test measures the stretch actually covered (the target must lie inside the interval from prev to now, forward around the lap; anything over half a lap is a bad sample). A stationary car can no longer score anything, whatever the projector does.

Standing start. Lap 1 is timed from the lights, as on a real grid. Open ribbons (Endless) keep the flush start, there is no road behind the first sample to stand on.

Readouts. The rail renames itself per discipline (Ghost, Standings, Rival, Arcade) instead of calling a drag opponent a ghost, and the big timer is labelled to match (CURRENT LAP / ELAPSED / RUN TIME). The record lap and the split deltas live in the SECTORS card, and each sector pass flashes its delta against the record profile.

Presentation. A boost veil, a soft radial sweep that a driver notices at speed and can switch off with Reduce effects, sells the boost, the drag tree is smaller and translucent so it stops blocking the strip, and the body leans and pitches on measured lateral and longitudinal g.

Ghosts. Every ghost saved before this pass covers one lap less than the heat demands, which makes it unbeatable. On load a ghost is dropped unless its recorded path covers the heat distance, and the rail says so.

Barriers. Contact used to scrub speed by a flat ~82%/s while engine thrust balanced at ~3 mph, so any clip became a trap, and in auto there was no way out, because the stop-clamp ate every inch of reverse. A hit now costs speed in proportion to how square it lands, then the car scrapes along on a light penalty with sparks; holding brake backs you out.

Record book. Best lap per circuit|craft is kept with its sector splits. The rail shows live split deltas against that lap and the record time, the top bar shows your own best lap rather than the ghost's heat time, a new record flashes on the HUD, and the delta readout interpolates the record's own sectors instead of extrapolating a whole lap off the first 6% (which is where a "+359.072" came from).

Feedback. Driving the ribbon backwards flashes WRONG WAY.

Cover. node tools/haven_rally_qa.js lifts the lap/ghost maths out of game.js and runs it for real, record-profile interpolation and monotonicity, the phantom-lap crossing, ghost coverage, delta formatting, then checks the source invariants and that every $() id exists in the markup. Rally3D.stats() exposes fps, skid count and the car's attitude for the next pass.

12. Phase 11: Studio pass: the ribbons, the scenery, the sheet

Course designer. The circuits used to be random polar loops: a dozen control points on a jittered radius, smoothed twice. They closed, they could be driven, and they were all the same idea with different noise, no straights worth the name, no corner you could learn by name, and a minimum radius that fell out of the dice. A circuit is now designed. The base is still a closed polar loop, because a base that is closed by construction can never be broken, but the shape comes from harmonics chosen per circuit (an oval squash for Coral Coast, a four-lobe for the ring) and the features are spliced into it between fixed anchors: a straight is the chord between two anchors with a blend whose slope vanishes at both ends (a plain chord leaves a curvature step, which is a kink), a slow corner is a pinch toward the local centroid, a fast sweeper is the same push outward, and a hairpin is a biarc solved between the anchors' own tangents. Anchors never move, so the ribbon stays shut and can never fold back on itself. A relaxation pass then rounds the splices, a curvature-limit pass raises any accidental kink, the closest self-approach is checked against the ribbon width, and the whole loop is scaled once to hit a target length, the old circuit's length within about a percent, so existing lap records stay comparable.

What each circuit is now. Pine Coil is 1564 yd (0.89 mi) of fast sweepers with an esse chain: six corners, two of them hairpins, minimum radius 34 yd. Coral Coast is 2003 yd (1.14 mi), the long-straight circuit the brief always described, with folded ends: six corners, three hairpins. Singularity Ring is 1431 yd (0.81 mi) of tight ninety-degree blocks: nine corners. The start straight is 150, 260 yd on every one of them, which the grid needs. Custom seeds now pick one of four archetypes, flow, technical, hairpin, ring, so "a new closed circuit every time" is true rather than a reshuffled blob.

Kerbs, paint, and furniture. Curvature is read off the control polygon as a turn rate (ds/dtheta, circumradius is noise on a nearly straight sample) and matches the road: every corner now carries a red-and-white kerb on its inside edge, laid as a ribbon on the offset path. The start/finish is a real checkered line across the road instead of a teal strip, the grid bays are painted behind it, and a gantry with posts, beam and a light bar spans it. The three tightest corners get braking boards, apex cones and tyre walls, sized off their measured radius.

Scenery. The horizon was thirty identical cones. It is now three layers, near hills, mid ridges, far peaks, each blended further toward the fog colour so distance reads as distance, with a sun disc and a cloud band in the sky and asphalt grain on the road surface. Palms are gated to the coast theme; they used to sprout on the parkland circuit regardless of the theme's own trees.

UI. The sheet is grouped into Heats, Arcade, and Garage & info, and every circuit carries a layout thumbnail painted from its own generated geometry at runtime, so the preview cannot drift from the ribbon you drive. Each card states its real length, corner count and hairpin count.

Cover. node tools/haven_rally_qa.js stays at 86 checks. All three circuits were driven in-browser after the pass with no console errors, and the designer was verified separately for closure, self-approach, minimum radius and length before any of it was rendered.

13. Out of scope

No multiplayer, no pay-to-win, no Palantir, no invented network scores, no Marines unless asked. No licensed automaker marks. Boxcut is a Haven original in a short-box stance.