@bendyline/molen-tooling 0.0.9 → 0.0.10
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 +239 -236
- package/dist/capture/worldgen-preview.js +215 -215
- package/dist/cli.mjs +6 -5
- package/dist/docs-src/guide/adaptive-performance.md +5 -2
- package/dist/docs-src/guide/aircraft.md +113 -40
- package/dist/docs-src/guide/ambient-life.md +100 -11
- package/dist/docs-src/guide/audio.md +1 -1
- package/dist/docs-src/guide/boats.md +99 -0
- package/dist/docs-src/guide/determinism.md +1 -1
- package/dist/docs-src/guide/dioramas.md +167 -0
- package/dist/docs-src/guide/earth-view.md +241 -3
- package/dist/docs-src/guide/entities.md +32 -1
- package/dist/docs-src/guide/figures.md +7 -1
- package/dist/docs-src/guide/graphics-performance.md +16 -3
- package/dist/docs-src/guide/medium-fi.md +15 -6
- package/dist/docs-src/guide/sky.md +3 -2
- package/dist/docs-src/guide/surface-rendering.md +4 -1
- package/dist/docs-src/guide/vehicle-interiors.md +40 -2
- package/dist/docs-src/guide/vehicles.md +121 -19
- package/dist/docs-src/guide/weather.md +45 -3
- package/dist/docs-src/guide/worldgen.md +8 -0
- package/dist/docs-src/llms.txt +6 -4
- package/dist/docs-src/schemas/archstyle.md +114 -0
- package/dist/docs-src/schemas/components.md +1589 -137
- package/dist/docs-src/schemas/scene.md +6 -3
- package/dist/docs-src/schemas/transport-network.md +4 -2
- package/dist/index.mjs +1 -1
- package/dist/{mcp-BbHk4ibu.mjs → mcp-BbxqqnD1.mjs} +3 -2
- package/dist/{ops-CErtZh2t.mjs → ops-b4Pag8U-.mjs} +7 -5
- package/dist/templates/city-courier/README.md +18 -0
- package/dist/templates/city-courier/gen/molen-types.ts +217 -15
- package/dist/templates/city-courier/index.html +1 -1
- package/dist/templates/city-courier/scripts/molen-scripts.d.ts +219 -17
- package/dist/templates/city-courier/src/audio.ts +26 -4
- package/dist/templates/city-courier/src/game-shell.css +7 -3
- package/dist/templates/city-courier/src/main.ts +25 -3
- package/dist/templates/city-courier/src/shared/accessibility.css +325 -0
- package/dist/templates/city-courier/src/shared/game-controls.ts +406 -0
- package/dist/templates/city-courier/src/shared/game-descriptions.ts +143 -0
- package/dist/templates/city-courier/src/shared/playback.ts +146 -0
- package/dist/templates/city-courier/src/worker.ts +5 -1
- package/dist/templates/cubes/index.html +6 -1
- package/dist/templates/cubes/src/main.ts +25 -2
- package/dist/templates/cubes/src/shared/accessibility.css +325 -0
- package/dist/templates/cubes/src/shared/playback.ts +146 -0
- package/dist/templates/cubes/src/vite-env.d.ts +1 -0
- package/dist/templates/cubes/src/worker.ts +1 -0
- package/dist/templates/data-viz/README.md +4 -0
- package/dist/templates/data-viz/index.html +6 -1
- package/dist/templates/data-viz/src/main.ts +53 -11
- package/dist/templates/data-viz/src/shared/accessibility.css +325 -0
- package/dist/templates/data-viz/src/shared/playback.ts +146 -0
- package/dist/templates/data-viz/src/vite-env.d.ts +1 -0
- package/dist/templates/data-viz/src/worker.ts +1 -0
- package/dist/templates/figures-gallery/index.html +6 -1
- package/dist/templates/figures-gallery/src/main.ts +21 -2
- package/dist/templates/figures-gallery/src/shared/accessibility.css +325 -0
- package/dist/templates/figures-gallery/src/shared/playback.ts +146 -0
- package/dist/templates/figures-gallery/src/vite-env.d.ts +1 -0
- package/dist/templates/figures-gallery/src/worker.ts +1 -0
- package/dist/templates/index.json +36 -16
- package/dist/templates/skybound/README.md +18 -0
- package/dist/templates/skybound/gen/molen-types.ts +217 -15
- package/dist/templates/skybound/index.html +1 -1
- package/dist/templates/skybound/scripts/molen-scripts.d.ts +219 -17
- package/dist/templates/skybound/src/audio.ts +26 -4
- package/dist/templates/skybound/src/game-shell.css +7 -3
- package/dist/templates/skybound/src/main.ts +25 -3
- package/dist/templates/skybound/src/shared/accessibility.css +325 -0
- package/dist/templates/skybound/src/shared/game-controls.ts +406 -0
- package/dist/templates/skybound/src/shared/game-descriptions.ts +143 -0
- package/dist/templates/skybound/src/shared/playback.ts +146 -0
- package/dist/templates/skybound/src/worker.ts +1 -1
- package/dist/templates/terrain-flyover/README.md +5 -1
- package/dist/templates/terrain-flyover/index.html +4 -1
- package/dist/templates/terrain-flyover/src/main.ts +40 -39
- package/dist/templates/top-down-arena/index.html +6 -1
- package/dist/templates/top-down-arena/scripts/molen-scripts.d.ts +219 -17
- package/dist/templates/top-down-arena/src/audio.ts +26 -4
- package/dist/templates/top-down-arena/src/gen/molen-types.ts +217 -15
- package/dist/templates/top-down-arena/src/main.ts +31 -5
- package/dist/templates/top-down-arena/src/shared/accessibility.css +325 -0
- package/dist/templates/top-down-arena/src/shared/playback.ts +146 -0
- package/dist/templates/top-down-arena/src/worker.ts +1 -1
- package/package.json +12 -12
|
@@ -1149,7 +1149,8 @@ Root document an experience boots from; instantiates into ECS state at tick 0.
|
|
|
1149
1149
|
"car",
|
|
1150
1150
|
"pedestrian",
|
|
1151
1151
|
"train",
|
|
1152
|
-
"aircraft"
|
|
1152
|
+
"aircraft",
|
|
1153
|
+
"boat"
|
|
1153
1154
|
]
|
|
1154
1155
|
},
|
|
1155
1156
|
"description": "Which NPC classes run (default ['car'])."
|
|
@@ -1162,7 +1163,8 @@ Root document an experience boots from; instantiates into ECS state at tick 0.
|
|
|
1162
1163
|
"car",
|
|
1163
1164
|
"pedestrian",
|
|
1164
1165
|
"train",
|
|
1165
|
-
"aircraft"
|
|
1166
|
+
"aircraft",
|
|
1167
|
+
"boat"
|
|
1166
1168
|
]
|
|
1167
1169
|
},
|
|
1168
1170
|
"additionalProperties": {
|
|
@@ -1197,7 +1199,8 @@ Root document an experience boots from; instantiates into ECS state at tick 0.
|
|
|
1197
1199
|
"car",
|
|
1198
1200
|
"pedestrian",
|
|
1199
1201
|
"train",
|
|
1200
|
-
"aircraft"
|
|
1202
|
+
"aircraft",
|
|
1203
|
+
"boat"
|
|
1201
1204
|
]
|
|
1202
1205
|
},
|
|
1203
1206
|
"additionalProperties": {
|
|
@@ -159,7 +159,8 @@ Roads, railways and paths ambient NPCs move on, for scenes without streamed map
|
|
|
159
159
|
"road",
|
|
160
160
|
"rail",
|
|
161
161
|
"path",
|
|
162
|
-
"air"
|
|
162
|
+
"air",
|
|
163
|
+
"water"
|
|
163
164
|
],
|
|
164
165
|
"description": "What moves on it."
|
|
165
166
|
},
|
|
@@ -258,7 +259,8 @@ Roads, railways and paths ambient NPCs move on, for scenes without streamed map
|
|
|
258
259
|
"type": "string",
|
|
259
260
|
"enum": [
|
|
260
261
|
"rail",
|
|
261
|
-
"bus"
|
|
262
|
+
"bus",
|
|
263
|
+
"ferry"
|
|
262
264
|
]
|
|
263
265
|
},
|
|
264
266
|
"dwell": {
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as inspectContentPack, B as searchDocs, C as checkTypesOp, D as buildContentPack, E as reserveNamespace, G as schemaToTsType, H as describeOps, L as exportFrames, N as generateTypes, O as extractContentPack, P as renderTypesModule, R as driveScene, S as rasterizeMaterial, T as projectInfo, U as formatOp, V as OPS_CATALOG, W as checkScripts, X as stageAssets, Y as ASSET_INDEX_FILE, Z as screenshotAsset, a as lineupBatchDoc, at as findProjectFile, b as diffSnapshots, c as validateAsset, ct as loadSetupLike, d as runSimulation, dt as playExperience, et as packAsset, f as screenshotScene, ft as registerExperiencePlaySchema, g as listSchemasOp, h as listComponentsOp, i as bakeWorldgen, it as importAsset, j as verifyContentPack, k as fetchContentPack, l as applyUvPaintOp, lt as updateProjectFile, m as getSchemaOp, n as worldgenStats, nt as listAssets, o as loadStylePackFromDisk, ot as loadProject, p as getComponentOp, r as previewWorldgen, rt as assetFileIndex, s as simWatch, st as loadSceneDocument, tt as inspectAsset, u as testTypes, ut as parseExperiencePlayScenario, v as scaffoldExperience, w as listTypes, x as runReplayFile, y as listTemplates, z as locateDocsRoot } from "./ops-
|
|
1
|
+
import { A as inspectContentPack, B as searchDocs, C as checkTypesOp, D as buildContentPack, E as reserveNamespace, G as schemaToTsType, H as describeOps, L as exportFrames, N as generateTypes, O as extractContentPack, P as renderTypesModule, R as driveScene, S as rasterizeMaterial, T as projectInfo, U as formatOp, V as OPS_CATALOG, W as checkScripts, X as stageAssets, Y as ASSET_INDEX_FILE, Z as screenshotAsset, a as lineupBatchDoc, at as findProjectFile, b as diffSnapshots, c as validateAsset, ct as loadSetupLike, d as runSimulation, dt as playExperience, et as packAsset, f as screenshotScene, ft as registerExperiencePlaySchema, g as listSchemasOp, h as listComponentsOp, i as bakeWorldgen, it as importAsset, j as verifyContentPack, k as fetchContentPack, l as applyUvPaintOp, lt as updateProjectFile, m as getSchemaOp, n as worldgenStats, nt as listAssets, o as loadStylePackFromDisk, ot as loadProject, p as getComponentOp, r as previewWorldgen, rt as assetFileIndex, s as simWatch, st as loadSceneDocument, tt as inspectAsset, u as testTypes, ut as parseExperiencePlayScenario, v as scaffoldExperience, w as listTypes, x as runReplayFile, y as listTemplates, z as locateDocsRoot } from "./ops-b4Pag8U-.mjs";
|
|
2
2
|
import { access, copyFile, mkdir, readFile, writeFile } from "node:fs/promises";
|
|
3
3
|
import { PNG } from "pngjs";
|
|
4
4
|
import { dirname } from "node:path";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as formatPacked, A as inspectContentPack, B as searchDocs, C as checkTypesOp, D as buildContentPack, E as reserveNamespace, F as previewFigure, H as describeOps, I as listFigurePresets, J as checkSoundbank, K as planAudio, L as exportFrames, M as bakeNetwork, N as generateTypes, O as extractContentPack, R as driveScene, S as rasterizeMaterial, T as projectInfo, U as formatOp, W as checkScripts, X as stageAssets, Z as screenshotAsset, _ as loadComponentRegistry, b as diffSnapshots, c as validateAsset, d as runSimulation, dt as playExperience, et as packAsset, f as screenshotScene, g as listSchemasOp, h as listComponentsOp, i as bakeWorldgen, it as importAsset, j as verifyContentPack, k as fetchContentPack, l as applyUvPaintOp, m as getSchemaOp, n as worldgenStats, nt as listAssets, p as getComponentOp, q as importSound, r as previewWorldgen, tt as inspectAsset, u as testTypes, v as scaffoldExperience, w as listTypes, x as runReplayFile, y as listTemplates } from "./ops-
|
|
1
|
+
import { $ as formatPacked, A as inspectContentPack, B as searchDocs, C as checkTypesOp, D as buildContentPack, E as reserveNamespace, F as previewFigure, H as describeOps, I as listFigurePresets, J as checkSoundbank, K as planAudio, L as exportFrames, M as bakeNetwork, N as generateTypes, O as extractContentPack, R as driveScene, S as rasterizeMaterial, T as projectInfo, U as formatOp, W as checkScripts, X as stageAssets, Z as screenshotAsset, _ as loadComponentRegistry, b as diffSnapshots, c as validateAsset, d as runSimulation, dt as playExperience, et as packAsset, f as screenshotScene, g as listSchemasOp, h as listComponentsOp, i as bakeWorldgen, it as importAsset, j as verifyContentPack, k as fetchContentPack, l as applyUvPaintOp, m as getSchemaOp, n as worldgenStats, nt as listAssets, p as getComponentOp, q as importSound, r as previewWorldgen, tt as inspectAsset, u as testTypes, v as scaffoldExperience, w as listTypes, x as runReplayFile, y as listTemplates } from "./ops-b4Pag8U-.mjs";
|
|
2
2
|
import { mkdtemp, readFile, rm } from "node:fs/promises";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { z } from "zod";
|
|
@@ -480,7 +480,8 @@ function createMcpServer() {
|
|
|
480
480
|
classes: z.array(z.enum([
|
|
481
481
|
"road",
|
|
482
482
|
"rail",
|
|
483
|
-
"path"
|
|
483
|
+
"path",
|
|
484
|
+
"water"
|
|
484
485
|
])).optional(),
|
|
485
486
|
outPath: z.string(),
|
|
486
487
|
heights: z.boolean().optional()
|
|
@@ -4212,15 +4212,15 @@ const OPS_CATALOG = [
|
|
|
4212
4212
|
},
|
|
4213
4213
|
{
|
|
4214
4214
|
name: "network_bake",
|
|
4215
|
-
summary: "Bake the roads, railways and
|
|
4216
|
-
cli: "molen network bake <terrain-package.json> (--tile z/x/y [--radius n] | --bbox w,s,e,n) --out network.json [--classes road,rail,path] [--heights] [--json]",
|
|
4215
|
+
summary: "Bake the roads, railways, paths and ferry routes of a local terrain package into a molen/transport-network@1 document for ambient traffic in scenes without map tiles.",
|
|
4216
|
+
cli: "molen network bake <terrain-package.json> (--tile z/x/y [--radius n] | --bbox w,s,e,n) --out network.json [--classes road,rail,path,water] [--heights] [--json]",
|
|
4217
4217
|
mcpTool: "network_bake",
|
|
4218
4218
|
params: [
|
|
4219
4219
|
p("packagePath", "string", true, "terrain-package.json path (local PMTiles archives)."),
|
|
4220
4220
|
p("tile", "string", false, "Centre tile \"z/x/y\" at the finest features level."),
|
|
4221
4221
|
p("radius", "number", false, "Tiles around the centre tile to include (default 0)."),
|
|
4222
4222
|
p("bbox", "number[4]", false, "Area [west, south, east, north] in degrees, instead of tile."),
|
|
4223
|
-
p("classes", "string[]", false, "Classes to keep: 'road', 'rail', 'path' (default all)."),
|
|
4223
|
+
p("classes", "string[]", false, "Classes to keep: 'road', 'rail', 'path', 'water' (default all)."),
|
|
4224
4224
|
p("outPath", "string", true, "Write the transport-network document here."),
|
|
4225
4225
|
p("heights", "boolean", false, "Include surface heights from the elevation (default flat).")
|
|
4226
4226
|
]
|
|
@@ -5308,12 +5308,14 @@ async function bakeNetworkImpl(input) {
|
|
|
5308
5308
|
const classes = new Set(input.classes ?? [
|
|
5309
5309
|
"road",
|
|
5310
5310
|
"rail",
|
|
5311
|
-
"path"
|
|
5311
|
+
"path",
|
|
5312
|
+
"water"
|
|
5312
5313
|
]);
|
|
5313
5314
|
const network = new TransportNetwork({ classes: [
|
|
5314
5315
|
...classes.has("road") ? ["road"] : [],
|
|
5315
5316
|
...classes.has("rail") ? ["rail"] : [],
|
|
5316
|
-
...classes.has("path") ? ["walk"] : []
|
|
5317
|
+
...classes.has("path") ? ["walk"] : [],
|
|
5318
|
+
...classes.has("water") ? ["water"] : []
|
|
5317
5319
|
] });
|
|
5318
5320
|
let loaded = 0;
|
|
5319
5321
|
for (const [i, address] of addresses.entries()) {
|
|
@@ -18,6 +18,24 @@ npm run dev
|
|
|
18
18
|
|
|
19
19
|
W/S or Up/Down: accelerate and reverse. A/D or Left/Right: steer. Space: handbrake. R: restart.
|
|
20
20
|
|
|
21
|
+
## Accessible play
|
|
22
|
+
|
|
23
|
+
The game offers **Pause animation**, **Touch controls**, and **Text play** beside the HUD.
|
|
24
|
+
Touch buttons support simultaneous holds (move while jumping, steering, or striking); releasing,
|
|
25
|
+
cancelling, hiding the page, or pausing releases every held action. Touch controls appear by default
|
|
26
|
+
on devices with a coarse pointer and can also be enabled manually.
|
|
27
|
+
|
|
28
|
+
Reduced-motion preferences start the game paused. Pausing stops the simulation, camera, rendering,
|
|
29
|
+
and audio; returning from a hidden page requires an explicit resume. The world also waits for its
|
|
30
|
+
initial snapshot and assets before play starts.
|
|
31
|
+
|
|
32
|
+
**Text play** (or `?text=1`) describes the actual world: position, objectives, nearby hazards and
|
|
33
|
+
resources. Named buttons advance short turns, then pause so reading takes no game time. Precise
|
|
34
|
+
actions use two ticks, including the release tick. Keyboard and assistive activation work on the
|
|
35
|
+
same buttons. The dungeon additionally offers compass and target-facing controls. Visual play can
|
|
36
|
+
be resumed from the same state. These controls change input and pacing; the game's collisions,
|
|
37
|
+
combat, collectibles, time limit and win conditions remain in its scene scripts.
|
|
38
|
+
|
|
21
39
|
## Authoring map
|
|
22
40
|
|
|
23
41
|
- `scene.json`: validated prefabs, level entities, component schemas, command payloads, input bindings, camera, physics, and gameplay configuration.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// AUTO-GENERATED by `molen types gen` — do not edit. inputs-hash: sha256:
|
|
1
|
+
// AUTO-GENERATED by `molen types gen` — do not edit. inputs-hash: sha256:9a7274ed983554e41b2bc21d45403cc54a6fde69ab2134fa54e7762e445d960e
|
|
2
2
|
// Regenerate after editing types/*.json; `molen types check` flags staleness.
|
|
3
3
|
/** biome-ignore-all format: generated file (stable output beats house wrapping) */
|
|
4
4
|
import { defineComponent, type JsonObject } from '@bendyline/molen-kernel';
|
|
@@ -25,6 +25,8 @@ export type AircraftData = {
|
|
|
25
25
|
propellerEfficiency?: number;
|
|
26
26
|
maxThrust?: number;
|
|
27
27
|
minPropellerSpeed?: number;
|
|
28
|
+
propellerRotation?: 'clockwise' | 'counterclockwise';
|
|
29
|
+
propellerInertia?: number;
|
|
28
30
|
};
|
|
29
31
|
engines?: {
|
|
30
32
|
position: [number, number, number];
|
|
@@ -36,6 +38,8 @@ export type AircraftData = {
|
|
|
36
38
|
propellerEfficiency?: number;
|
|
37
39
|
maxThrust?: number;
|
|
38
40
|
minPropellerSpeed?: number;
|
|
41
|
+
propellerRotation?: 'clockwise' | 'counterclockwise';
|
|
42
|
+
propellerInertia?: number;
|
|
39
43
|
id: string;
|
|
40
44
|
}[];
|
|
41
45
|
airplane?: {
|
|
@@ -50,19 +54,25 @@ export type AircraftData = {
|
|
|
50
54
|
rollResponse: number;
|
|
51
55
|
rudderAuthority: number;
|
|
52
56
|
groundSteerSpeed: number;
|
|
53
|
-
coordinatedTurnMinSpeed: number;
|
|
54
57
|
groundLevelRate: number;
|
|
55
|
-
maxPitch: number;
|
|
56
58
|
maxGroundPitch: number;
|
|
57
|
-
maxRoll: number;
|
|
58
59
|
camberAngle: number;
|
|
59
60
|
flapLift: number;
|
|
60
61
|
postStallFlapEffect: number;
|
|
61
62
|
stallAngle: number;
|
|
62
63
|
stallTransitionAngle?: number;
|
|
63
|
-
|
|
64
|
+
pitchFrequency?: number;
|
|
65
|
+
pitchDamping?: number;
|
|
66
|
+
maxLoadFactor?: number;
|
|
67
|
+
minLoadFactor?: number;
|
|
68
|
+
autoTrim?: number;
|
|
69
|
+
directionalStability?: number;
|
|
70
|
+
yawDamping?: number;
|
|
71
|
+
dihedralEffect?: number;
|
|
72
|
+
rollInertia?: number;
|
|
73
|
+
pitchInertia?: number;
|
|
64
74
|
yawInertia?: number;
|
|
65
|
-
|
|
75
|
+
propellerEffects?: number;
|
|
66
76
|
stallSpeed: number;
|
|
67
77
|
liftSlope: number;
|
|
68
78
|
postStallLift: number;
|
|
@@ -71,6 +81,8 @@ export type AircraftData = {
|
|
|
71
81
|
inducedDrag: number;
|
|
72
82
|
gearDrag: number;
|
|
73
83
|
flapDrag: number;
|
|
84
|
+
gearTransitTime?: number;
|
|
85
|
+
flapTransitTime?: number;
|
|
74
86
|
stallDrag: number;
|
|
75
87
|
propellerEfficiency: number;
|
|
76
88
|
maxThrust: number;
|
|
@@ -143,8 +155,28 @@ export type AircraftData = {
|
|
|
143
155
|
source: string;
|
|
144
156
|
property: 'rotation' | 'position';
|
|
145
157
|
axis: 'x' | 'y' | 'z';
|
|
146
|
-
scale
|
|
158
|
+
scale?: number;
|
|
147
159
|
offset?: number;
|
|
160
|
+
keys?: [number, number][];
|
|
161
|
+
ease?: 'linear' | 'smooth';
|
|
162
|
+
min?: number;
|
|
163
|
+
max?: number;
|
|
164
|
+
}[];
|
|
165
|
+
};
|
|
166
|
+
animation?: {
|
|
167
|
+
sources?: Record<string, {
|
|
168
|
+
component: string;
|
|
169
|
+
path: (string | number)[];
|
|
170
|
+
}>;
|
|
171
|
+
bindings: {
|
|
172
|
+
node: string;
|
|
173
|
+
source: string;
|
|
174
|
+
property: 'rotation' | 'position';
|
|
175
|
+
axis: 'x' | 'y' | 'z';
|
|
176
|
+
scale?: number;
|
|
177
|
+
offset?: number;
|
|
178
|
+
keys?: [number, number][];
|
|
179
|
+
ease?: 'linear' | 'smooth';
|
|
148
180
|
min?: number;
|
|
149
181
|
max?: number;
|
|
150
182
|
}[];
|
|
@@ -175,7 +207,13 @@ export type AircraftStateData = {
|
|
|
175
207
|
roll: number;
|
|
176
208
|
pitchRate: number;
|
|
177
209
|
rollRate: number;
|
|
178
|
-
|
|
210
|
+
yawRate?: number;
|
|
211
|
+
elevator?: number;
|
|
212
|
+
gearPosition?: number;
|
|
213
|
+
flapPosition?: number;
|
|
214
|
+
pitchTrim?: number;
|
|
215
|
+
sideslip?: number;
|
|
216
|
+
loadFactor?: number;
|
|
179
217
|
engines?: Record<string, {
|
|
180
218
|
rpm: number;
|
|
181
219
|
rotorAngle: number;
|
|
@@ -193,14 +231,15 @@ export type AircraftStateData = {
|
|
|
193
231
|
crashed: boolean;
|
|
194
232
|
waitingForTerrain: boolean;
|
|
195
233
|
};
|
|
196
|
-
/** Kernel-owned state of an ambient NPC (car, pedestrian, train car or
|
|
234
|
+
/** Kernel-owned state of an ambient NPC (car, pedestrian, train car, aircraft or boat): its lane, position along it, speed and routing. Read it; the ambient systems write it. */
|
|
197
235
|
export type AmbientAgentData = {
|
|
198
|
-
kind: 'car' | 'pedestrian' | 'train' | 'aircraft';
|
|
236
|
+
kind: 'car' | 'pedestrian' | 'train' | 'aircraft' | 'boat';
|
|
199
237
|
type: string;
|
|
200
238
|
color?: string;
|
|
201
239
|
lane: string;
|
|
202
240
|
s: number;
|
|
203
241
|
speed: number;
|
|
242
|
+
cruise?: number;
|
|
204
243
|
prev?: string;
|
|
205
244
|
next?: string;
|
|
206
245
|
seed: number;
|
|
@@ -231,9 +270,9 @@ export type AmbientObserverData = {
|
|
|
231
270
|
despawnRadius?: number;
|
|
232
271
|
density?: number;
|
|
233
272
|
};
|
|
234
|
-
/** On an entity type: makes it an ambient NPC candidate (car, bus, rail car or
|
|
273
|
+
/** On an entity type: makes it an ambient NPC candidate (car, bus, rail car, aircraft, boat or ferry) with dimensions, speeds and spawn weight. */
|
|
235
274
|
export type AmbientRoleData = {
|
|
236
|
-
role: 'car' | 'bus' | 'rail' | 'aircraft';
|
|
275
|
+
role: 'car' | 'bus' | 'rail' | 'aircraft' | 'boat' | 'ferry';
|
|
237
276
|
length?: number;
|
|
238
277
|
width?: number;
|
|
239
278
|
height?: number;
|
|
@@ -397,6 +436,91 @@ export type AudioZoneData = {
|
|
|
397
436
|
exists: boolean;
|
|
398
437
|
}>;
|
|
399
438
|
};
|
|
439
|
+
/** Waterline-aligned powered hull with data-driven handling and shared seats. */
|
|
440
|
+
export type BoatData = {
|
|
441
|
+
kind: string;
|
|
442
|
+
spec: {
|
|
443
|
+
label: string;
|
|
444
|
+
length: number;
|
|
445
|
+
width: number;
|
|
446
|
+
height: number;
|
|
447
|
+
draft: number;
|
|
448
|
+
mass: number;
|
|
449
|
+
thrust: number;
|
|
450
|
+
maxSpeed: number;
|
|
451
|
+
reverseSpeed: number;
|
|
452
|
+
turnRate: number;
|
|
453
|
+
turnResponse: number;
|
|
454
|
+
lateralDrag: number;
|
|
455
|
+
buoyancyFrequency: number;
|
|
456
|
+
driverEye: [number, number, number];
|
|
457
|
+
};
|
|
458
|
+
visual: {
|
|
459
|
+
wheelNodes: string[];
|
|
460
|
+
frontWheelNodes: string[];
|
|
461
|
+
steeringWheelNode?: string;
|
|
462
|
+
paintMaterial: string;
|
|
463
|
+
interior?: {
|
|
464
|
+
nodes: string[];
|
|
465
|
+
sources?: Record<string, {
|
|
466
|
+
component: string;
|
|
467
|
+
path: (string | number)[];
|
|
468
|
+
}>;
|
|
469
|
+
bindings: {
|
|
470
|
+
node: string;
|
|
471
|
+
source: string;
|
|
472
|
+
property: 'rotation' | 'position';
|
|
473
|
+
axis: 'x' | 'y' | 'z';
|
|
474
|
+
scale?: number;
|
|
475
|
+
offset?: number;
|
|
476
|
+
keys?: [number, number][];
|
|
477
|
+
ease?: 'linear' | 'smooth';
|
|
478
|
+
min?: number;
|
|
479
|
+
max?: number;
|
|
480
|
+
}[];
|
|
481
|
+
};
|
|
482
|
+
animation?: {
|
|
483
|
+
sources?: Record<string, {
|
|
484
|
+
component: string;
|
|
485
|
+
path: (string | number)[];
|
|
486
|
+
}>;
|
|
487
|
+
bindings: {
|
|
488
|
+
node: string;
|
|
489
|
+
source: string;
|
|
490
|
+
property: 'rotation' | 'position';
|
|
491
|
+
axis: 'x' | 'y' | 'z';
|
|
492
|
+
scale?: number;
|
|
493
|
+
offset?: number;
|
|
494
|
+
keys?: [number, number][];
|
|
495
|
+
ease?: 'linear' | 'smooth';
|
|
496
|
+
min?: number;
|
|
497
|
+
max?: number;
|
|
498
|
+
}[];
|
|
499
|
+
};
|
|
500
|
+
};
|
|
501
|
+
color?: string;
|
|
502
|
+
};
|
|
503
|
+
/** Helm intent: signed thrust, steering and low-speed anchor. Only the driver controls it. */
|
|
504
|
+
export type BoatInputData = {
|
|
505
|
+
throttle: number;
|
|
506
|
+
steering: number;
|
|
507
|
+
anchor: boolean;
|
|
508
|
+
};
|
|
509
|
+
/** Snapshot-safe hull motion, buoyancy and anchoring; owned by installBoats. */
|
|
510
|
+
export type BoatStateData = {
|
|
511
|
+
speed: number;
|
|
512
|
+
lateralSpeed: number;
|
|
513
|
+
velocity: [number, number];
|
|
514
|
+
yaw: number;
|
|
515
|
+
yawRate: number;
|
|
516
|
+
steer: number;
|
|
517
|
+
pitch: number;
|
|
518
|
+
roll: number;
|
|
519
|
+
vy: number;
|
|
520
|
+
anchored: boolean;
|
|
521
|
+
grounded: boolean;
|
|
522
|
+
waitingForWater: boolean;
|
|
523
|
+
};
|
|
400
524
|
/** Kinematic character controller state (speed/jump/gravity + kernel-owned vy/grounded). */
|
|
401
525
|
export type CharacterData = {
|
|
402
526
|
speed: number;
|
|
@@ -725,8 +849,10 @@ export type ModelSignalsData = {
|
|
|
725
849
|
source: string;
|
|
726
850
|
property: 'rotation' | 'position';
|
|
727
851
|
axis: 'x' | 'y' | 'z';
|
|
728
|
-
scale
|
|
852
|
+
scale?: number;
|
|
729
853
|
offset?: number;
|
|
854
|
+
keys?: [number, number][];
|
|
855
|
+
ease?: 'linear' | 'smooth';
|
|
730
856
|
min?: number;
|
|
731
857
|
max?: number;
|
|
732
858
|
}[];
|
|
@@ -738,6 +864,7 @@ export type MountableData = {
|
|
|
738
864
|
role: 'driver' | 'passenger';
|
|
739
865
|
position: [number, number, number];
|
|
740
866
|
}[];
|
|
867
|
+
entries?: [number, number, number][];
|
|
741
868
|
exits: [number, number, number][];
|
|
742
869
|
reach: number;
|
|
743
870
|
};
|
|
@@ -885,6 +1012,27 @@ export type VehicleData = {
|
|
|
885
1012
|
supportTolerance: number;
|
|
886
1013
|
maxStepHeight: number;
|
|
887
1014
|
maxSlope: number;
|
|
1015
|
+
drive?: 'front' | 'rear' | 'all';
|
|
1016
|
+
corneringStiffness?: number;
|
|
1017
|
+
brakeBias?: number;
|
|
1018
|
+
yawInertia?: number;
|
|
1019
|
+
rollStiffness?: number;
|
|
1020
|
+
pitchStiffness?: number;
|
|
1021
|
+
suspensionFrequency?: number;
|
|
1022
|
+
suspensionDamping?: number;
|
|
1023
|
+
cycle?: {
|
|
1024
|
+
maxLean: number;
|
|
1025
|
+
riderLean: number;
|
|
1026
|
+
handlebarPivot: [number, number, number];
|
|
1027
|
+
grips: [[number, number, number], [number, number, number]];
|
|
1028
|
+
footrests: [[number, number, number], [number, number, number]];
|
|
1029
|
+
pedals?: {
|
|
1030
|
+
center: [number, number, number];
|
|
1031
|
+
radius: number;
|
|
1032
|
+
halfWidth: number;
|
|
1033
|
+
ratio: number;
|
|
1034
|
+
};
|
|
1035
|
+
};
|
|
888
1036
|
};
|
|
889
1037
|
visual: {
|
|
890
1038
|
wheelNodes: string[];
|
|
@@ -902,19 +1050,40 @@ export type VehicleData = {
|
|
|
902
1050
|
source: string;
|
|
903
1051
|
property: 'rotation' | 'position';
|
|
904
1052
|
axis: 'x' | 'y' | 'z';
|
|
905
|
-
scale
|
|
1053
|
+
scale?: number;
|
|
906
1054
|
offset?: number;
|
|
1055
|
+
keys?: [number, number][];
|
|
1056
|
+
ease?: 'linear' | 'smooth';
|
|
1057
|
+
min?: number;
|
|
1058
|
+
max?: number;
|
|
1059
|
+
}[];
|
|
1060
|
+
};
|
|
1061
|
+
animation?: {
|
|
1062
|
+
sources?: Record<string, {
|
|
1063
|
+
component: string;
|
|
1064
|
+
path: (string | number)[];
|
|
1065
|
+
}>;
|
|
1066
|
+
bindings: {
|
|
1067
|
+
node: string;
|
|
1068
|
+
source: string;
|
|
1069
|
+
property: 'rotation' | 'position';
|
|
1070
|
+
axis: 'x' | 'y' | 'z';
|
|
1071
|
+
scale?: number;
|
|
1072
|
+
offset?: number;
|
|
1073
|
+
keys?: [number, number][];
|
|
1074
|
+
ease?: 'linear' | 'smooth';
|
|
907
1075
|
min?: number;
|
|
908
1076
|
max?: number;
|
|
909
1077
|
}[];
|
|
910
1078
|
};
|
|
911
1079
|
};
|
|
912
1080
|
};
|
|
913
|
-
/** Driver intent: signed throttle (negative brakes then reverses), signed steering (positive right), brake
|
|
1081
|
+
/** Driver intent: signed throttle (negative brakes then reverses), signed steering (positive right), service brake and optional handbrake. */
|
|
914
1082
|
export type VehicleInputData = {
|
|
915
1083
|
throttle: number;
|
|
916
1084
|
steering: number;
|
|
917
1085
|
brake: boolean;
|
|
1086
|
+
handbrake?: boolean;
|
|
918
1087
|
};
|
|
919
1088
|
/** Snapshot-safe chassis state. Speeds in m/s, angles in radians; owned by installVehicles. */
|
|
920
1089
|
export type VehicleStateData = {
|
|
@@ -927,12 +1096,30 @@ export type VehicleStateData = {
|
|
|
927
1096
|
grounded: boolean;
|
|
928
1097
|
waitingForTerrain: boolean;
|
|
929
1098
|
wheelAngle: number;
|
|
1099
|
+
pedalAngle?: number;
|
|
1100
|
+
lateralSpeed?: number;
|
|
1101
|
+
yawRate?: number;
|
|
1102
|
+
bodyPitch?: number;
|
|
1103
|
+
bodyPitchRate?: number;
|
|
1104
|
+
bodyRoll?: number;
|
|
1105
|
+
bodyRollRate?: number;
|
|
1106
|
+
skid?: number;
|
|
930
1107
|
};
|
|
931
1108
|
/** Opt-in per-tick body velocity mirror (presence = subscription; plugin-written). */
|
|
932
1109
|
export type VelocityData = {
|
|
933
1110
|
linear: [number, number, number];
|
|
934
1111
|
angular: [number, number, number];
|
|
935
1112
|
};
|
|
1113
|
+
/** Deterministic swells and current for boats; heights and coverage come from the host water field. */
|
|
1114
|
+
export type WaterData = {
|
|
1115
|
+
waves?: {
|
|
1116
|
+
amplitude: number;
|
|
1117
|
+
wavelength: number;
|
|
1118
|
+
direction: number;
|
|
1119
|
+
speed: number;
|
|
1120
|
+
}[];
|
|
1121
|
+
current?: [number, number];
|
|
1122
|
+
};
|
|
936
1123
|
/** Singleton physical atmosphere and visual weather: temperature, pressure, humidity, wind, independent cloud cover, precipitation and visibility. Readable by scripts and physics; see guide/weather.md. */
|
|
937
1124
|
export type WeatherData = {
|
|
938
1125
|
atmosphere?: {
|
|
@@ -955,6 +1142,13 @@ export type WeatherData = {
|
|
|
955
1142
|
kind?: 'none' | 'rain' | 'snow';
|
|
956
1143
|
intensity?: number;
|
|
957
1144
|
};
|
|
1145
|
+
wind?: {
|
|
1146
|
+
referenceHeight?: number;
|
|
1147
|
+
shear?: number;
|
|
1148
|
+
turbulence?: number;
|
|
1149
|
+
gusts?: number;
|
|
1150
|
+
terrain?: number;
|
|
1151
|
+
};
|
|
958
1152
|
seed?: number;
|
|
959
1153
|
};
|
|
960
1154
|
/** A building generated at runtime from an outline in the entity frame, styled by a molen/archstyle@1 in the loaded pack; rendered by the worldgen client entity layer. */
|
|
@@ -994,6 +1188,9 @@ export const C = {
|
|
|
994
1188
|
'audioEnvironment': defineComponent<JsonObject & AudioEnvironmentData>('audioEnvironment'),
|
|
995
1189
|
'audioSource': defineComponent<JsonObject & AudioSourceData>('audioSource'),
|
|
996
1190
|
'audioZone': defineComponent<JsonObject & AudioZoneData>('audioZone'),
|
|
1191
|
+
'boat': defineComponent<JsonObject & BoatData>('boat'),
|
|
1192
|
+
'boatInput': defineComponent<JsonObject & BoatInputData>('boatInput'),
|
|
1193
|
+
'boatState': defineComponent<JsonObject & BoatStateData>('boatState'),
|
|
997
1194
|
'character': defineComponent<JsonObject & CharacterData>('character'),
|
|
998
1195
|
'collider': defineComponent<JsonObject & ColliderData>('collider'),
|
|
999
1196
|
'collider3d': defineComponent<JsonObject & Collider3dData>('collider3d'),
|
|
@@ -1030,6 +1227,7 @@ export const C = {
|
|
|
1030
1227
|
'vehicleInput': defineComponent<JsonObject & VehicleInputData>('vehicleInput'),
|
|
1031
1228
|
'vehicleState': defineComponent<JsonObject & VehicleStateData>('vehicleState'),
|
|
1032
1229
|
'velocity': defineComponent<JsonObject & VelocityData>('velocity'),
|
|
1230
|
+
'water': defineComponent<JsonObject & WaterData>('water'),
|
|
1033
1231
|
'weather': defineComponent<JsonObject & WeatherData>('weather'),
|
|
1034
1232
|
'worldgenBuilding': defineComponent<JsonObject & WorldgenBuildingData>('worldgenBuilding'),
|
|
1035
1233
|
} as const;
|
|
@@ -1045,6 +1243,9 @@ export type ComponentName =
|
|
|
1045
1243
|
| 'audioEnvironment'
|
|
1046
1244
|
| 'audioSource'
|
|
1047
1245
|
| 'audioZone'
|
|
1246
|
+
| 'boat'
|
|
1247
|
+
| 'boatInput'
|
|
1248
|
+
| 'boatState'
|
|
1048
1249
|
| 'character'
|
|
1049
1250
|
| 'collider'
|
|
1050
1251
|
| 'collider3d'
|
|
@@ -1081,6 +1282,7 @@ export type ComponentName =
|
|
|
1081
1282
|
| 'vehicleInput'
|
|
1082
1283
|
| 'vehicleState'
|
|
1083
1284
|
| 'velocity'
|
|
1285
|
+
| 'water'
|
|
1084
1286
|
| 'weather'
|
|
1085
1287
|
| 'worldgenBuilding';
|
|
1086
1288
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
<!doctype html>
|
|
2
|
-
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><title>City Courier | Molen</title></head><body><canvas id="view" tabindex="0" aria-label="City Courier game. Keyboard controls are
|
|
2
|
+
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><title>City Courier | Molen</title></head><body><main><canvas id="view" tabindex="0" aria-label="City Courier game. Keyboard instructions, touch controls and text play are available."></canvas><div id="interface"></div></main><script type="module" src="/src/main.ts"></script></body></html>
|