makepad/libs/game
Admin 6320c0bc68 Script: game.terrain uses the real generator; cars can carry a model
Groundwork for the demo becoming a splash TEMPLATE. Two things the script
surface could not express, so the demo had to stay in Rust.

**`game.terrain` carried its own single-octave value noise.** That meant the
terrain an AI could reach from splash was strictly worse than the terrain the
engine could make, and the two drifted independently — every fix to
`libs/game/gen/terrain.rs` (fBm, domain warp, world-unit frequency,
slope-aware colour, rim relief) was invisible to any authored game. It now
calls that generator. One generator, one set of bugs.

New params exposed: `feature` (distance between hills, in world units —
answerable, unlike "what is a good freq"), `octaves`, `warp`, `ridged`,
`flatten`, `rim`/`rim_start`.

Two compatibility decisions worth stating:

- `freq` still works. It meant cycles per CELL INDEX, so its wavelength in
  world units is span/((cells-1)*freq); translating rather than ignoring it
  keeps an existing world looking like itself.
- `step` now defaults to 0, not 1.0. The old default quantised every smooth
  slope into one-unit stairs, so a script asking for smooth terrain got a
  contour map. Scripts that want terraces still ask for them.

**`Car` now carries a model**, as `Character` already did, and `game.car`
takes `{model}`. Without it a host could only ever draw ONE kind of car —
which is exactly why the arcade fleet had to live in Rust, and why a
splash-authored world could not have more than a single vehicle shape.

The renderer prefers the car block's own model and falls back to walking the
`parked_car` role, so the same code path serves an authored game and the
built-in demo without the script needing to know the fallback exists.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-05 16:59:46 +02:00
..
assets Bind the library and composition into script — and tell the model it exists 2026-08-03 12:24:10 +02:00
audio Vorbis: 556/556 files decode sample-exact (was 115/160) 2026-08-03 09:38:51 +02:00
blocks Script: game.terrain uses the real generator; cars can carry a model 2026-08-05 16:59:46 +02:00
coedit Arcade M5: multi-Claude co-editing — intent log, semantic rebase, soft leases 2026-08-03 02:45:31 +02:00
gen Terrain: a real heightfield under the world, and cars that touch the road 2026-08-05 16:59:45 +02:00
math Arcade M0 stage A: gamemaker sim extracted to libs/game/sim + deterministic math + apps/arcade shell 2026-08-02 22:28:06 +02:00
net Arcade M5: multi-Claude co-editing — intent log, semantic rebase, soft leases 2026-08-03 02:45:31 +02:00
pkg Arcade M6+M7: packaging/sharing with sandboxed installs, and the pretty pass 2026-08-03 03:27:09 +02:00
render Fireworks: 320 stars per shell, tighter break 2026-08-05 16:59:45 +02:00
script Script: game.terrain uses the real generator; cars can carry a model 2026-08-05 16:59:46 +02:00
session PlayerRig prefab: a playable character in and out of a car in four lines 2026-08-03 19:15:06 +02:00
sim Ramps you can actually walk up, a crossroads, and a jump course 2026-08-05 16:59:45 +02:00