@bendyline/molen-tooling 0.0.12 → 0.0.14
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.
- package/dist/capture/harness.js +616 -332
- package/dist/capture/worldgen-preview.js +540 -326
- package/dist/docs-src/guide/adaptive-performance.md +42 -9
- package/dist/docs-src/guide/aircraft.md +171 -11
- package/dist/docs-src/guide/ambient-life.md +30 -3
- package/dist/docs-src/guide/audio.md +38 -1
- package/dist/docs-src/guide/boats.md +9 -4
- package/dist/docs-src/guide/boost-mode.md +64 -0
- package/dist/docs-src/guide/browser-mount.md +11 -0
- package/dist/docs-src/guide/determinism.md +2 -1
- package/dist/docs-src/guide/dioramas.md +11 -4
- package/dist/docs-src/guide/earth-view.md +145 -8
- package/dist/docs-src/guide/entities.md +3 -0
- package/dist/docs-src/guide/glass.md +134 -0
- package/dist/docs-src/guide/graphics-performance.md +196 -14
- package/dist/docs-src/guide/input.md +34 -1
- package/dist/docs-src/guide/liveries.md +167 -0
- package/dist/docs-src/guide/livery-catalog.md +2659 -0
- package/dist/docs-src/guide/livery-gallery.md +2684 -0
- package/dist/docs-src/guide/medium-fi.md +13 -5
- package/dist/docs-src/guide/navigation.md +23 -5
- package/dist/docs-src/guide/night-lighting.md +97 -0
- package/dist/docs-src/guide/project.md +1 -1
- package/dist/docs-src/guide/regional-fleets.md +9 -4
- package/dist/docs-src/guide/regional-world.md +9 -3
- package/dist/docs-src/guide/rendering-backends.md +6 -2
- package/dist/docs-src/guide/sky.md +2 -2
- package/dist/docs-src/guide/surface-rendering.md +21 -3
- package/dist/docs-src/guide/terrain.md +68 -3
- package/dist/docs-src/guide/vehicle-interiors.md +34 -3
- package/dist/docs-src/guide/vehicles.md +60 -2
- package/dist/docs-src/guide/weather.md +60 -21
- package/dist/docs-src/guide/worldgen.md +20 -5
- package/dist/docs-src/llms.txt +8 -2
- package/dist/docs-src/schemas/archstyle.md +29 -0
- package/dist/docs-src/schemas/components.md +1790 -176
- package/dist/docs-src/schemas/regional-catalog.md +39 -0
- package/dist/docs-src/schemas/scatter.md +36 -0
- package/dist/docs-src/schemas/structure-placement-data.md +91 -0
- package/dist/docs-src/schemas/structure-placements.md +91 -0
- package/dist/docs-src/schemas/worldgen-batch.md +105 -0
- package/dist/templates/city-courier/gen/molen-types.ts +204 -1
- package/dist/templates/city-courier/scripts/molen-scripts.d.ts +203 -0
- package/dist/templates/city-courier/src/shared/playback.ts +21 -10
- package/dist/templates/cubes/src/shared/playback.ts +21 -10
- package/dist/templates/data-viz/src/shared/playback.ts +21 -10
- package/dist/templates/figures-gallery/src/shared/playback.ts +21 -10
- package/dist/templates/index.json +17 -17
- package/dist/templates/skybound/gen/molen-types.ts +204 -1
- package/dist/templates/skybound/scripts/molen-scripts.d.ts +203 -0
- package/dist/templates/skybound/src/shared/playback.ts +21 -10
- package/dist/templates/top-down-arena/scripts/molen-scripts.d.ts +203 -0
- package/dist/templates/top-down-arena/src/gen/molen-types.ts +204 -1
- package/dist/templates/top-down-arena/src/shared/playback.ts +21 -10
- package/package.json +12 -12
|
@@ -1,26 +1,50 @@
|
|
|
1
1
|
# Adaptive rendering performance
|
|
2
2
|
|
|
3
3
|
The world explorer defaults to **Auto (device)** quality. It measures frame cadence, CPU frame
|
|
4
|
-
work, and asynchronous GPU time when
|
|
5
|
-
target 60 FPS without changing simulation state. Manual Economy, Balanced,
|
|
6
|
-
available and can be selected without reloading or moving the camera.
|
|
4
|
+
work, and asynchronous GPU time when WebGL timer queries or WebGPU timestamps are available.
|
|
5
|
+
Six rendering tiers target 60 FPS without changing simulation state. Manual Economy, Balanced,
|
|
6
|
+
and High remain available and can be selected without reloading or moving the camera.
|
|
7
7
|
|
|
8
8
|
## Feedback and budgets
|
|
9
9
|
|
|
10
10
|
`AdaptiveQualityController` from `@bendyline/molen-client` returns a new integer tier when the
|
|
11
11
|
host should change its budgets. It evaluates one-second windows, uses trimmed frame averages
|
|
12
12
|
and slow-frame/p90 statistics, and waits for warmup and sustained overload before lowering detail.
|
|
13
|
-
Memory pressure can also lower detail. Recovery requires stable headroom
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
Memory pressure can also lower detail. Recovery requires stable headroom and memory margin in
|
|
14
|
+
displayed content. During continuous streaming, both CPU and GPU timings must show spare capacity;
|
|
15
|
+
without GPU timing, recovery waits for streaming to settle. Failed upward probes increase the
|
|
16
|
+
recovery delay. Hidden intervals and isolated long pauses reset or bypass measurements instead
|
|
17
|
+
of being mistaken for normal rendering.
|
|
16
18
|
While content streams, slow frames lower detail only when the measured CPU/GPU frame work is itself
|
|
17
19
|
heavy: streaming work runs outside the frame, and a lower tier would restart it. After a memory
|
|
18
20
|
step, the controller lets that step's lower-detail replacements load (up to the recovery delay)
|
|
19
21
|
before stepping again, since retained content keeps displayed bytes high until they arrive.
|
|
22
|
+
The explorer starts sampling once its first view has finished loading, or after 20 seconds: the
|
|
23
|
+
first frames carry one-time work (ground refining under the camera, collision trees rebuilt for
|
|
24
|
+
each refinement, models and materials arriving), and measured as overload it stepped a fast
|
|
25
|
+
desktop to the lowest tier before the visitor had moved.
|
|
26
|
+
|
|
27
|
+
The explorer starts at Balanced and can climb through High to Ultra, using measured performance
|
|
28
|
+
rather than the GPU's name. It uses `EARTH_STICKY_QUALITY` timings from the start: down after
|
|
29
|
+
2.5 s of sustained overload, up one tier after 20 s of headroom, and frame-time changes at least
|
|
30
|
+
6 s apart. Measurements use one-second windows, so these are approximate delays. A failed upward
|
|
31
|
+
probe doubles the recovery delay, up to 120 s; that history stays with the controller throughout
|
|
32
|
+
the session. Selecting a manual preset resets it. Hidden time and startup loading do not earn an
|
|
33
|
+
upgrade. Manual presets remain fixed.
|
|
34
|
+
|
|
35
|
+
High switches buildings to a more detailed preset, so promotions need sustained headroom and the
|
|
36
|
+
explorer applies the resolution, terrain, building, surface and shadow changes over separate
|
|
37
|
+
frames. Brief takeoff/streaming stalls do not immediately undo an upgrade. The embeddable Earth
|
|
38
|
+
view retains its separate default ceiling of Balanced (`maxQualityLevel: 3`) and its initial
|
|
39
|
+
12 s calibration policy; hosts can explicitly raise that ceiling.
|
|
20
40
|
|
|
21
41
|
The explorer applies each tier to drawing-buffer resolution, terrain screen-space error and
|
|
22
42
|
range, selected/resident tile limits, terrain and semantic request concurrency, worldgen cache
|
|
23
|
-
bytes, object LOD error, and surface decoration budgets.
|
|
43
|
+
bytes, object LOD error, and surface decoration budgets. Every tier keeps at least 12 terrain and 24
|
|
44
|
+
layer requests in flight: they bound loading (archive reads, worker decoding and generation), not
|
|
45
|
+
main-thread work, which admission meters (see [graphics performance](graphics-performance.md)). At
|
|
46
|
+
4 and 8 a jet's newly selected tiles waited in line rather than loading while the workers sat
|
|
47
|
+
idle, and the coarse parent stayed on screen for a second or more. Pixel limits include high-DPI and
|
|
24
48
|
ultrawide displays. CPU caches and resident geometry have separate limits:
|
|
25
49
|
|
|
26
50
|
| Tier | Maximum rendered pixels | Terrain error | Selected tiles | Resident buffer budget | Worldgen cache |
|
|
@@ -46,7 +70,14 @@ the frame. Between frames, warm-up compiles run the sun's shadow pass over the s
|
|
|
46
70
|
the groups draw normally, so a tile that an admission job swapped and disposed is never replayed
|
|
47
71
|
from a stale bundle. Once a WebGPU shadow map
|
|
48
72
|
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.
|
|
73
|
+
because three.js's WebGPU shadow node cannot be torn down and rebuilt in place. WebGL parks the
|
|
74
|
+
map the same way once a light has cast shadows: each lit program is built for the shadows it
|
|
75
|
+
receives, and clearing them rebuilt every program in view, synchronously, in the next frame
|
|
76
|
+
(seconds of frozen flight when a tier crossed into Low). Earth hosts turn shadows on once before
|
|
77
|
+
anything is built, so tier changes only stop or resume drawing the map. A parked map still draws
|
|
78
|
+
once when a caster of a new kind (instanced, skinned, alpha-tested, another side) is prepared, so
|
|
79
|
+
its depth program is built as it streams in rather than with every other one in the frame
|
|
80
|
+
shadows return. Tiers change cost, never the
|
|
50
81
|
look: the palette, light rig and styles are the same in every tier (see the
|
|
51
82
|
[medium-fi style guide](medium-fi.md#rendering-modes)).
|
|
52
83
|
|
|
@@ -59,7 +90,9 @@ reclaimable warm cache does not prevent recovery. It does not measure them again
|
|
|
59
90
|
resident cap: each step down shrinks that cap, so a dense city's buildings would cascade every
|
|
60
91
|
step to the lowest tier while the view stayed the same. Total resident bytes
|
|
61
92
|
still control eviction. After asynchronous surface replacements settle, `refreshMemoryUsage()`
|
|
62
|
-
updates the cached estimates
|
|
93
|
+
updates the cached estimates; the explorer passes `'displayed'`, re-counting only tiles on
|
|
94
|
+
screen, where surface detail changes in place. Its HUD shows displayed bytes ("shown") beside the
|
|
95
|
+
resident total. Existing surface grids keep their resolution
|
|
63
96
|
to preserve drape alignment; newly admitted terrain uses the current cap.
|
|
64
97
|
|
|
65
98
|
## 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
|
|
@@ -31,10 +34,10 @@ streaming and floating-origin changes. Reloading starts a fresh session.
|
|
|
31
34
|
| --- | --- |
|
|
32
35
|
| E | Board, or exit after landing, stopping and engine shutdown |
|
|
33
36
|
| I | Start/stop engine; allow the propeller or rotor to spool |
|
|
34
|
-
|
|
|
37
|
+
| = / − | Increase/decrease throttle or helicopter collective; fighter afterburners engage above 85% throttle |
|
|
35
38
|
| W / S | Nose down / nose up |
|
|
36
39
|
| A / D | Bank left / right; helicopter cyclic |
|
|
37
|
-
|
|
|
40
|
+
| Z / C | Left / right rudder or anti-torque pedals; ground steering in the Mustang |
|
|
38
41
|
| Space | Wheel brakes |
|
|
39
42
|
| G | Retract/extend airplane gear while airborne |
|
|
40
43
|
| F | Toggle airplane flaps |
|
|
@@ -45,7 +48,7 @@ streaming and floating-origin changes. Reloading starts a fresh session.
|
|
|
45
48
|
|
|
46
49
|
Mustang: start the engine, set flaps, hold the brake while raising throttle, then release the brake.
|
|
47
50
|
The propeller swings the nose left as the tail gets light, and a crosswind turns it into the wind:
|
|
48
|
-
hold a little right rudder (
|
|
51
|
+
hold a little right rudder (C), or rudder away from the wind, to keep the runway centerline.
|
|
49
52
|
Rotate around 85–100 knots and release the pitch key once the nose is about 10 degrees up; the
|
|
50
53
|
airplane keeps the attitude it lifted off at. At climb power the propeller's torque rolls it
|
|
51
54
|
slowly left, so tap right bank (D) as needed. Retract gear and flaps after climbing. Reduce
|
|
@@ -76,7 +79,7 @@ markings are decorative, while live flight readings come from the HUD. Board at
|
|
|
76
79
|
entry point. Its larger footprint needs substantially more runway and clearance.
|
|
77
80
|
|
|
78
81
|
Osprey and Harrier: use J to select vertical thrust (the parked Osprey starts there), allow the nacelles/nozzles to
|
|
79
|
-
reach 90°, start the engine and increase power smoothly. W/S, A/D and
|
|
82
|
+
reach 90°, start the engine and increase power smoothly. W/S, A/D and Z/C provide powered pitch,
|
|
80
83
|
roll and yaw control in a hover. Transition toward forward thrust gradually while gaining airspeed;
|
|
81
84
|
the nacelles take 12 seconds for full travel and Harrier nozzles take 3. These are simplified
|
|
82
85
|
powered-lift dynamics, with finite travel, vertical thrust, engine-dependent hover authority and
|
|
@@ -95,6 +98,62 @@ 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 separate main rotor,
|
|
109
|
+
tail rotor and tail sections; the small airliner has detachable wings (with their engines) and
|
|
110
|
+
tail. Every animated rotor, propeller and fan in the aircraft catalog has its own collision disc
|
|
111
|
+
and breakable joint. Strong impacts
|
|
112
|
+
or repeated loaded scrapes consume joint integrity. Separation removes the section's collision
|
|
113
|
+
probes, reduces lift/control authority and can disable its attached engines. An asymmetric wing
|
|
114
|
+
loss produces a rolling moment. Detached geometry retains its own velocity and spin, then falls,
|
|
115
|
+
bounces and slows against terrain and resident obstacles. Debris expires after 20 simulation
|
|
116
|
+
seconds; the missing section stays missing. **R** repairs the aircraft and clears debris.
|
|
117
|
+
Losing both wings switches the fuselage to ballistic wreck motion, disabling thrust and flight
|
|
118
|
+
controls. Ground and obstacle contact dissipates wreck spin as well as sliding motion, so the
|
|
119
|
+
fuselage settles after impact; airborne wrecks continue to fall and tumble.
|
|
120
|
+
Other aircraft retain their existing airframe probes alongside their independent rotor parts;
|
|
121
|
+
additional wing, tail and gear separation requires authored section bindings.
|
|
122
|
+
|
|
123
|
+
Rotors collide across their complete swept disc, including its interior and the spaces between
|
|
124
|
+
the old tip probes. The obstacle adapter clips triangles to the disc's thickness and tests the
|
|
125
|
+
radial boundary: geometry above or below a horizontal rotor clears it. Both rotors on tandem
|
|
126
|
+
helicopters and both Osprey proprotors are independent; the latter follow the actual nacelle
|
|
127
|
+
conversion position. Blade speed contributes to joint damage, so hovering beside a post can
|
|
128
|
+
break a spinning rotor even when the hub is stationary. Propeller loss disables its engine;
|
|
129
|
+
tail-rotor loss removes anti-torque authority and produces yaw. These conservative swept
|
|
130
|
+
volumes remain active when stopped, regardless of visible blade phase.
|
|
131
|
+
|
|
132
|
+
For custom models, `spec.collisionParts` replaces `collisionProbes`. Every section declares a
|
|
133
|
+
unique `id`, a `role` (`body`, `leftWing`, `rightWing`, `tail`, `rotor`, `tailRotor`, `gear` or `engine`), local
|
|
134
|
+
probe centers and sphere `radius`, a section `center`, `massFraction`, and GLB `nodes`. Add
|
|
135
|
+
`breakSpeed` in m/s for a breakable joint and `engines` for engines carried by that section.
|
|
136
|
+
Keep a non-detachable `body` and at least 20% of the mass. Optional `fragments` selects triangles
|
|
137
|
+
from shared static detail meshes using a model-space bounding box, so markings follow a wing.
|
|
138
|
+
`disc` replaces a section's sphere probes with a model-space `center`, unit `normal`, `radius`,
|
|
139
|
+
`halfThickness` and `rotor` node from `visual.rotors`. Its optional `tilt` hinge (`pivot`, unit
|
|
140
|
+
`axis`, `angle`) follows `thrustVectorPosition`. A `parent` part id makes a rotor separate when
|
|
141
|
+
its supporting wing or tail breaks, with no duplicate geometry or debris. Detached rotors
|
|
142
|
+
inherit their shaft spin. Terrain uses deterministic samples of the disc interior, rim and
|
|
143
|
+
lowest point; arbitrary height fields are not exact triangle meshes.
|
|
144
|
+
|
|
145
|
+
These are gameplay approximations with authored joint strengths, not a structural engineering
|
|
146
|
+
or accident-reconstruction model. Detached pieces use sphere collision proxies; mesh deformation, fire,
|
|
147
|
+
debris-to-debris contacts and impulse transfer into other vehicles are not simulated. The obstacle
|
|
148
|
+
adapter uses oriented boxes for other cars and body-center spheres for other aircraft.
|
|
149
|
+
|
|
150
|
+
Hosts provide `AircraftEnvironment.contacts(probes, entity)` with world-space contact points,
|
|
151
|
+
outward normals and penetration depths. `aircraftObstacleContacts` from `client/aircraft`
|
|
152
|
+
adapts a collision tree, cars and other aircraft to this contract; the Earth view and world
|
|
153
|
+
explorer use it. The legacy `canOccupy` callback remains supported with a simple recoil because
|
|
154
|
+
it supplies no contact normal. `aircraftState.damage` and `debris` are serializable and survive
|
|
155
|
+
keyframes; `crashed` means damage requiring recovery and no longer freezes motion.
|
|
156
|
+
|
|
98
157
|
## Reuse in another experience
|
|
99
158
|
|
|
100
159
|
All 53 aircraft are registered in the `molen.entities` content pack, with their type documents and models.
|
|
@@ -138,6 +197,13 @@ ownership of a loaded GLB and animates the nodes named by `spec.visual` from air
|
|
|
138
197
|
exterior moving parts as [model-signal bindings](vehicle-interiors.md#exterior-animation), with
|
|
139
198
|
keyframed curves so one gear position can sequence doors and legs.
|
|
140
199
|
|
|
200
|
+
Exposed airplane propellers fade from individual blades into a translucent, soft-edged disk
|
|
201
|
+
between 20 and 60 rad/s (about 190–570 RPM). The disk follows actual shaft speed, including
|
|
202
|
+
independent engines and spool-down, so blades cannot appear frozen at normal operating RPM.
|
|
203
|
+
Its size and radial colors come from the blade geometry and materials; separate central hubs stay solid.
|
|
204
|
+
This render-only effect needs no model changes and works with WebGL and WebGPU. Helicopter
|
|
205
|
+
rotors and enclosed jet fans retain their existing animation.
|
|
206
|
+
|
|
141
207
|
For powered lift, declare `spec.poweredLift` with positive `transitTime`, `controlFadeSpeed`,
|
|
142
208
|
`pitchAuthority`, `rollAuthority`, `yawAuthority` and `damping`, and mark the participating
|
|
143
209
|
forward-facing engine installations `vectored: true`. `aircraftInput.thrustVector` is 0–1;
|
|
@@ -221,8 +287,8 @@ Published cruise, maximum and operating speeds are different quantities. Where a
|
|
|
221
287
|
not specify weight, altitude or throttle, the test condition is explicitly estimated. Some
|
|
222
288
|
aircraft still have engineering-estimate anchors. Passing a fitted anchor establishes internal
|
|
223
289
|
consistency, not independent real-world validation. All polar, lapse and high-alpha coefficients
|
|
224
|
-
remain approximations. Fuel burn, stores,
|
|
225
|
-
structural failures and certified flight-control laws are not modeled.
|
|
290
|
+
remain approximations. Fuel burn, stores, continuous CG changes, detailed engine maps, icing,
|
|
291
|
+
fatigue, load-induced structural failures and certified flight-control laws are not modeled.
|
|
226
292
|
|
|
227
293
|
Flight assistance is limited to the pitch axis, so a keyboard can fly it. The stick moves an
|
|
228
294
|
elevator (deflecting at `pitchResponse` per second and springing back four times faster) that
|
|
@@ -359,7 +425,7 @@ setAircraftEngineFailed(world, 'twin', 'left', false); // explicit repair
|
|
|
359
425
|
`setAircraftEngineFailed` returns false for an unknown aircraft or engine. A failure immediately
|
|
360
426
|
removes powered thrust and lets that propeller spool down; pilot throttle/switch input cannot
|
|
361
427
|
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
|
|
428
|
+
The world explorer supplies common and individual engine controls; failure scenarios are authored through
|
|
363
429
|
this API, without automatic random failures.
|
|
364
430
|
|
|
365
431
|
`aircraftState.engines[id]` stores `rpm`, `rotorAngle`, `failed` and current `thrust` in newtons.
|
|
@@ -383,19 +449,105 @@ wind and forward motion give consistent results. Collision sampling is at least
|
|
|
383
449
|
of translation per substep. Unknown terrain pauses at the last known position and resumes when
|
|
384
450
|
support is available.
|
|
385
451
|
|
|
386
|
-
Hosts can supply `groundHeight`, `wind` and `
|
|
452
|
+
Hosts can supply `groundHeight`, `wind` and `contacts(probes, entity)` (or the legacy
|
|
453
|
+
`canOccupy(transform, spec, entity)`). The world view
|
|
387
454
|
checks nearby resident geometry, the airfield, cars and other aircraft. Cars and exits also check
|
|
388
455
|
conservative aircraft bounds. Imported collision hulls are
|
|
389
|
-
available for hosts that need a different collision solver. Without
|
|
456
|
+
available for hosts that need a different collision solver. Without either obstacle callback, the kernel only
|
|
390
457
|
collides with terrain. Do not add a second physics body that also writes the aircraft transform.
|
|
391
458
|
|
|
392
459
|
This is a game flight model with recognizable polygonal aircraft, not a full aircraft systems
|
|
393
460
|
simulation or a calibrated replica of any airplane's handling. Rotor blade-element aerodynamics,
|
|
394
461
|
autorotation, a quantitatively validated spin model, fuel, automatic engine damage, detailed
|
|
395
|
-
avionics and weapons are outside this implementation.
|
|
396
|
-
|
|
462
|
+
avionics and weapons are outside this implementation. Primary cockpit controls operate the simulated
|
|
463
|
+
systems as described below; switches for unsupported systems remain decorative. Collision uses coarse airframe probes and resident world
|
|
397
464
|
geometry; it does not model deformation or distant unloaded obstacles.
|
|
398
465
|
|
|
466
|
+
## Clickable cockpits
|
|
467
|
+
|
|
468
|
+
Earth views and the world explorer enable pointer controls while occupying the cockpit. Drag a
|
|
469
|
+
yoke or cyclic sideways to bank and down to pull up; release it to center. Pedals drag sideways
|
|
470
|
+
and also center on release. Drag a throttle or collective upward to increase its retained setting.
|
|
471
|
+
Modeled gear selectors toggle on click; flap and thrust-vector levers accept intermediate positions.
|
|
472
|
+
Solid panel geometry blocks clicks behind it. Dragging empty space still looks around.
|
|
473
|
+
|
|
474
|
+
All 53 bundled cockpits have physical controls for their supported systems, including engine
|
|
475
|
+
master switches, individual engine switches and throttles for airplanes with named engine banks,
|
|
476
|
+
parking brakes, and applicable gear, flap and nozzle controls. Supplemental labeled modules fill
|
|
477
|
+
gaps in the original models; their layout approximates the aircraft rather than reproducing every
|
|
478
|
+
real switch. The Cessna 172's existing master rocker and flap selector are directly operable.
|
|
479
|
+
Moving common power (including =/− or the modeled **PWR ALL** handle)
|
|
480
|
+
synchronizes all throttle levers while preserving individual engine cutoffs, mixtures and propeller settings. A throttle indicates
|
|
481
|
+
commanded power; shaft RPM follows the simulation's spool response. Retractable airplane gear is
|
|
482
|
+
locked on the ground. Helicopters retain the existing shared engine/gearbox model and collective.
|
|
483
|
+
Manual-mixture aircraft have operable mixture controls, and aircraft with manual propeller governors
|
|
484
|
+
have operable propeller RPM controls. Fuel selectors, avionics and other unmodeled systems remain decorative.
|
|
485
|
+
|
|
486
|
+
### Mixture and propeller governors
|
|
487
|
+
|
|
488
|
+
`AircraftInputData.mixture` and `.propeller` are retained 0–1 selections, both defaulting to 1.
|
|
489
|
+
The same fields in `engines[id]` override the common selections independently. A common adjustment
|
|
490
|
+
synchronizes only its own control, preserving throttle, cutoff and the other engine settings.
|
|
491
|
+
Drag the modeled mixture or propeller lever upward to increase its setting.
|
|
492
|
+
|
|
493
|
+
An engine with `mixtureControl: true` uses a reduced fuel/air model: 0 cuts fuel immediately;
|
|
494
|
+
1 is full rich. At reduced intake-air density a lower setting can recover power, while excessive
|
|
495
|
+
leaning or enrichment reduces combustion, thrust and available shaft power. The existing
|
|
496
|
+
`ratedDensityRatio` approximates boosted intake air before leaning becomes necessary. Mixture
|
|
497
|
+
cutoff spools the engine down without latching a failure; restoring mixture can restart it when
|
|
498
|
+
the engine master is on. This assisted restart does not model a starter or ignition sequence.
|
|
499
|
+
|
|
500
|
+
`propellerControl: { minRpm: 0.6 }` enables a constant-speed governor: the lever selects between
|
|
501
|
+
60% and 100% of rated RPM. It does not directly set blade angle. At sufficient power the governor
|
|
502
|
+
holds selected RPM; at low power the fine-pitch stop permits RPM to fall. Reduced selected RPM
|
|
503
|
+
limits shaft power in the torque-limited approximation and lowers the static thrust cap. RPM,
|
|
504
|
+
propeller rotation, torque and thrust all follow these inputs. This follows the distinction between
|
|
505
|
+
throttle, mixture and governed RPM in the [FAA engine-controls overview](https://www.faasafety.gov/gslac/ALC/libview_printerfriendly.aspx?id=6849).
|
|
506
|
+
|
|
507
|
+
These are estimated simulation curves, not aircraft performance tables or operating procedures.
|
|
508
|
+
There is no fuel consumption, EGT/CHT, detonation, feathering, reverse thrust or blade-element model.
|
|
509
|
+
Fixed-pitch Cessna 172S and Cherokee aircraft expose mixture without a propeller lever; the DA42
|
|
510
|
+
and PC-12 NGX retain automatic scheduling. Turboprops have no piston mixture. Combined condition
|
|
511
|
+
levers used for propeller RPM currently cover the governed range; engine cutoff remains a separate
|
|
512
|
+
switch. The R44's mixture affects the shared piston/rotor power model without adding a propeller control.
|
|
513
|
+
|
|
514
|
+
Per-engine `aircraftState.engines[id].combustion` reports effectiveness (0–1), and `shaftPower`
|
|
515
|
+
reports delivered watts. Model signals expose these as `engines.<id>.combustion` and `.shaftPowerW`;
|
|
516
|
+
`.mixture` and `.propeller` are commanded lever positions. The live cockpit review shows these
|
|
517
|
+
settings alongside RPM and shaft power so cutoff and independent engine effects are visible.
|
|
518
|
+
|
|
519
|
+
Hosts pass the camera to `visual.updateView(camera)` each frame (in the coordinates of
|
|
520
|
+
`visual.object.position`). The cabin, the interior's `nodes`, is drawn only within three times
|
|
521
|
+
the aircraft's length or span of it (at least 60 m): cockpits held most of an aircraft's draw calls
|
|
522
|
+
and as many again in the shadow pass, yet from farther away they are a few pixels behind the canopy.
|
|
523
|
+
Boarded and chase views are always near enough. Earth views and the world explorer also prepare an
|
|
524
|
+
aircraft's shaders before its model joins the scene.
|
|
525
|
+
|
|
526
|
+
`createAircraftVisual` exposes `cockpit`, a mesh picker and control inventory derived from the
|
|
527
|
+
interior's authored primary-input bindings and glTF node `extras.aircraftControl` metadata.
|
|
528
|
+
An `AircraftControlNode` declares a supported `action`, optional engine ID, and optional
|
|
529
|
+
rest-relative `motion` (`property`, `axis`, `scale`, optional `offset`). Switches and selectors animate their commands;
|
|
530
|
+
gear, flaps and engine RPM still follow the simulation's transit/spool response.
|
|
531
|
+
Separate throttle levers are associated with engine
|
|
532
|
+
positions from pilot-left to pilot-right; duplicated collective/thrust levers remain linked.
|
|
533
|
+
`bindAircraftCockpitPointer` from `@bendyline/molen-client/aircraft` binds a canvas, camera and
|
|
534
|
+
active pilot session. The HTML companion panel is opt-in with `companionPanel: true`, for
|
|
535
|
+
accessibility or older models with incomplete geometry. Call its `update()` each frame
|
|
536
|
+
and `dispose()` on teardown. Hosts apply changes with `applyAircraftControl`, submit the result
|
|
537
|
+
through `flyAircraft`, and mix `AircraftPointerAxes` with their keyboard/gamepad inputs. Session
|
|
538
|
+
release must clear transient axes. The binder cancels drags on exit, view change, blur and pointer
|
|
539
|
+
cancellation; it does not write simulation components directly.
|
|
540
|
+
|
|
541
|
+
In the engine repository, build the client and kernel, then run a local live review of all 53 bundled aircraft:
|
|
542
|
+
|
|
543
|
+
```sh
|
|
544
|
+
pnpm --filter @bendyline/molen-examples-world-explorer exec vite --config ../../packages/entities/scripts/cockpit-controls-vite.mjs
|
|
545
|
+
```
|
|
546
|
+
|
|
547
|
+
Open `http://127.0.0.1:4322/packages/entities/scripts/cockpit-controls.html`. The review runs the
|
|
548
|
+
real aircraft solver, displays commanded power beside actual RPM, and offers parked, airborne
|
|
549
|
+
and exterior views.
|
|
550
|
+
|
|
399
551
|
## Reproducible review
|
|
400
552
|
|
|
401
553
|
The source brief, generator, provenance and verification notes are in the engine repository, in
|
|
@@ -416,3 +568,11 @@ hold is a harness feature, not a player control or a certified performance chart
|
|
|
416
568
|
`packages/kernel/test/aircraft-engines.test.ts` covers symmetric two/four-engine layouts,
|
|
417
569
|
mirrored engine failures, counter-rudder, thrust moment arms, independent switches/spool,
|
|
418
570
|
explicit repair, terrain rollback, exit safety, keyframe restoration and 30/60/120 Hz consistency.
|
|
571
|
+
|
|
572
|
+
Exterior mechanisms use the snapshot-owned [graduated actuator system](vehicle-interiors.md#graduated-mechanisms).
|
|
573
|
+
Canopies, hooks and speed brakes accept fractional targets through `aircraftInput.actuators`;
|
|
574
|
+
`aircraftState.actuators` holds actual travel. Ordinary mechanisms reverse immediately from
|
|
575
|
+
their current position. Speed-brake drag follows deployment. Retractable helicopter gear
|
|
576
|
+
uses `helicopter.fixedGear: false` and `gearTransitTime`; skids remain fixed by default.
|
|
577
|
+
The supplied aircraft expose only fitted equipment. Helicopter blade release is a gameplay
|
|
578
|
+
escape effect, triggered by the latched `eject` actuator, and removes rotor lift after release.
|
|
@@ -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
|
|
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
|
|
@@ -327,7 +341,8 @@ The quality tier caps the numbers:
|
|
|
327
341
|
| Ultra | 320 | 120 | 2 | 4 | 16 | 1000 m |
|
|
328
342
|
|
|
329
343
|
Ambient cars share the view's vehicle world, so the car you drive stops against them and traffic
|
|
330
|
-
waits for you,
|
|
344
|
+
waits for you, for the view's [actors](earth-view.md#actors-companions-and-npcs) on foot and for
|
|
345
|
+
cars a driver left standing. They
|
|
331
346
|
follow the rendered ground and bridge decks, and they rebuild when the view re-anchors after a long
|
|
332
347
|
trip.
|
|
333
348
|
|
|
@@ -353,6 +368,16 @@ no longer counts or removes it, and the actors draw it from then on, looking at
|
|
|
353
368
|
interactable unless the spec says otherwise. `adopt` returns undefined when the pedestrian has
|
|
354
369
|
already gone. It is one-way; an actor never returns to the pool.
|
|
355
370
|
|
|
371
|
+
### Taking a stopped car
|
|
372
|
+
|
|
373
|
+
A walker can take over a traffic car that has stopped (slower than 0.5 m/s), such as one waiting
|
|
374
|
+
for them at the kerb. `EarthVehicles` counts it as a car in reach: `openDoor` and `enter` take it
|
|
375
|
+
out of traffic and stand a drivable car of the same type and paint at its pose, and the agent
|
|
376
|
+
leaves in the frame that car's model shows. Pass `vehicles.trafficSolids()` to `ambient.sync`
|
|
377
|
+
with your other solids, so the cars queued behind it keep their gap until it drives off. A taken
|
|
378
|
+
car nobody drove away rejoins traffic where it stopped once its model unloads (65 m away); one
|
|
379
|
+
driven elsewhere stays parked there. Moving traffic is never boardable.
|
|
380
|
+
|
|
356
381
|
## NPC content and `ambientRole`
|
|
357
382
|
|
|
358
383
|
An entity type joins the ambient pools with an `ambientRole`:
|
|
@@ -475,7 +500,9 @@ most one tile every 200 ms. In the engine repository,
|
|
|
475
500
|
counts follow the width when OSM does not give them.
|
|
476
501
|
- Aircraft fly straight lines. They do not taxi, circle or land beyond the approach.
|
|
477
502
|
- Pedestrians keep to their lane and follow the walker ahead. They do not step around each other.
|
|
478
|
-
- Agents do not open doors, board, or park. A
|
|
503
|
+
- Agents do not open doors, board, or park. A walker can take a stopped car out of traffic (see
|
|
504
|
+
[Taking a stopped car](#taking-a-stopped-car)); a parked car in the Earth view is a separate
|
|
505
|
+
entity.
|
|
479
506
|
- A promoted pedestrian keeps its body but nothing of its walk: it stands until its actor
|
|
480
507
|
behaviour moves it, and it never rejoins ambient life.
|
|
481
508
|
|
|
@@ -17,7 +17,7 @@ play without opening a browser.
|
|
|
17
17
|
| `molen.audio.*` | scene scripts | `play`, `stop` and `music`, emitted as `audio.*` events |
|
|
18
18
|
| `@bendyline/molen-client/audio` | the page | `createAudioLayer` loads banks and plays what the rules ask for |
|
|
19
19
|
|
|
20
|
-
The `molen.sounds` content pack carries
|
|
20
|
+
The `molen.sounds` content pack carries 170 CC0 sounds (ambience, vehicles, footsteps, impacts,
|
|
21
21
|
foley, UI, stings and six music tracks). Fetch it into a project with:
|
|
22
22
|
|
|
23
23
|
```sh
|
|
@@ -212,6 +212,43 @@ boats and exterior cameras retain outside ambience. Only one bed per category pl
|
|
|
212
212
|
staggered rotation and five-second crossfades. See [Earth view](earth-view.md) for host inputs.
|
|
213
213
|
Pass `audio: false` to turn it off, and use `view.audio` for volume.
|
|
214
214
|
|
|
215
|
+
Vehicle details use the same simulation snapshots as the visuals:
|
|
216
|
+
|
|
217
|
+
- Pedestrian-signal recordings belong to the `earth:category:crossing` pool. They require a
|
|
218
|
+
nearby mapped or rendered traffic signal, fade to silence 55 m from the junction edge and
|
|
219
|
+
25 m above ground, and stay silent when the map context is unknown. Ordinary traffic keeps
|
|
220
|
+
its separate road-distance mix. The recording contains its own signal cycle; it is not a
|
|
221
|
+
promise that a simulated crossing is safe to use.
|
|
222
|
+
- Paved airplane touchdowns play a short tire spin-up chirp, scaled by ground speed and descent
|
|
223
|
+
rate. Retracted gear, crashes, grass/unknown surfaces, parked spawns and rapid landing bounces
|
|
224
|
+
stay quiet. Composing hosts supply `EarthAudioFrame.surfaceAt(x, z)` so contact uses the
|
|
225
|
+
aircraft's position; the standard Earth view and World Explorer do this automatically.
|
|
226
|
+
- Door, hood and trunk actuator movement triggers opening/sliding foley; a closing latch sounds
|
|
227
|
+
only when travel reaches the shut position. Van rear doors slide. Wipers sound at each
|
|
228
|
+
half-cycle of their actual actuator phase, including the return stroke when switched off.
|
|
229
|
+
Legacy vehicles retain boarding cues. Passenger boarding never starts or stops an engine.
|
|
230
|
+
- Flap and retractable landing-gear motor loops track changes in `flapPosition` and
|
|
231
|
+
`gearPosition`. They run during extension/retraction, preserve one voice through reversals,
|
|
232
|
+
and fade out when the mechanism stops, including partial flap settings. Fixed or instant
|
|
233
|
+
gear stays silent; retractable helicopter gear is supported. Pauses, teleports, removed
|
|
234
|
+
aircraft and world switches clean up the loops. The two generic servo recordings are CC0:
|
|
235
|
+
[vacuumfan7072](https://freesound.org/people/vacuumfan7072/sounds/264592/) and
|
|
236
|
+
[Burningmonkey](https://freesound.org/people/Burningmonkey/sounds/322021/).
|
|
237
|
+
- Helicopter engine loops tagged `rotor` use estimated collective and cyclic feathering angles,
|
|
238
|
+
bank/rate, descending inflow and listener direction to change gain, low-pass cutoff and a
|
|
239
|
+
once-per-revolution loading envelope. Web Audio generates that envelope at audio rate;
|
|
240
|
+
the recorded blade-passage chop remains intact. RPM still controls playback speed. This is
|
|
241
|
+
an authored acoustic approximation, not a calibrated aerodynamic noise solver, and it does
|
|
242
|
+
not change flight physics or replay hashes. The dependency choices are informed by NASA's
|
|
243
|
+
[maneuvering flight noise study](https://ntrs.nasa.gov/citations/20160005979).
|
|
244
|
+
|
|
245
|
+
Interactive emitters take priority over background beds when the voice budget is full. Missing
|
|
246
|
+
new foley in older/custom packs is silent. The added recordings are CC0, with source pages,
|
|
247
|
+
authors, verified license dates and source hashes in the sound pack's `sources.json` and credits
|
|
248
|
+
in `NOTICE.md`: [tire foley](https://freesound.org/people/johnnydekk/sounds/614627/),
|
|
249
|
+
[wipers](https://bigsoundbank.com/windshield-wipers-slow-2-s3111.html) and
|
|
250
|
+
[sliding door foley](https://freesound.org/people/SwagMuffinPlus/sounds/176146/).
|
|
251
|
+
|
|
215
252
|
Sound packs can also provide a `birdsong` document (`molen/earth-birdsong@1`). The default pack
|
|
216
253
|
contains eight CC0 regional recordings, selected by geography, observed habitat, calendar month
|
|
217
254
|
and local sunlight. Dawn choruses peak near sunrise, breeding songs quieten outside their authored
|
|
@@ -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
|
|
27
|
-
|
|
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`
|
|
33
|
-
`current` is `[east, south]` in meters per second. Each swell
|
|
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.
|
|
@@ -166,6 +166,17 @@ renderer, and on a software rasterizer it will lose.
|
|
|
166
166
|
|
|
167
167
|
## Manual frame loop
|
|
168
168
|
|
|
169
|
+
Automatic clients pause the kernel and stop rendering when the browser window loses focus or
|
|
170
|
+
the tab becomes hidden. Queued GPU preparation waits too. Focus resumes playback without
|
|
171
|
+
catching up the time spent away; an explicit pause or a `startPaused` loading screen stays paused.
|
|
172
|
+
GPU resources remain allocated for a quick return — this frees rendering capacity, not VRAM.
|
|
173
|
+
Pass `pauseWhenInactive: false` to keep a live client running in the background.
|
|
174
|
+
|
|
175
|
+
Manual frame loops and snapshot captures remain host-controlled by default. A manual live client
|
|
176
|
+
can opt into worker suspension with `pauseWhenInactive: true`; its host still owns render calls.
|
|
177
|
+
Custom loops can use `observePageActivity(callback)` to observe initial activity and subsequent
|
|
178
|
+
window focus/blur and page visibility changes; its return value removes the listeners.
|
|
179
|
+
|
|
169
180
|
Pass `frameLoop: 'manual'` to drive rendering yourself (machinima camera tracks, custom timing):
|
|
170
181
|
|
|
171
182
|
```ts
|
|
@@ -46,6 +46,7 @@ subsystem's contribution to the state hash reproduces.
|
|
|
46
46
|
| Scene scripts | Cross-platform **until** the script calls a transcendental; then same JS engine | the Compartment's `Math` is IEEE-exact natives plus `dmath` for everything else (`kernel/src/scripting.ts`); `Math.random` is absent and `Date`/`Intl`/`Promise` are shadowed to `undefined` |
|
|
47
47
|
| Quaternion helpers that use angles — `quatSlerp`, `lookRotation`, `quatFromYaw`, `quatFromEuler`, `yawOf` | Same JS engine | `kernel/src/math3d.ts` routes these through `dmath.sin/cos/acos/atan2`, and `dmath` is currently a thin re-export of native `Math` |
|
|
48
48
|
| Vehicles and aircraft | Same JS engine | `kernel/src/vehicles.ts` and `aircraft.ts` use `dmath.sin/cos/tan/atan2/exp` |
|
|
49
|
+
| Glass fracture and retention | Same JS engine | Authored panes and resolved contact loads produce persistent `glassState`; vehicle-driven loads inherit the chassis solver's guarantee. Debris is cosmetic and uses simulation time |
|
|
49
50
|
| Figures (`@bendyline/molen-figures/kernel`) | Same JS engine | its locomotion system writes `figureState` and `transform.rot` into the world and registers a `figures` snapshot provider, so it **is** hashed; it reaches `dmath.atan2` and `quatFromYaw`, and `gait.ts` reaches `dmath.pow`/`sin`/`cos` |
|
|
50
51
|
| Ambient life (`@bendyline/molen-ambient/kernel`) | Same JS engine | agent state (`ambientAgent`, the `$ambient` bookkeeping entity) and transforms are written into the world, so it **is** hashed; occupancy, junction grants and signal phases are rebuilt from components every tick, so a keyframe restores exactly into a world whose transport network was built from the same inputs. It reaches `dmath.acos/sin/cos` and `lookRotation`. The network itself is a `WeakMap` side channel like worldgen's |
|
|
51
52
|
| `physics.engine: "rapier"` (3D rigid bodies) | Same build + platform | `@dimforge/rapier3d-compat` WASM; the plugin hashes an opaque `takeSnapshot()` blob plus its id→handle maps |
|
|
@@ -135,7 +136,7 @@ Two constants live in `packages/kernel/src/version.ts` and they do different job
|
|
|
135
136
|
|
|
136
137
|
| Constant | Today | Role |
|
|
137
138
|
|---|---|---|
|
|
138
|
-
| `ENGINE_VERSION` | `0.0.
|
|
139
|
+
| `ENGINE_VERSION` | `0.0.10` | metadata. Written into a keyframe's `engine` field so a save says which build wrote it. **Never compared on load, never hashed.** |
|
|
139
140
|
| `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
141
|
|
|
141
142
|
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.
|
|
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
|
|
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 |
|