@bendyline/molen-tooling 0.0.12 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/capture/harness.js +386 -318
  2. package/dist/capture/worldgen-preview.js +254 -254
  3. package/dist/docs-src/guide/adaptive-performance.md +30 -3
  4. package/dist/docs-src/guide/aircraft.md +125 -3
  5. package/dist/docs-src/guide/ambient-life.md +15 -1
  6. package/dist/docs-src/guide/boats.md +9 -4
  7. package/dist/docs-src/guide/boost-mode.md +64 -0
  8. package/dist/docs-src/guide/determinism.md +1 -1
  9. package/dist/docs-src/guide/dioramas.md +11 -4
  10. package/dist/docs-src/guide/earth-view.md +104 -4
  11. package/dist/docs-src/guide/entities.md +3 -0
  12. package/dist/docs-src/guide/graphics-performance.md +177 -13
  13. package/dist/docs-src/guide/input.md +34 -1
  14. package/dist/docs-src/guide/liveries.md +167 -0
  15. package/dist/docs-src/guide/livery-catalog.md +2659 -0
  16. package/dist/docs-src/guide/livery-gallery.md +2684 -0
  17. package/dist/docs-src/guide/medium-fi.md +13 -5
  18. package/dist/docs-src/guide/night-lighting.md +96 -0
  19. package/dist/docs-src/guide/project.md +1 -1
  20. package/dist/docs-src/guide/regional-world.md +3 -1
  21. package/dist/docs-src/guide/rendering-backends.md +6 -2
  22. package/dist/docs-src/guide/surface-rendering.md +12 -0
  23. package/dist/docs-src/guide/terrain.md +38 -0
  24. package/dist/docs-src/guide/vehicles.md +13 -1
  25. package/dist/docs-src/guide/worldgen.md +20 -5
  26. package/dist/docs-src/llms.txt +6 -1
  27. package/dist/docs-src/schemas/archstyle.md +29 -0
  28. package/dist/docs-src/schemas/components.md +776 -1
  29. package/dist/docs-src/schemas/regional-catalog.md +39 -0
  30. package/dist/docs-src/schemas/scatter.md +36 -0
  31. package/dist/docs-src/schemas/structure-placement-data.md +91 -0
  32. package/dist/docs-src/schemas/structure-placements.md +91 -0
  33. package/dist/docs-src/schemas/worldgen-batch.md +105 -0
  34. package/dist/templates/city-courier/gen/molen-types.ts +103 -1
  35. package/dist/templates/city-courier/scripts/molen-scripts.d.ts +102 -0
  36. package/dist/templates/index.json +17 -17
  37. package/dist/templates/skybound/gen/molen-types.ts +103 -1
  38. package/dist/templates/skybound/scripts/molen-scripts.d.ts +102 -0
  39. package/dist/templates/top-down-arena/scripts/molen-scripts.d.ts +102 -0
  40. package/dist/templates/top-down-arena/src/gen/molen-types.ts +103 -1
  41. package/package.json +12 -12
@@ -17,10 +17,28 @@ While content streams, slow frames lower detail only when the measured CPU/GPU f
17
17
  heavy: streaming work runs outside the frame, and a lower tier would restart it. After a memory
18
18
  step, the controller lets that step's lower-detail replacements load (up to the recovery delay)
19
19
  before stepping again, since retained content keeps displayed bytes high until they arrive.
20
+ The explorer starts sampling once its first view has finished loading, or after 20 seconds: the
21
+ first frames carry one-time work (ground refining under the camera, collision trees rebuilt for
22
+ each refinement, models and materials arriving), and measured as overload it stepped a fast
23
+ desktop to the lowest tier before the visitor had moved. While calibrating it recovers quickly
24
+ but lowers detail only after 2.5 s of overload (`EARTH_CALIBRATION_QUALITY`): lifting off reveals
25
+ a whole view at once, and the second of streaming that follows took every takeoff down a level,
26
+ then back up in flight, a rebuild each way. Auto climbs no higher than Balanced, like Earth view's
27
+ default `maxQualityLevel`; above it buildings switch to the high preset, which rebuilds them across
28
+ the view. Once a level has held for
29
+ `EARTH_QUALITY_CALIBRATION_MS` (12 s), the explorer, like Earth view, adapts with
30
+ `EARTH_STICKY_QUALITY` timings: down after 2.5 s of sustained overload, up after 20 s of headroom,
31
+ changes at least 6 s apart. Every change swaps resolution, shadows and building detail across the
32
+ view (Low and Medium differ in worldgen quality, so a step regenerates every resident town tile),
33
+ and the quick defaults flipped a jet between them every 10 to 15 seconds.
20
34
 
21
35
  The explorer applies each tier to drawing-buffer resolution, terrain screen-space error and
22
36
  range, selected/resident tile limits, terrain and semantic request concurrency, worldgen cache
23
- bytes, object LOD error, and surface decoration budgets. Pixel limits include high-DPI and
37
+ bytes, object LOD error, and surface decoration budgets. Every tier keeps at least 12 terrain and 24
38
+ layer requests in flight: they bound loading (archive reads, worker decoding and generation), not
39
+ main-thread work, which admission meters (see [graphics performance](graphics-performance.md)). At
40
+ 4 and 8 a jet's newly selected tiles waited in line rather than loading while the workers sat
41
+ idle, and the coarse parent stayed on screen for a second or more. Pixel limits include high-DPI and
24
42
  ultrawide displays. CPU caches and resident geometry have separate limits:
25
43
 
26
44
  | Tier | Maximum rendered pixels | Terrain error | Selected tiles | Resident buffer budget | Worldgen cache |
@@ -46,7 +64,14 @@ the frame. Between frames, warm-up compiles run the sun's shadow pass over the s
46
64
  the groups draw normally, so a tile that an admission job swapped and disposed is never replayed
47
65
  from a stale bundle. Once a WebGPU shadow map
48
66
  exists it keeps its size, and "off" stops redrawing it and fades it out rather than releasing it,
49
- because three.js's WebGPU shadow node cannot be torn down and rebuilt in place. Tiers change cost, never the
67
+ because three.js's WebGPU shadow node cannot be torn down and rebuilt in place. WebGL parks the
68
+ map the same way once a light has cast shadows: each lit program is built for the shadows it
69
+ receives, and clearing them rebuilt every program in view, synchronously, in the next frame
70
+ (seconds of frozen flight when a tier crossed into Low). Earth hosts turn shadows on once before
71
+ anything is built, so tier changes only stop or resume drawing the map. A parked map still draws
72
+ once when a caster of a new kind (instanced, skinned, alpha-tested, another side) is prepared, so
73
+ its depth program is built as it streams in rather than with every other one in the frame
74
+ shadows return. Tiers change cost, never the
50
75
  look: the palette, light rig and styles are the same in every tier (see the
51
76
  [medium-fi style guide](medium-fi.md#rendering-modes)).
52
77
 
@@ -59,7 +84,9 @@ reclaimable warm cache does not prevent recovery. It does not measure them again
59
84
  resident cap: each step down shrinks that cap, so a dense city's buildings would cascade every
60
85
  step to the lowest tier while the view stayed the same. Total resident bytes
61
86
  still control eviction. After asynchronous surface replacements settle, `refreshMemoryUsage()`
62
- updates the cached estimates. Existing surface grids keep their resolution
87
+ updates the cached estimates; the explorer passes `'displayed'`, re-counting only tiles on
88
+ screen, where surface detail changes in place. Its HUD shows displayed bytes ("shown") beside the
89
+ resident total. Existing surface grids keep their resolution
63
90
  to preserve drape alignment; newly admitted terrain uses the current cap.
64
91
 
65
92
  ## Object detail and visibility
@@ -7,6 +7,9 @@ ten general aviation aircraft, ten fighters, five cargo transports, the MV-22B O
7
7
  and thirteen utility, regional, historic and business aircraft. All use clean configurations without
8
8
  external weapons.
9
9
 
10
+ Compare national markings and camouflage in the [livery gallery](livery-gallery.md), then
11
+ find every aircraft’s choices and reference evidence in the [livery catalog](livery-catalog.md#aircraft).
12
+
10
13
  Use the **P-51 Mustang**, **OH-6** or **Bendy Small Airliner** buttons to visit the practice airfield, then press **E** to
11
14
  board. The aircraft buttons also work from the example hub's world view. A direct link can use
12
15
  `?aircraft=p51d`, `?aircraft=oh6` or `?aircraft=airliner`. The **Aircraft catalog** selector visits
@@ -95,6 +98,40 @@ Mustang's gear takes 12 seconds: its inner wheel doors open, each main leg swing
95
98
  well in the wing root, the tail wheel folds forward into the fuselage, and the doors close behind
96
99
  them. Its flaps take 13 seconds to run down to 50°.
97
100
 
101
+ ## Collisions and breakable sections
102
+
103
+ Aircraft contacts apply impulses at the point of impact, including angular response, friction
104
+ and a small rebound. A wingtip strike can turn the aircraft while it keeps moving; a wreck
105
+ continues to fall, tumble and slide. Terrain is tested at the airframe probes as well as at the
106
+ landing origin, so a banked wing can hit the runway before the wheels or fuselage.
107
+
108
+ The Mustang has detachable wings, tail surfaces and propeller; the OH-6 has a detachable rotor
109
+ and tail; the small airliner has detachable wings (with their engines) and tail. Strong impacts
110
+ or repeated loaded scrapes consume joint integrity. Separation removes the section's collision
111
+ probes, reduces lift/control authority and can disable its attached engines. An asymmetric wing
112
+ loss produces a rolling moment. Detached geometry retains its own velocity and spin, then falls,
113
+ bounces and slows against terrain and resident obstacles. Debris expires after 20 simulation
114
+ seconds; the missing section stays missing. **R** repairs the aircraft and clears debris.
115
+ The remaining aircraft use their existing probes with the new contact response; they need
116
+ authored section bindings to display parts breaking away.
117
+
118
+ For custom models, `spec.collisionParts` replaces `collisionProbes`. Every section declares a
119
+ unique `id`, a `role` (`body`, `leftWing`, `rightWing`, `tail`, `rotor`, `gear` or `engine`), local
120
+ probe centers and sphere `radius`, a section `center`, `massFraction`, and GLB `nodes`. Add
121
+ `breakSpeed` in m/s for a breakable joint and `engines` for engines carried by that section.
122
+ Keep a non-detachable `body` and at least 20% of the mass. Optional `fragments` selects triangles
123
+ from shared static detail meshes using a model-space bounding box, so markings follow a wing.
124
+ These are gameplay approximations with authored joint strengths, not a structural engineering
125
+ or accident-reconstruction model. Pieces use sphere collision proxies; mesh deformation, fire,
126
+ debris-to-debris contacts and impulse transfer into other vehicles are not simulated.
127
+
128
+ Hosts provide `AircraftEnvironment.contacts(probes, entity)` with world-space contact points,
129
+ outward normals and penetration depths. `aircraftObstacleContacts` from `client/aircraft`
130
+ adapts a collision tree, cars and other aircraft to this contract; the Earth view and world
131
+ explorer use it. The legacy `canOccupy` callback remains supported with a simple recoil because
132
+ it supplies no contact normal. `aircraftState.damage` and `debris` are serializable and survive
133
+ keyframes; `crashed` means damage requiring recovery and no longer freezes motion.
134
+
98
135
  ## Reuse in another experience
99
136
 
100
137
  All 53 aircraft are registered in the `molen.entities` content pack, with their type documents and models.
@@ -359,7 +396,7 @@ setAircraftEngineFailed(world, 'twin', 'left', false); // explicit repair
359
396
  `setAircraftEngineFailed` returns false for an unknown aircraft or engine. A failure immediately
360
397
  removes powered thrust and lets that propeller spool down; pilot throttle/switch input cannot
361
398
  repair it. Failure triggers belong to the experience (for example a damage or training command).
362
- The world explorer supplies common engine controls; failure scenarios are authored through
399
+ The world explorer supplies common and individual engine controls; failure scenarios are authored through
363
400
  this API, without automatic random failures.
364
401
 
365
402
  `aircraftState.engines[id]` stores `rpm`, `rotorAngle`, `failed` and current `thrust` in newtons.
@@ -392,10 +429,95 @@ collides with terrain. Do not add a second physics body that also writes the air
392
429
  This is a game flight model with recognizable polygonal aircraft, not a full aircraft systems
393
430
  simulation or a calibrated replica of any airplane's handling. Rotor blade-element aerodynamics,
394
431
  autorotation, a quantitatively validated spin model, fuel, automatic engine damage, detailed
395
- avionics and weapons are outside this implementation. Cockpit switches and pedals are visual details; the listed input
396
- controls operate the simulated systems. Collision uses coarse airframe probes and resident world
432
+ avionics and weapons are outside this implementation. Primary cockpit controls operate the simulated
433
+ systems as described below; switches for unsupported systems remain decorative. Collision uses coarse airframe probes and resident world
397
434
  geometry; it does not model deformation or distant unloaded obstacles.
398
435
 
436
+ ## Clickable cockpits
437
+
438
+ Earth views and the world explorer enable pointer controls while occupying the cockpit. Drag a
439
+ yoke or cyclic sideways to bank and down to pull up; release it to center. Pedals drag sideways
440
+ and also center on release. Drag a throttle or collective upward to increase its retained setting.
441
+ Modeled gear selectors toggle on click; flap and thrust-vector levers accept intermediate positions.
442
+ Solid panel geometry blocks clicks behind it. Dragging empty space still looks around.
443
+
444
+ All 53 bundled cockpits have physical controls for their supported systems, including engine
445
+ master switches, individual engine switches and throttles for airplanes with named engine banks,
446
+ parking brakes, and applicable gear, flap and nozzle controls. Supplemental labeled modules fill
447
+ gaps in the original models; their layout approximates the aircraft rather than reproducing every
448
+ real switch. The Cessna 172's existing master rocker and flap selector are directly operable.
449
+ Moving common power (including Shift/Ctrl or the modeled **PWR ALL** handle)
450
+ synchronizes all throttle levers while preserving individual engine cutoffs, mixtures and propeller settings. A throttle indicates
451
+ commanded power; shaft RPM follows the simulation's spool response. Retractable airplane gear is
452
+ locked on the ground. Helicopters retain the existing shared engine/gearbox model and collective.
453
+ Manual-mixture aircraft have operable mixture controls, and aircraft with manual propeller governors
454
+ have operable propeller RPM controls. Fuel selectors, avionics and other unmodeled systems remain decorative.
455
+
456
+ ### Mixture and propeller governors
457
+
458
+ `AircraftInputData.mixture` and `.propeller` are retained 0–1 selections, both defaulting to 1.
459
+ The same fields in `engines[id]` override the common selections independently. A common adjustment
460
+ synchronizes only its own control, preserving throttle, cutoff and the other engine settings.
461
+ Drag the modeled mixture or propeller lever upward to increase its setting.
462
+
463
+ An engine with `mixtureControl: true` uses a reduced fuel/air model: 0 cuts fuel immediately;
464
+ 1 is full rich. At reduced intake-air density a lower setting can recover power, while excessive
465
+ leaning or enrichment reduces combustion, thrust and available shaft power. The existing
466
+ `ratedDensityRatio` approximates boosted intake air before leaning becomes necessary. Mixture
467
+ cutoff spools the engine down without latching a failure; restoring mixture can restart it when
468
+ the engine master is on. This assisted restart does not model a starter or ignition sequence.
469
+
470
+ `propellerControl: { minRpm: 0.6 }` enables a constant-speed governor: the lever selects between
471
+ 60% and 100% of rated RPM. It does not directly set blade angle. At sufficient power the governor
472
+ holds selected RPM; at low power the fine-pitch stop permits RPM to fall. Reduced selected RPM
473
+ limits shaft power in the torque-limited approximation and lowers the static thrust cap. RPM,
474
+ propeller rotation, torque and thrust all follow these inputs. This follows the distinction between
475
+ throttle, mixture and governed RPM in the [FAA engine-controls overview](https://www.faasafety.gov/gslac/ALC/libview_printerfriendly.aspx?id=6849).
476
+
477
+ These are estimated simulation curves, not aircraft performance tables or operating procedures.
478
+ There is no fuel consumption, EGT/CHT, detonation, feathering, reverse thrust or blade-element model.
479
+ Fixed-pitch Cessna 172S and Cherokee aircraft expose mixture without a propeller lever; the DA42
480
+ and PC-12 NGX retain automatic scheduling. Turboprops have no piston mixture. Combined condition
481
+ levers used for propeller RPM currently cover the governed range; engine cutoff remains a separate
482
+ switch. The R44's mixture affects the shared piston/rotor power model without adding a propeller control.
483
+
484
+ Per-engine `aircraftState.engines[id].combustion` reports effectiveness (0–1), and `shaftPower`
485
+ reports delivered watts. Model signals expose these as `engines.<id>.combustion` and `.shaftPowerW`;
486
+ `.mixture` and `.propeller` are commanded lever positions. The live cockpit review shows these
487
+ settings alongside RPM and shaft power so cutoff and independent engine effects are visible.
488
+
489
+ Hosts pass the camera to `visual.updateView(camera)` each frame (in the coordinates of
490
+ `visual.object.position`). The cabin, the interior's `nodes`, is drawn only within three times
491
+ the aircraft's length or span of it (at least 60 m): cockpits held most of an aircraft's draw calls
492
+ and as many again in the shadow pass, yet from farther away they are a few pixels behind the canopy.
493
+ Boarded and chase views are always near enough. Earth views and the world explorer also prepare an
494
+ aircraft's shaders before its model joins the scene.
495
+
496
+ `createAircraftVisual` exposes `cockpit`, a mesh picker and control inventory derived from the
497
+ interior's authored primary-input bindings and glTF node `extras.aircraftControl` metadata.
498
+ An `AircraftControlNode` declares a supported `action`, optional engine ID, and optional
499
+ rest-relative `motion` (`property`, `axis`, `scale`, optional `offset`). Switches and selectors animate their commands;
500
+ gear, flaps and engine RPM still follow the simulation's transit/spool response.
501
+ Separate throttle levers are associated with engine
502
+ positions from pilot-left to pilot-right; duplicated collective/thrust levers remain linked.
503
+ `bindAircraftCockpitPointer` from `@bendyline/molen-client/aircraft` binds a canvas, camera and
504
+ active pilot session. The HTML companion panel is opt-in with `companionPanel: true`, for
505
+ accessibility or older models with incomplete geometry. Call its `update()` each frame
506
+ and `dispose()` on teardown. Hosts apply changes with `applyAircraftControl`, submit the result
507
+ through `flyAircraft`, and mix `AircraftPointerAxes` with their keyboard/gamepad inputs. Session
508
+ release must clear transient axes. The binder cancels drags on exit, view change, blur and pointer
509
+ cancellation; it does not write simulation components directly.
510
+
511
+ In the engine repository, build the client and kernel, then run a local live review of all 53 bundled aircraft:
512
+
513
+ ```sh
514
+ pnpm --filter @bendyline/molen-examples-world-explorer exec vite --config ../../packages/entities/scripts/cockpit-controls-vite.mjs
515
+ ```
516
+
517
+ Open `http://127.0.0.1:4322/packages/entities/scripts/cockpit-controls.html`. The review runs the
518
+ real aircraft solver, displays commanded power beside actual RPM, and offers parked, airborne
519
+ and exterior views.
520
+
399
521
  ## Reproducible review
400
522
 
401
523
  The source brief, generator, provenance and verification notes are in the engine repository, in
@@ -279,7 +279,21 @@ function frame(dt: number) {
279
279
 
280
280
  `installAmbient` takes `traffic`, `classes`, `policy`, `types`, `templates`, `ground` and `seed`.
281
281
  For streamed maps, `registerTile` and `unregisterTile` add and drop one tile's transportation
282
- features. Changes queue until the next tick, so a tile never changes the network mid-step.
282
+ features. Changes queue until a tick applies them, so a tile never changes the network mid-step;
283
+ unregistering a key drops its registration if that is still queued. With `registrationsPerTick`
284
+ a tick applies at most that many registrations, and with `removalsPerTick` at most that many
285
+ removals, in queue order (the defaults apply all); a key's registration waits behind its own
286
+ removal when that is left for a later tick.
287
+ A registration's `bounds` (`[minX, minZ, maxX, maxZ]`, world metres) builds only that part of the
288
+ tile, so a large tile can join in parts, each under its own key; part edges stitch like tile edges.
289
+ `EarthAmbient` registers displayed tiles up to 3 km across, one per sync, and none while the
290
+ observer moves faster than 80 m/s or did in the last 3 seconds: a coarse tile beneath a climbing
291
+ aircraft carried a whole town's roads, and a jet passes a tile's traffic too quickly to see it, for
292
+ a dropped frame per tile. One speed sample between syncs is noisy; a dip let tiles through at 300 m/s.
293
+ It registers tiles of 500 m and more in parts at least 125 m wide, nearest first, handing the
294
+ kernel one part per sync (a frame) to apply at its next tick: a dense Kyoto tile of 1-2 km built
295
+ its network in 20-95 ms at once, and a part a tick let a late frame's catch-up ticks build several.
296
+ A departing tile's parts leave four a tick.
283
297
  `blocks(box)` answers whether an ambient car overlaps a box, for a vehicle solver's obstacle test.
284
298
 
285
299
  `createAmbientRenderer` draws pedestrians with `AmbientFigures`, which a host can also use for its
@@ -23,14 +23,19 @@ A host can supply measured depths through `waterAt`.
23
23
 
24
24
  Swells lift, pitch and roll the hull, and turns produce a small bank. Currents carry an unanchored
25
25
  boat; the helm needs forward motion or propeller wash to turn. Rendered water uses the same
26
- analytic swell slopes and simulation time as the hull. The shoreline polygons stay flat: this
27
- version adds moving normals, not displaced surf, breaking waves, tides or a fluid simulation.
26
+ analytic swell slopes and simulation time as the hull, with smaller visual wind ripples layered
27
+ over them. Those ripples drift in several directions and scales, with varying local strength;
28
+ both the base reflection and clearcoat follow their normals. Mip filtering smooths the fine
29
+ detail at a distance, and subpixel swells fade to avoid shimmering bands. The shoreline polygons
30
+ stay flat: this version adds moving normals, not displaced surf, breaking waves, tides or a fluid
31
+ simulation.
28
32
  Wind-driven sailing, capsize/damage, deck walking, and carrying loose cars/cargo are not included.
29
33
 
30
34
  ## Host API
31
35
 
32
- `mountEarthView` accepts `water: { waves, current }`. Empty `waves` gives calm water;
33
- `current` is `[east, south]` in meters per second. Each swell has `amplitude` and `wavelength`
36
+ `mountEarthView` accepts `water: { waves, current }`. Empty `waves` removes hull swells while
37
+ keeping fine visual wind ripples. `current` is `[east, south]` in meters per second. Each swell
38
+ has `amplitude` and `wavelength`
34
39
  in meters, `direction` in radians (zero towards +Z/south), and propagation `speed` in m/s.
35
40
  The default is mild coastal chop with no current. A host can author stronger seas and currents
36
41
  for a route or challenge; these are authored conditions, not live ocean observations.
@@ -0,0 +1,64 @@
1
+ # Boost mode
2
+
3
+ Boost mode makes people and vehicles travel at **4× normal speed**. It starts off. In Earth view,
4
+ press **T** while walking, driving or piloting to toggle it, or use the host API:
5
+
6
+ ```ts
7
+ const view = await mountEarthView({ ...options, boostMode: true });
8
+ view.setBoostMode(false);
9
+ view.on('boostchange', ({ enabled }) => updateBoostButton(enabled));
10
+ console.log(view.boostMode);
11
+ ```
12
+
13
+ The setting persists across navigation changes and geographic re-anchors. It covers walking and
14
+ running, companions and NPC actors, cars, cycles, boats, fixed-wing aircraft, helicopters and
15
+ powered-lift aircraft. Ambient traffic and pedestrians also use it, including trains and vessels.
16
+ Software controls can trigger the same toggle with the `nav-boost` navigation action.
17
+
18
+ This is a travel assist. At a given power setting, a plane that cruises at 250 knots travels at
19
+ about 1,000 knots in boost mode. Acceleration and translation scale together; steering, flight
20
+ controls, engine spool, gear/flap travel and the world clock keep their normal response times.
21
+ The flight solver uses normal handling speeds for aerodynamic forces, stalls and overspeed
22
+ limits, then reports the boosted velocity, airspeed, equivalent airspeed and Mach. A 4× speed
23
+ readout therefore does not by itself trigger a stall, excessive lift or an overspeed warning.
24
+ Aircraft climb and descent are boosted too. Ground vehicles retain their ordinary suspension
25
+ and gravity; people retain their normal jump height. Waves and buoyancy keep their normal timing.
26
+ Wind and water currents stay in world meters per second.
27
+
28
+ Changing modes immediately rescales travel velocity without changing position, attitude or
29
+ throttle. This is useful for returning to normal speed near a destination. Collision and
30
+ terrain-coverage checks still apply; missing terrain pauses movement instead of allowing a
31
+ vehicle to travel through an unloaded area. Braking takes roughly the same time, so stopping
32
+ distances and turn radii are longer at boosted speed.
33
+
34
+ ## Headless worlds and scenes
35
+
36
+ Author one `boostMode` component on a settings entity:
37
+
38
+ ```json
39
+ { "id": "travel-settings", "components": { "boostMode": { "enabled": true } } }
40
+ ```
41
+
42
+ Or change it through the kernel:
43
+
44
+ ```ts
45
+ import { isBoostMode, setBoostMode } from '@bendyline/molen-kernel/world';
46
+
47
+ setBoostMode(world, true);
48
+ console.log(isBoostMode(world));
49
+ ```
50
+
51
+ The built-in character, vehicle, aircraft, boat and ambient systems read it each tick. It is ECS
52
+ state, so checkpoints preserve it. For deterministic input replay, invoke the setter from a
53
+ registered command handler, or patch the settings component from a scene command script.
54
+
55
+ Direct `stepVehicle`, `stepAircraft` and `stepBoat` callers can pass `boostMode: true` in their
56
+ environment. Installed vehicle systems and `installCharacterController` accept the same optional
57
+ override; leaving it unset follows the world's setting. A standalone client `WalkController`
58
+ has a mutable `boostMode` property.
59
+
60
+ Vehicle, aircraft, boat and ambient state carry an optional, kernel-owned `boosted` flag so
61
+ switching modes and restoring snapshots do not apply the multiplier twice. Their speed fields
62
+ remain actual travel speeds in m/s. Autopilots comparing telemetry against unboosted authored
63
+ specifications should divide speed by `boostSpeedMultiplier(state.boosted)`, exported alongside
64
+ `BOOST_SPEED_MULTIPLIER` from `@bendyline/molen-schema`. Leave the flag intact when copying state.
@@ -135,7 +135,7 @@ Two constants live in `packages/kernel/src/version.ts` and they do different job
135
135
 
136
136
  | Constant | Today | Role |
137
137
  |---|---|---|
138
- | `ENGINE_VERSION` | `0.0.8` | metadata. Written into a keyframe's `engine` field so a save says which build wrote it. **Never compared on load, never hashed.** |
138
+ | `ENGINE_VERSION` | `0.0.9` | metadata. Written into a keyframe's `engine` field so a save says which build wrote it. **Never compared on load, never hashed.** |
139
139
  | `STATE_FORMAT` | `1` | the gate. Written into a keyframe under the reserved `plugins.$format` key, compared by `applyKeyframeTo`, and folded into `stateHash` as `stateFormat`. |
140
140
 
141
141
  So a release — even one that moves every package — keeps your keyframes
@@ -10,8 +10,8 @@ The content pack includes a high-school football stage: two uniform palettes, fo
10
10
  players running a repeated play, sixty seated/standing spectators, stands, goalposts and a
11
11
  scoreboard with changing digits and a pulsing light. Its 24-second cycle lines up, runs,
12
12
  celebrates and returns. The scores are decorative choreography. Content lives in the separate
13
- `molen.dioramas` content pack, outside the npm runtime. Five more scenes stage an airport ramp,
14
- little league, fireworks, a fair and a Saturday market. Every scene is a self-contained source
13
+ `molen.dioramas` content pack, outside the npm runtime. Seven more scenes stage an airport ramp,
14
+ flight-school briefing and maintenance, cargo handling, little league, fireworks, a fair and a Saturday market. Every scene is a self-contained source
15
15
  bundle with a typed script, local bounds and fixed entity pools.
16
16
 
17
17
  ## Definition and local simulation
@@ -109,8 +109,8 @@ lighting, weather or sky clock.
109
109
  ## Earth placement
110
110
 
111
111
  World Explorer enables the shipped placement catalog by default. Its **Living places** checkbox
112
- controls playback; its place picker and **Visit** button open any of the six registered scenes.
113
- Direct links accept `?diorama=football`, `airport`, `little-league`, `fireworks`, `fair` or `market`.
112
+ controls playback; its place picker and **Visit** button open any of the eight registered scenes.
113
+ Direct links accept `?diorama=football`, `airport`, `flight-school`, `airport-cargo`, `little-league`, `fireworks`, `fair` or `market`.
114
114
  Visit framing adapts to the viewport and fits above the loaded terrain; explicit camera
115
115
  parameters take precedence. `?dioramas=0` disables playback. Source locations and orientation are data in
116
116
  `content/dioramas/placements.json`. Content and script text stay in a separate lazy chunk until
@@ -146,6 +146,13 @@ Local axes are east/up/south, and positive yaw rotates +Z toward east. Geographi
146
146
  survive terrain re-anchoring; old instances are disposed and recreated in the new frame.
147
147
  Automatic matching of map features to dioramas is a future host policy, not silently enabled.
148
148
 
149
+ The Boeing Field flight-school and cargo placements reserve their footprints in the airport layout.
150
+ Their crews, carts and forklift stay in these small service areas. Aircraft are separate entities
151
+ in the host's flight world: walking up to one and pressing E boards it, and flying it away leaves
152
+ its stand empty. The ground scenes contain no decorative aircraft. Other useful airport scenes
153
+ include passenger turnaround, hangar maintenance, fuel service and a fire/rescue station; author
154
+ their service areas with the same clearance from taxiways and parked airframes.
155
+
149
156
  ## Shipped performances
150
157
 
151
158
  | Set piece | Geometry and roles | Choreography |
@@ -12,6 +12,13 @@ composes:
12
12
 
13
13
  You speak latitude and longitude; the view keeps its metric world frame internally.
14
14
 
15
+ [Night lighting](night-lighting.md) follows the sky’s Sun position: occupied windows and street
16
+ lamps fade in through dusk. Existing model glass can opt in with material lighting metadata.
17
+
18
+ [Boost mode](boost-mode.md) makes walking, driving and flying four times faster: press **T**, or
19
+ call `view.setBoostMode(true)`. Pass `boostMode: true` at mount to start enabled; read
20
+ `view.boostMode` and listen for `boostchange` to keep a host's toggle in sync.
21
+
15
22
  ```ts
16
23
  import {
17
24
  loadEarthContent,
@@ -44,8 +51,10 @@ creditsElement.textContent = view.credits.map((credit) => credit.label).join('
44
51
  ```
45
52
 
46
53
  Each worker file is one line, for example `import '@bendyline/molen-earth/workers/elevation';`.
47
- There are entries for `elevation`, `landcover`, `surface`, `worldgen` and `material`. Any worker
48
- you omit does its work on the main thread instead.
54
+ There are entries for `elevation`, `landcover`, `surface`, `worldgen`, `material` and `semantic`
55
+ (map tiles decoded off the main thread, where a town tile took 10-18 ms of a frame; hosts using
56
+ `createProfiledTerrainPackageSemanticLayers` directly pass such a worker as `decoderWorker`). Any
57
+ worker you omit does its work on the main thread instead.
49
58
 
50
59
  Buildings appear with vertex colors while shared material textures bake in the background.
51
60
  Completed textures update the existing materials without regenerating buildings. Terrain detail
@@ -87,6 +96,11 @@ turns shadows off at its two lowest levels; `shadows: false` turns them off enti
87
96
  parts taller than `EARTH_SHADOW_CASTER_HEIGHT` (3.5 m) cast: shrubs, brambles and saplings stay
88
97
  out of the shadow pass, where their shadows would mostly fall inside the canopy's.
89
98
 
99
+ In flight the shadow footprint widens with height above the local ground: its half-width is
100
+ four times that height, capped at 5 km, with a tighter footprint near the ground. This pushes
101
+ the shadow boundary farther into the distance in aerial views, trading some shadow sharpness
102
+ for coverage at the same map resolution. Walking and driving keep their tighter footprints.
103
+
90
104
  `touchJoystickContainer` adds an on-screen movement stick while walking, driving or flying. By default it
91
105
  appears only on touch devices; pass `touchJoystick: 'always'` to show it everywhere.
92
106
 
@@ -405,7 +419,22 @@ for `terrainchange` to refresh an attribution panel when the package changes. Di
405
419
  completed flights resolve the destination immediately; manual panning rechecks the host source
406
420
  after about five kilometers. A second jump while a region is loading follows the latest target.
407
421
 
408
- ## Byte cache and prefetch
422
+ ## Tile preparation, byte cache and prefetch
423
+
424
+ During flight and fast driving, nearby terrain is prepared ahead of travel automatically, even
425
+ without a byte cache. The view predicts camera positions 2, 4, 8 and 12 seconds ahead (up to 4 km),
426
+ following the measured turn rate through a bank as well as straight travel,
427
+ selects their tiles at the current detail budget, and builds terrain, enabled layers and GPU
428
+ resources into the hidden resident cache. Arrival reuses that work. Predictions reset after
429
+ teleports, re-anchoring and camera-entry animations, and follow turns with a short velocity filter.
430
+
431
+ Preparation is bounded to the larger of 16 tiles or a quarter of the selected-tile budget,
432
+ limited by spare residency, and shares the existing tile,
433
+ layer and memory limits. With three or more load slots, up to half can advance the predicted route
434
+ while visible work remains queued; smaller budgets use spare slots. Displayed coverage takes
435
+ priority under memory pressure. `view.stats()` reports `preloadingTiles` and `preloadedTiles` counts.
436
+ This reduces late detail but cannot guarantee readiness when downloads or generation take longer
437
+ than the available lead time. The separate byte prefetch below warms a longer route.
409
438
 
410
439
  Terrain, landcover, feature and building tiles, content packs and the small documents that name
411
440
  them can persist across visits in a byte cache from `@bendyline/molen-pack/cache`. Ground a viewer
@@ -551,14 +580,47 @@ footprint polygon. It replaces the rectangle for suppression, including concave
551
580
  parallel road segments outside it remain intact. Connection stations use the outline's outer
552
581
  intersections with native Z=0, ordered negative to positive X. Without an intersecting outline,
553
582
  they fall back to X=-length/2 and X=+length/2. `deckHeights` keeps that endpoint order.
583
+ When a curved crossing's actual ends lie away from native Z=0, supply
584
+ `replaceRoads.deckEndpoints: [[negativeEndX, negativeEndZ], [positiveEndX, positiveEndZ]]`.
585
+ These native coordinates override the inferred connection stations and follow the model's
586
+ heading and X/Z scale. They require `deckHeight` or `deckHeights`, with the same endpoint order.
587
+ For side connections on a sloping or curved deck, add `deckProfile: [[x, y, z], ...]` in
588
+ increasing X order. Remaining bridge fragments join at their actual outline cut using the
589
+ nearest profile segment's interpolated height. The model's scale and resolved datum apply.
590
+ `includeTransverseBridges: true` also replaces bridge-tagged side connectors that terminate
591
+ inside the exact outline, such as paths covered by viewing pods. It requires an outline;
592
+ untagged ground crossings, tunnels, through crossings with both endpoints outside the model,
593
+ and bridge segments outside the outline remain independent.
554
594
  If the asset includes its retaining walls and approach pavement, set
555
595
  `replaceRoads.includeConnectedApproaches: true`. A grade road is then clipped inside the outline
556
596
  only if it shares a covered endpoint with a mapped bridge and continues outward along the bridge
557
597
  axis. The remaining grade fragment receives a 20 m terrain blend. Nearby roads, transverse paths
558
598
  and tunnels remain intact. This requires the source tile to retain the shared bridge/approach
559
599
  endpoint; disconnected or generalized map geometry is left in place.
600
+ For this opted-in mode, a retained mapped bridge tail up to 32 m can carry its deck height
601
+ to the connected street, including through one covered gateway up to 8 m long. The gateway
602
+ itself stays unchanged. Raised ground approaches receive retaining side and end faces down
603
+ to the original terrain; their paving supplies the top. These supports follow the model's
604
+ load and unload lifetime. They provide approximate continuity where coarse elevation data
605
+ misses a bank or quay; they do not establish surveyed ground levels.
560
606
  Sunken structures can declare `groundCutout: { outline: [[x, z], ...], basis: 'source evidence' }` on a placement. The simple polygon uses native model metres and follows the same heading and scale as the model. It should bound the ground opening covered by the authored concourse or rim. The terrain pyramid subtracts the polygon from actual elevation and draped ground triangles across tile and LOD boundaries, preserving interpolated heights and surface attributes along its edge. The cutout becomes active only when its successfully loaded structure is visible, and the original ground returns on layer hiding or eviction. Failed or cancelled models leave the ground intact. Heights remain available for anchoring; an opening does not itself author walkable floors or collision. Separate excavations can add `additionalOutlines: [[[x, z], ...], ...]` to the same object (up to 64 total polygons). Ground between those outlines stays intact; every opening needs matching model geometry. Client integrations can register the same set with `setTerrainGroundCutouts(object, outlines)`. The singular `setTerrainGroundCutout` remains available for one polygon.
561
607
 
608
+ Bridge openings can set `groundCutout.minHeight` to a native model Y threshold. Only ground
609
+ above that threshold is removed inside the outlines and capped at the threshold; lower dry
610
+ riverbanks remain visible. This explicitly reconstructs a bounded rendered bank without changing
611
+ source height samples. It must be supported by the model's site-fit evidence.
612
+ When `preservePaving` is set, `groundCutout.pavingOutlines` can still name smaller explicit
613
+ paving areas that need the same treatment, such as a river walk passing below a bridge.
614
+ Approach roads outside those paving outlines retain their deck-connection heights and geometry.
615
+ Custom owners pass `{ minHeight }` as the fourth argument to `setTerrainGroundCutouts`.
616
+ The threshold follows the owner's vertical translation and scale, like the existing ceiling.
617
+
618
+ Bridge landings can set `groundCutout.preservePaving: true` to open coarse terrain and
619
+ generated shoreline walls while retaining native approach roads and sidewalks. The default
620
+ also removes covered paving, as required by sunken buildings. Custom paving adapters use
621
+ `markTerrainPavementSurface`; custom owners pass `{ preservePaving: true }` as the fourth
622
+ argument to `setTerrainGroundCutouts`. Water and source elevation samples remain independent.
623
+
562
624
  For separated parts, `groundCutout.outlines` supplies the complete set of up to 64 simple polygons
563
625
  and supersedes the single `outline`. Keep `outline` as the primary boundary for compatibility.
564
626
  Each ring follows the same model pose and lifetime; ground in the gaps stays visible. This lets
@@ -940,7 +1002,8 @@ These regional forms are visual priors, not surveyed attributes of individual bu
940
1002
  switch to the high preset, which rebuilds them across the view). Where the browser can time the GPU (`renderer.createGpuTimer()`), the view
941
1003
  reports GPU and CPU work per frame, so slow frames while tiles stream in lower the level only
942
1004
  when rendering itself is the cost; without GPU timing it goes by frame times alone. The view
943
- first calibrates quickly, so a slow device settles within seconds. Once a level has held for
1005
+ first calibrates quickly, so a slow device settles within seconds (it lowers detail after 2.5 s
1006
+ of overload, not one burst of streaming as a takeoff reveals the view). Once a level has held for
944
1007
  12 s it turns sticky, because a level change swaps resolution and detail across the view: down
945
1008
  after 2.5 s of sustained overload, up after 20 s of headroom, at least 6 s apart. Any change
946
1009
  waits until the camera has been still for 0.6 s (at most 4 s); memory pressure above 1.25
@@ -1012,3 +1075,40 @@ pieces such as a football game, apron traffic or a market. Each geographic place
1012
1075
  a lazy scene loader, optional calendar policy, and entry/exit distances. It waits for terrain,
1013
1076
  plays nearby, and releases its local world when out of range. See [Dioramas](dioramas.md) for
1014
1077
  the full contract and current prototype limits.
1078
+
1079
+ ## Airport layouts
1080
+
1081
+ The `molen.earth` content pack supplies a lazy worldwide runway catalog and a detailed Boeing
1082
+ Field layout. Both Earth hosts use measured runway endpoints and widths, draw runway numbers,
1083
+ thresholds and centre lines, and keep airport pavement visible from flight altitude. Mapped
1084
+ taxiways and aprons have airport markings; airside areas do not become car parks or city streets.
1085
+ The airport overlay also supplies mapped hangar/building footprints and suppresses inferred
1086
+ vegetation and buildings on the airfield. Aircraft traffic uses the runway approach/departure
1087
+ corridors and remains simulated, rather than live aviation tracking.
1088
+
1089
+ The runway snapshot covers 10,746 airports with complete endpoint and width records. Detailed
1090
+ aprons, taxiways and hangars are currently bundled for Boeing Field; elsewhere these depend on
1091
+ the map's coverage. Building heights and untagged taxiway widths are interpreted. Runways with
1092
+ missing endpoints, closed runways and water runways are omitted. Supplemental airports also
1093
+ render when the basemap has no tile (Boeing Field lies south of the bundled Seattle street-detail
1094
+ coverage). No airport data is fetched without a supplied pack. Hosts composing their own
1095
+ terrain renderer can use `withEarthAirports`
1096
+ around semantic renderers and observers, passing `content.airports` from `loadEarthContent`.
1097
+
1098
+ Mapped layouts also populate their aprons with boardable aircraft. Fleet profiles distinguish
1099
+ general aviation, regional service, airline hubs and mixed operations; Boeing Field uses a mix
1100
+ of light aircraft, business aircraft and larger jets. Aircraft are fitted inside apron polygons
1101
+ with clearance from buildings, taxiways, runways, other aircraft and reserved diorama areas.
1102
+ The fleet and parking positions are simulated, not live aircraft tracking or exact stand assignments.
1103
+
1104
+ Walk to an aircraft's door and press **E** to board, **I** to start, and **Shift/Ctrl** to adjust
1105
+ power. The same aircraft taxis and flies away; its original stand remains empty for the session.
1106
+ Land, stop and shut down before exiting. Automatic parking keeps at most twelve unclaimed
1107
+ aircraft within 1.8 km; claimed aircraft remain owned vehicles across terrain re-anchors.
1108
+ Set `airportTraffic: false` on `mountEarthView`, or `?airportTraffic=0` in World Explorer, to
1109
+ disable automatic parking. Hosts composing their own loop can use `planAirportApron` and
1110
+ `EarthAirportPopulation` with callbacks into their aircraft world.
1111
+
1112
+ Detailed apron population currently ships for Boeing Field. Runway-only catalog records do
1113
+ not invent parking ground. The **Living places** picker also offers flight-school briefing and
1114
+ cargo handling there; these ground scenes reserve space beside the boardable fleet.
@@ -4,6 +4,9 @@ The `molen.entities` content pack is Molen's curated entity collection. It build
4
4
  `renderable.kind: "gltf"`, `molen/asset@1`, `molen/types@1`, and `molen/project@1` contracts;
5
5
  there is no second entity or asset runtime.
6
6
 
7
+ The [livery gallery](livery-gallery.md) compares vehicle paint and marking choices. The
8
+ [complete livery catalog](livery-catalog.md) lists their ids and reference evidence.
9
+
7
10
  The initial nature collection contains pine, fir, oak, birch, shrub, and boulder models under the
8
11
  stable `molen.entities.*` namespace. Every model is a deterministic texture-free GLB with a
9
12
  hash-verified sidecar, meter-scale bounds, a conservative collision hull, and a type definition.