@origingame/engine 0.2.0 → 0.4.0
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/bin/og.mjs +1 -1
- package/dist/web/origin-engine.d.ts +255 -5
- package/dist/web/origin-engine.js +1584 -125
- package/dist/web/origin-engine_bg.wasm +0 -0
- package/dist/web/origin-engine_bg.wasm.d.ts +80 -3
- package/dist/web-publish/origin-engine-lanes.js +1288 -82
- package/dist/web-publish/origin-engine-lanes_bg.wasm +0 -0
- package/dist/web-publish/origin-engine.d.ts +199 -6
- package/dist/web-publish/origin-engine.js +1285 -79
- package/dist/web-publish/origin-engine_bg.wasm +0 -0
- package/dist/web-publish/origin-engine_bg.wasm.d.ts +65 -4
- package/dist/web-publish-2d/origin-engine-lanes.js +1285 -79
- package/dist/web-publish-2d/origin-engine-lanes_bg.wasm +0 -0
- package/dist/web-publish-2d/origin-engine.d.ts +198 -5
- package/dist/web-publish-2d/origin-engine.js +1282 -76
- package/dist/web-publish-2d/origin-engine_bg.wasm +0 -0
- package/dist/web-publish-2d/origin-engine_bg.wasm.d.ts +64 -3
- package/knowledge/README.md +2 -1
- package/knowledge/guides/three-to-og.md +393 -0
- package/knowledge/knowledge.json +2 -1
- package/knowledge/looks/catalogue.json +40 -40
- package/knowledge/package.json +3 -2
- package/knowledge/scaffold/distribution.json +14 -0
- package/knowledge/scaffold/origin-engine.json +2 -2
- package/knowledge/scaffold/template/README.md +2 -1
- package/knowledge/scaffold/template/assets/audio/sting.ogt +10 -0
- package/knowledge/scaffold/template/assets/timelines/intro.ogt +101 -0
- package/knowledge/scaffold/template/assets/timelines/narration.srt +11 -0
- package/knowledge/scaffold/template/host.d.ts +46 -0
- package/knowledge/scaffold/template/package.json +1 -1
- package/knowledge/scaffold/template/project.ogt +1 -1
- package/knowledge/scaffold/template/src/main.ts +1 -1
- package/knowledge/scaffold/template/tests/frames.ts +134 -0
- package/knowledge/scaffold/template/tests/intro.og.ts +65 -0
- package/knowledge/scaffold/template/tests/smoke.og.ts +30 -36
- package/knowledge/scaffold/template/tsconfig.json +1 -1
- package/knowledge/scripts/mount.ts +2 -1
- package/knowledge/scripts/validate.ts +159 -31
- package/knowledge/skills/og-audio/SKILL.md +2 -2
- package/knowledge/skills/og-build/SKILL.md +29 -7
- package/knowledge/skills/og-core/SKILL.md +31 -5
- package/knowledge/skills/og-feel/SKILL.md +2 -2
- package/knowledge/skills/og-game/SKILL.md +1331 -16
- package/knowledge/skills/og-i18n/SKILL.md +7 -7
- package/knowledge/skills/og-model/SKILL.md +374 -0
- package/knowledge/skills/og-platform-sdk/SKILL.md +2 -1
- package/knowledge/skills/og-taste/SKILL.md +82 -73
- package/knowledge/skills/og-ui/SKILL.md +80 -58
- package/knowledge/wiki/ai.md +20 -20
- package/knowledge/wiki/anim.md +392 -41
- package/knowledge/wiki/atmosphere.md +36 -13
- package/knowledge/wiki/audio.md +18 -18
- package/knowledge/wiki/camera.md +19 -13
- package/knowledge/wiki/commands.md +19 -13
- package/knowledge/wiki/debug.md +414 -0
- package/knowledge/wiki/game.md +8 -8
- package/knowledge/wiki/i18n.md +7 -7
- package/knowledge/wiki/index.md +317 -8
- package/knowledge/wiki/input.md +47 -47
- package/knowledge/wiki/load.md +238 -70
- package/knowledge/wiki/math.md +2607 -0
- package/knowledge/wiki/nav.md +34 -34
- package/knowledge/wiki/net.md +340 -0
- package/knowledge/wiki/path.md +402 -0
- package/knowledge/wiki/physics.md +95 -95
- package/knowledge/wiki/platform.md +463 -29
- package/knowledge/wiki/probe.md +681 -67
- package/knowledge/wiki/reflect.md +29 -17
- package/knowledge/wiki/render.md +4993 -1998
- package/knowledge/wiki/rng.md +14 -14
- package/knowledge/wiki/shapes.md +727 -0
- package/knowledge/wiki/stream.md +15 -15
- package/knowledge/wiki/system.md +8 -8
- package/knowledge/wiki/systems.md +2 -2
- package/knowledge/wiki/terrain.md +24 -20
- package/knowledge/wiki/tilemap.md +13 -13
- package/knowledge/wiki/time.md +4 -4
- package/knowledge/wiki/timeline.md +396 -0
- package/knowledge/wiki/transform.md +8 -8
- package/knowledge/wiki/tween.md +17 -17
- package/knowledge/wiki/ui.md +560 -654
- package/knowledge/wiki/video.md +157 -0
- package/knowledge/wiki/world.md +36 -36
- package/package.json +4 -3
- package/schema/api.schema.json +28151 -19640
- package/shell/page.ts +26 -2
- package/shell/platform.ts +51 -0
- package/shell/player.ts +15 -2
- package/shell/transport.ts +6 -0
- package/src/depth.ts +71 -0
- package/src/e6.ts +32 -1
- package/src/env.d.ts +5 -1
- package/src/generated/abi.ts +226 -4
- package/src/geom.ts +260 -0
- package/src/index.ts +32 -4
- package/src/light.ts +18 -0
- package/src/math.ts +622 -0
- package/src/node/index.ts +17 -0
- package/src/node/playtest-run.ts +115 -18
- package/src/node/polish.ts +13 -3
- package/src/node/render.ts +291 -0
- package/src/node/run.ts +86 -5
- package/src/p2.ts +19 -1
- package/src/platform-local.ts +2 -0
- package/src/playtest.ts +65 -4
- package/src/runtime.ts +100 -9
- package/src/targets.ts +28 -0
- package/src/trace.ts +169 -0
- package/src/ui-kit/huds.ts +34 -34
- package/src/ui-kit/menus.ts +12 -12
- package/src/ui-kit/settings.ts +11 -2
- package/src/ui-kit/store.ts +18 -18
- package/src/ui-kit/story.ts +6 -4
- package/src/ui-kit/util.ts +8 -8
- package/src/web/shell.ts +59 -1
- package/src/web/worker.ts +105 -4
- package/types/bindings.json +9368 -6619
- package/types/index.d.ts +16377 -11520
package/knowledge/wiki/probe.md
CHANGED
|
@@ -20,7 +20,7 @@ module probe {
|
|
|
20
20
|
# declarations follow, each quoted below
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
<sub>`api.ogt` line
|
|
23
|
+
<sub>`api.ogt` line 12815</sub>
|
|
24
24
|
|
|
25
25
|
## Contents
|
|
26
26
|
|
|
@@ -36,11 +36,13 @@ module probe {
|
|
|
36
36
|
| [`ProbeTunable`](#type-ProbeTunable) | struct | One published tunable parameter and the range it means something over. |
|
|
37
37
|
| [`ProbeEntityRef`](#type-ProbeEntityRef) | struct | One entity the probe publishes in state(). |
|
|
38
38
|
| [`ProbeTimings`](#type-ProbeTimings) | struct | The fixed timings head of state(). |
|
|
39
|
+
| [`ProbeTiming`](#type-ProbeTiming) | struct | One named span of the last tick or frame. |
|
|
39
40
|
| [`ProbeState`](#type-ProbeState) | struct | The probe's state(): a fixed head, then the game's own facts. |
|
|
40
41
|
| [`AdvanceOperation`](#type-AdvanceOperation) | struct | The advance operation's payload. |
|
|
41
42
|
| [`InputOperation`](#type-InputOperation) | struct | The input operation's payload. |
|
|
42
43
|
| [`PickOperation`](#type-PickOperation) | struct | The pick operation's payload. |
|
|
43
44
|
| [`EntityOperation`](#type-EntityOperation) | struct | The entity operation's payload. |
|
|
45
|
+
| [`ExpectOperation`](#type-ExpectOperation) | struct | The expect operation's payload. |
|
|
44
46
|
| [`ProbeOperation`](#type-ProbeOperation) | union | One operation of a probe program, which runs in one evaluation so a scripted segment costs one round trip. |
|
|
45
47
|
| [`ProbeProgramResult`](#type-ProbeProgramResult) | struct | What a program observed: one answer per operation that ran. A false, or entity's null, stops the program and `refused` names its index. |
|
|
46
48
|
| [`Hello`](#type-Hello) | struct | The wire's hello: who is speaking. |
|
|
@@ -65,7 +67,21 @@ module probe {
|
|
|
65
67
|
| [`UiElement`](#type-UiElement) | struct | One UI element with its bounds. |
|
|
66
68
|
| [`UiSurface`](#type-UiSurface) | struct | The surface UI bounds are laid out on. |
|
|
67
69
|
| [`UiDump`](#type-UiDump) | struct | The UI tree, flattened in draw order. |
|
|
70
|
+
| [`DesyncDump`](#type-DesyncDump) | struct | The first desync of this peer's lockstep session (og.net), as `dump_desync` writes it. |
|
|
68
71
|
| [`DumpResult`](#type-DumpResult) | union | A dump, tagged by its kind. |
|
|
72
|
+
| [`ScreenBox`](#type-ScreenBox) | struct | A box on the play surface. |
|
|
73
|
+
| [`ScreenPoint`](#type-ScreenPoint) | struct | A point on the play surface. |
|
|
74
|
+
| [`DescribedEntity`](#type-DescribedEntity) | struct | One entity the frame shows, from the entity-id pass (a CPU rasterisation of the frame's meshes, skinned meshes and world sprites at a quarter of its pixels). |
|
|
75
|
+
| [`DescribedView`](#type-DescribedView) | struct | A secondary camera (og.CameraView, og.Mirror) and what its image shows: its own entity-id pass, from its eye and on its layers, at a quarter of its image's pixels, whatever its `every`. An entity only its layers admit (a layer the main camera leaves out) is listed here and not in Description.entities. |
|
|
76
|
+
| [`DescribedUi`](#type-DescribedUi) | struct | One UI element as describe lists it (the tree dump_ui writes). |
|
|
77
|
+
| [`DescribedCamera`](#type-DescribedCamera) | struct | The camera as drawn, with its shake. |
|
|
78
|
+
| [`PassSize`](#type-PassSize) | struct | The entity-id pass's size. |
|
|
79
|
+
| [`Description`](#type-Description) | struct | The frame as data: deterministic, the same JSON on every host and backend for the same world. |
|
|
80
|
+
| [`ExpectStatus`](#type-ExpectStatus) | enum | How an expectation came out. |
|
|
81
|
+
| [`ExpectResult`](#type-ExpectResult) | struct | One evaluated expectation. |
|
|
82
|
+
| [`ExpectReport`](#type-ExpectReport) | struct | The expectations evaluated since the last call. |
|
|
83
|
+
| [`SavedScene`](#type-SavedScene) | struct | The scenes written back from the world: the head is the boot scene's (or the first instantiated one's), `scenes` lists every one. |
|
|
84
|
+
| [`SavedSceneFile`](#type-SavedSceneFile) | struct | One scene file written back. |
|
|
69
85
|
| [`RuntimeProbe`](#type-RuntimeProbe) | interface | RuntimeProbe protocol 5, member for member. Every member answers synchronously with JSON-serialisable values. |
|
|
70
86
|
| [`EngineProbe`](#type-EngineProbe) | interface | The engine's probe: protocol 5 plus the wire members of the loopback WebSocket and the in-page request ring. |
|
|
71
87
|
|
|
@@ -84,7 +100,7 @@ interface RuntimeProbe {
|
|
|
84
100
|
# members follow, each quoted below
|
|
85
101
|
```
|
|
86
102
|
|
|
87
|
-
<sub>`api.ogt` line
|
|
103
|
+
<sub>`api.ogt` line 13345</sub>
|
|
88
104
|
|
|
89
105
|
<a id="member-RuntimeProbe-version"></a>
|
|
90
106
|
|
|
@@ -104,7 +120,7 @@ prop version u32 "PROBE_VERSION." {
|
|
|
104
120
|
}
|
|
105
121
|
```
|
|
106
122
|
|
|
107
|
-
<sub>`api.ogt` line
|
|
123
|
+
<sub>`api.ogt` line 13349</sub>
|
|
108
124
|
|
|
109
125
|
<a id="member-RuntimeProbe-tick"></a>
|
|
110
126
|
|
|
@@ -128,7 +144,7 @@ fn tick {
|
|
|
128
144
|
}
|
|
129
145
|
```
|
|
130
146
|
|
|
131
|
-
<sub>`api.ogt` line
|
|
147
|
+
<sub>`api.ogt` line 13352</sub>
|
|
132
148
|
|
|
133
149
|
<a id="member-RuntimeProbe-state"></a>
|
|
134
150
|
|
|
@@ -152,7 +168,7 @@ fn state {
|
|
|
152
168
|
}
|
|
153
169
|
```
|
|
154
170
|
|
|
155
|
-
<sub>`api.ogt` line
|
|
171
|
+
<sub>`api.ogt` line 13357</sub>
|
|
156
172
|
|
|
157
173
|
<a id="member-RuntimeProbe-advance"></a>
|
|
158
174
|
|
|
@@ -180,7 +196,7 @@ fn advance {
|
|
|
180
196
|
}
|
|
181
197
|
```
|
|
182
198
|
|
|
183
|
-
<sub>`api.ogt` line
|
|
199
|
+
<sub>`api.ogt` line 13362</sub>
|
|
184
200
|
|
|
185
201
|
<a id="member-RuntimeProbe-pause"></a>
|
|
186
202
|
|
|
@@ -203,7 +219,7 @@ fn pause {
|
|
|
203
219
|
}
|
|
204
220
|
```
|
|
205
221
|
|
|
206
|
-
<sub>`api.ogt` line
|
|
222
|
+
<sub>`api.ogt` line 13367</sub>
|
|
207
223
|
|
|
208
224
|
<a id="member-RuntimeProbe-resume"></a>
|
|
209
225
|
|
|
@@ -226,7 +242,7 @@ fn resume {
|
|
|
226
242
|
}
|
|
227
243
|
```
|
|
228
244
|
|
|
229
|
-
<sub>`api.ogt` line
|
|
245
|
+
<sub>`api.ogt` line 13371</sub>
|
|
230
246
|
|
|
231
247
|
<a id="member-RuntimeProbe-input"></a>
|
|
232
248
|
|
|
@@ -255,7 +271,7 @@ fn input {
|
|
|
255
271
|
}
|
|
256
272
|
```
|
|
257
273
|
|
|
258
|
-
<sub>`api.ogt` line
|
|
274
|
+
<sub>`api.ogt` line 13375</sub>
|
|
259
275
|
|
|
260
276
|
<a id="member-RuntimeProbe-accepted"></a>
|
|
261
277
|
|
|
@@ -278,7 +294,7 @@ fn accepted {
|
|
|
278
294
|
}
|
|
279
295
|
```
|
|
280
296
|
|
|
281
|
-
<sub>`api.ogt` line
|
|
297
|
+
<sub>`api.ogt` line 13381</sub>
|
|
282
298
|
|
|
283
299
|
<a id="member-RuntimeProbe-pick"></a>
|
|
284
300
|
|
|
@@ -309,7 +325,7 @@ fn pick {
|
|
|
309
325
|
}
|
|
310
326
|
```
|
|
311
327
|
|
|
312
|
-
<sub>`api.ogt` line
|
|
328
|
+
<sub>`api.ogt` line 13385</sub>
|
|
313
329
|
|
|
314
330
|
<a id="member-RuntimeProbe-entity"></a>
|
|
315
331
|
|
|
@@ -338,7 +354,7 @@ fn entity {
|
|
|
338
354
|
}
|
|
339
355
|
```
|
|
340
356
|
|
|
341
|
-
<sub>`api.ogt` line
|
|
357
|
+
<sub>`api.ogt` line 13392</sub>
|
|
342
358
|
|
|
343
359
|
<a id="member-RuntimeProbe-bounds"></a>
|
|
344
360
|
|
|
@@ -366,7 +382,7 @@ fn bounds {
|
|
|
366
382
|
}
|
|
367
383
|
```
|
|
368
384
|
|
|
369
|
-
<sub>`api.ogt` line
|
|
385
|
+
<sub>`api.ogt` line 13398</sub>
|
|
370
386
|
|
|
371
387
|
<a id="member-RuntimeProbe-patch"></a>
|
|
372
388
|
|
|
@@ -398,7 +414,7 @@ fn patch {
|
|
|
398
414
|
}
|
|
399
415
|
```
|
|
400
416
|
|
|
401
|
-
<sub>`api.ogt` line
|
|
417
|
+
<sub>`api.ogt` line 13403</sub>
|
|
402
418
|
|
|
403
419
|
<a id="member-RuntimeProbe-run"></a>
|
|
404
420
|
|
|
@@ -426,7 +442,7 @@ fn run {
|
|
|
426
442
|
}
|
|
427
443
|
```
|
|
428
444
|
|
|
429
|
-
<sub>`api.ogt` line
|
|
445
|
+
<sub>`api.ogt` line 13410</sub>
|
|
430
446
|
|
|
431
447
|
<a id="type-EngineProbe"></a>
|
|
432
448
|
|
|
@@ -444,7 +460,7 @@ interface EngineProbe {
|
|
|
444
460
|
# members follow, each quoted below
|
|
445
461
|
```
|
|
446
462
|
|
|
447
|
-
<sub>`api.ogt` line
|
|
463
|
+
<sub>`api.ogt` line 13417</sub>
|
|
448
464
|
|
|
449
465
|
<a id="member-EngineProbe-hello"></a>
|
|
450
466
|
|
|
@@ -468,7 +484,7 @@ fn hello {
|
|
|
468
484
|
}
|
|
469
485
|
```
|
|
470
486
|
|
|
471
|
-
<sub>`api.ogt` line
|
|
487
|
+
<sub>`api.ogt` line 13422</sub>
|
|
472
488
|
|
|
473
489
|
<a id="member-EngineProbe-capture"></a>
|
|
474
490
|
|
|
@@ -509,7 +525,7 @@ fn capture {
|
|
|
509
525
|
}
|
|
510
526
|
```
|
|
511
527
|
|
|
512
|
-
<sub>`api.ogt` line
|
|
528
|
+
<sub>`api.ogt` line 13427</sub>
|
|
513
529
|
|
|
514
530
|
<a id="member-EngineProbe-sweep"></a>
|
|
515
531
|
|
|
@@ -539,7 +555,7 @@ fn sweep {
|
|
|
539
555
|
}
|
|
540
556
|
```
|
|
541
557
|
|
|
542
|
-
<sub>`api.ogt` line
|
|
558
|
+
<sub>`api.ogt` line 13440</sub>
|
|
543
559
|
|
|
544
560
|
<a id="member-EngineProbe-reload"></a>
|
|
545
561
|
|
|
@@ -562,7 +578,7 @@ fn reload {
|
|
|
562
578
|
}
|
|
563
579
|
```
|
|
564
580
|
|
|
565
|
-
<sub>`api.ogt` line
|
|
581
|
+
<sub>`api.ogt` line 13447</sub>
|
|
566
582
|
|
|
567
583
|
<a id="member-EngineProbe-snapshot"></a>
|
|
568
584
|
|
|
@@ -585,7 +601,7 @@ fn snapshot {
|
|
|
585
601
|
}
|
|
586
602
|
```
|
|
587
603
|
|
|
588
|
-
<sub>`api.ogt` line
|
|
604
|
+
<sub>`api.ogt` line 13451</sub>
|
|
589
605
|
|
|
590
606
|
<a id="member-EngineProbe-restore"></a>
|
|
591
607
|
|
|
@@ -613,7 +629,7 @@ fn restore {
|
|
|
613
629
|
}
|
|
614
630
|
```
|
|
615
631
|
|
|
616
|
-
<sub>`api.ogt` line
|
|
632
|
+
<sub>`api.ogt` line 13455</sub>
|
|
617
633
|
|
|
618
634
|
<a id="member-EngineProbe-dump"></a>
|
|
619
635
|
|
|
@@ -643,7 +659,7 @@ fn dump {
|
|
|
643
659
|
}
|
|
644
660
|
```
|
|
645
661
|
|
|
646
|
-
<sub>`api.ogt` line
|
|
662
|
+
<sub>`api.ogt` line 13460</sub>
|
|
647
663
|
|
|
648
664
|
<a id="member-EngineProbe-commands"></a>
|
|
649
665
|
|
|
@@ -671,7 +687,7 @@ fn commands {
|
|
|
671
687
|
}
|
|
672
688
|
```
|
|
673
689
|
|
|
674
|
-
<sub>`api.ogt` line
|
|
690
|
+
<sub>`api.ogt` line 13467</sub>
|
|
675
691
|
|
|
676
692
|
<a id="member-EngineProbe-listen"></a>
|
|
677
693
|
|
|
@@ -701,7 +717,7 @@ fn listen {
|
|
|
701
717
|
}
|
|
702
718
|
```
|
|
703
719
|
|
|
704
|
-
<sub>`api.ogt` line
|
|
720
|
+
<sub>`api.ogt` line 13472</sub>
|
|
705
721
|
|
|
706
722
|
<a id="member-EngineProbe-memory"></a>
|
|
707
723
|
|
|
@@ -724,7 +740,115 @@ fn memory {
|
|
|
724
740
|
}
|
|
725
741
|
```
|
|
726
742
|
|
|
727
|
-
<sub>`api.ogt` line
|
|
743
|
+
<sub>`api.ogt` line 13479</sub>
|
|
744
|
+
|
|
745
|
+
<a id="member-EngineProbe-describe"></a>
|
|
746
|
+
|
|
747
|
+
#### `EngineProbe.describe`
|
|
748
|
+
|
|
749
|
+
The frame of the current tick as data: the visible entities with screen boxes, depth order and occlusion from the entity-id pass, their names, archetypes and labels; the UI elements with rects and text; the camera. Answers without a renderer too (the pass runs on the CPU).
|
|
750
|
+
|
|
751
|
+
```ts
|
|
752
|
+
EngineProbe.describe(): Description
|
|
753
|
+
```
|
|
754
|
+
|
|
755
|
+
**Returns** `Description`.
|
|
756
|
+
|
|
757
|
+
Binding symbol `og_engine_probe_describe` · publish builds: dropped
|
|
758
|
+
|
|
759
|
+
```ogt
|
|
760
|
+
fn describe {
|
|
761
|
+
doc "The frame of the current tick as data: the visible entities with screen boxes, depth order and occlusion from the entity-id pass, their names, archetypes and labels; the UI elements with rects and text; the camera. Answers without a renderer too (the pass runs on the CPU)."
|
|
762
|
+
returns Description
|
|
763
|
+
}
|
|
764
|
+
```
|
|
765
|
+
|
|
766
|
+
<sub>`api.ogt` line 13483</sub>
|
|
767
|
+
|
|
768
|
+
<a id="member-EngineProbe-expect"></a>
|
|
769
|
+
|
|
770
|
+
#### `EngineProbe.expect`
|
|
771
|
+
|
|
772
|
+
Evaluate one expectation now (the forms of the command channel's `expect:`); the result is also kept for expectations().
|
|
773
|
+
|
|
774
|
+
```ts
|
|
775
|
+
EngineProbe.expect(what: string): ExpectResult
|
|
776
|
+
```
|
|
777
|
+
|
|
778
|
+
| Parameter | Type | Optional | Doc |
|
|
779
|
+
|---|---|---|---|
|
|
780
|
+
| `what` | `string` | no | The expectation, such as `entity:crate:within:0,0.4,-1,1,0.6,1`. |
|
|
781
|
+
|
|
782
|
+
**Returns** `ExpectResult`: A malformed expectation is a malformed call.
|
|
783
|
+
|
|
784
|
+
Binding symbol `og_engine_probe_expect` · publish builds: dropped
|
|
785
|
+
|
|
786
|
+
```ogt
|
|
787
|
+
fn expect {
|
|
788
|
+
doc "Evaluate one expectation now (the forms of the command channel's `expect:`); the result is also kept for expectations()."
|
|
789
|
+
param what String "The expectation, such as `entity:crate:within:0,0.4,-1,1,0.6,1`."
|
|
790
|
+
returns ExpectResult "A malformed expectation is a malformed call."
|
|
791
|
+
}
|
|
792
|
+
```
|
|
793
|
+
|
|
794
|
+
<sub>`api.ogt` line 13487</sub>
|
|
795
|
+
|
|
796
|
+
<a id="member-EngineProbe-expectations"></a>
|
|
797
|
+
|
|
798
|
+
#### `EngineProbe.expectations`
|
|
799
|
+
|
|
800
|
+
Every expectation evaluated since the last call (scripts' `expect:` steps, programs, expect()), and the counts.
|
|
801
|
+
|
|
802
|
+
```ts
|
|
803
|
+
EngineProbe.expectations(): ExpectReport
|
|
804
|
+
```
|
|
805
|
+
|
|
806
|
+
**Returns** `ExpectReport`.
|
|
807
|
+
|
|
808
|
+
Binding symbol `og_engine_probe_expectations` · publish builds: dropped
|
|
809
|
+
|
|
810
|
+
```ogt
|
|
811
|
+
fn expectations {
|
|
812
|
+
doc "Every expectation evaluated since the last call (scripts' `expect:` steps, programs, expect()), and the counts."
|
|
813
|
+
returns ExpectReport
|
|
814
|
+
}
|
|
815
|
+
```
|
|
816
|
+
|
|
817
|
+
<sub>`api.ogt` line 13492</sub>
|
|
818
|
+
|
|
819
|
+
<a id="member-EngineProbe-saveScene"></a>
|
|
820
|
+
|
|
821
|
+
#### `EngineProbe.saveScene`
|
|
822
|
+
|
|
823
|
+
Write every scene the world was assembled from back from the world (the boot scene's and each og.world.instantiate made): its entities' and resources' changed field lines and the fields set and patch tuned, keeping every other line, comment and the order; with spawned, the entities the game spawned under the boot scene's marked section. The probe writes the files only with write; otherwise the texts are returned.
|
|
824
|
+
|
|
825
|
+
```ts
|
|
826
|
+
EngineProbe.saveScene(write?: boolean, spawned?: boolean): SavedScene | null
|
|
827
|
+
```
|
|
828
|
+
|
|
829
|
+
| Parameter | Type | Optional | Doc |
|
|
830
|
+
|---|---|---|---|
|
|
831
|
+
| `write` | `boolean` | yes | Replace each scene's source file. Default `false`. |
|
|
832
|
+
| `spawned` | `boolean` | yes | Write the entities the game spawned at run time under the boot scene's marked section. Default `false`. |
|
|
833
|
+
|
|
834
|
+
**Returns** `SavedScene | null`: Null without a scene to write back (the reason is in the log).
|
|
835
|
+
|
|
836
|
+
Binding symbol `og_engine_probe_save_scene` · publish builds: dropped
|
|
837
|
+
|
|
838
|
+
```ogt
|
|
839
|
+
fn saveScene {
|
|
840
|
+
doc "Write every scene the world was assembled from back from the world (the boot scene's and each og.world.instantiate made): its entities' and resources' changed field lines and the fields set and patch tuned, keeping every other line, comment and the order; with spawned, the entities the game spawned under the boot scene's marked section. The probe writes the files only with write; otherwise the texts are returned."
|
|
841
|
+
param write bool "Replace each scene's source file." {
|
|
842
|
+
default false
|
|
843
|
+
}
|
|
844
|
+
param spawned bool "Write the entities the game spawned at run time under the boot scene's marked section." {
|
|
845
|
+
default false
|
|
846
|
+
}
|
|
847
|
+
returns Option.SavedScene "Null without a scene to write back (the reason is in the log)."
|
|
848
|
+
}
|
|
849
|
+
```
|
|
850
|
+
|
|
851
|
+
<sub>`api.ogt` line 13496</sub>
|
|
728
852
|
|
|
729
853
|
## Types
|
|
730
854
|
|
|
@@ -749,7 +873,7 @@ struct PickResult {
|
|
|
749
873
|
}
|
|
750
874
|
```
|
|
751
875
|
|
|
752
|
-
<sub>`api.ogt` line
|
|
876
|
+
<sub>`api.ogt` line 12829</sub>
|
|
753
877
|
|
|
754
878
|
<a id="type-ProbeTunable"></a>
|
|
755
879
|
|
|
@@ -784,7 +908,7 @@ struct ProbeTunable {
|
|
|
784
908
|
}
|
|
785
909
|
```
|
|
786
910
|
|
|
787
|
-
<sub>`api.ogt` line
|
|
911
|
+
<sub>`api.ogt` line 12836</sub>
|
|
788
912
|
|
|
789
913
|
<a id="type-ProbeEntityRef"></a>
|
|
790
914
|
|
|
@@ -807,7 +931,7 @@ struct ProbeEntityRef {
|
|
|
807
931
|
}
|
|
808
932
|
```
|
|
809
933
|
|
|
810
|
-
<sub>`api.ogt` line
|
|
934
|
+
<sub>`api.ogt` line 12853</sub>
|
|
811
935
|
|
|
812
936
|
<a id="type-ProbeTimings"></a>
|
|
813
937
|
|
|
@@ -820,6 +944,10 @@ The fixed timings head of state().
|
|
|
820
944
|
| `step` | `number` | `0` | — | `ms` | — | Time the last tick took. |
|
|
821
945
|
| `render` | `number` | `0` | — | `ms` | — | Time the last frame's render took; 0 without a renderer. |
|
|
822
946
|
| `frameMs` | `number` | `0` | — | `ms` | — | step + render. |
|
|
947
|
+
| `systems` | `readonly ProbeTiming[]` | `[]` | — | — | — | The last tick's systems in run order, each with its milliseconds. |
|
|
948
|
+
| `passes` | `readonly ProbeTiming[]` | `[]` | — | — | — | The last rendered frame's render passes in the render graph's order, each with its milliseconds of CPU encoding (empty without a renderer). |
|
|
949
|
+
| `gpuPasses` | `readonly ProbeTiming[]` | `[]` | — | — | — | The render passes of the newest frame the GPU's timestamps were read back for (a frame or two behind `passes`), each with the GPU's milliseconds from the end of the pass before it to its own end; empty where the device has no timestamp queries (RenderCapabilities.gpuTimestamps) or without a renderer. |
|
|
950
|
+
| `triangles` | `number` | `0` | — | — | — | Triangles the last frame's main pass drew (after culling and level of detail); 0 without a renderer. |
|
|
823
951
|
|
|
824
952
|
```ogt
|
|
825
953
|
struct ProbeTimings {
|
|
@@ -833,10 +961,37 @@ struct ProbeTimings {
|
|
|
833
961
|
field frameMs f32 "step + render." {
|
|
834
962
|
unit ms
|
|
835
963
|
}
|
|
964
|
+
field systems List.ProbeTiming "The last tick's systems in run order, each with its milliseconds."
|
|
965
|
+
field passes List.ProbeTiming "The last rendered frame's render passes in the render graph's order, each with its milliseconds of CPU encoding (empty without a renderer)."
|
|
966
|
+
field gpuPasses List.ProbeTiming "The render passes of the newest frame the GPU's timestamps were read back for (a frame or two behind `passes`), each with the GPU's milliseconds from the end of the pass before it to its own end; empty where the device has no timestamp queries (RenderCapabilities.gpuTimestamps) or without a renderer."
|
|
967
|
+
field triangles u32 "Triangles the last frame's main pass drew (after culling and level of detail); 0 without a renderer."
|
|
968
|
+
}
|
|
969
|
+
```
|
|
970
|
+
|
|
971
|
+
<sub>`api.ogt` line 12861</sub>
|
|
972
|
+
|
|
973
|
+
<a id="type-ProbeTiming"></a>
|
|
974
|
+
|
|
975
|
+
### `ProbeTiming` (struct)
|
|
976
|
+
|
|
977
|
+
One named span of the last tick or frame.
|
|
978
|
+
|
|
979
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
980
|
+
|---|---|---|---|---|---|---|
|
|
981
|
+
| `name` | `string` | `""` | — | — | — | A system's name, or a render pass's (`Main`, `Cascade0`, `Bloom`). |
|
|
982
|
+
| `ms` | `number` | `0` | — | `ms` | — | Its time. |
|
|
983
|
+
|
|
984
|
+
```ogt
|
|
985
|
+
struct ProbeTiming {
|
|
986
|
+
doc "One named span of the last tick or frame."
|
|
987
|
+
field name String "A system's name, or a render pass's (`Main`, `Cascade0`, `Bloom`)."
|
|
988
|
+
field ms f32 "Its time." {
|
|
989
|
+
unit ms
|
|
990
|
+
}
|
|
836
991
|
}
|
|
837
992
|
```
|
|
838
993
|
|
|
839
|
-
<sub>`api.ogt` line
|
|
994
|
+
<sub>`api.ogt` line 12878</sub>
|
|
840
995
|
|
|
841
996
|
<a id="type-ProbeState"></a>
|
|
842
997
|
|
|
@@ -849,7 +1004,7 @@ The probe's state(): a fixed head, then the game's own facts.
|
|
|
849
1004
|
| `tick` | `number` | `0` | — | — | — | Fixed steps since load. |
|
|
850
1005
|
| `paused` | `boolean` | `false` | — | — | — | Whether the clock is held. |
|
|
851
1006
|
| `seed` | `number` | `0` | — | — | — | The seed the world was assembled from. |
|
|
852
|
-
| `timings` | `ProbeTimings` | `{ step: 0, render: 0, frameMs: 0 }` | — | — | — | The last tick's timings. |
|
|
1007
|
+
| `timings` | `ProbeTimings` | `{ step: 0, render: 0, frameMs: 0, systems: [], passes: [], gpuPasses: [], triangles: 0 }` | — | — | — | The last tick's timings. |
|
|
853
1008
|
| `entities` | `readonly ProbeEntityRef[]` | `[]` | — | — | — | The named entities. |
|
|
854
1009
|
| `facts` | `unknown` | `null` | — | — | — | What GameDesc.facts returned, or null. |
|
|
855
1010
|
|
|
@@ -865,7 +1020,7 @@ struct ProbeState {
|
|
|
865
1020
|
}
|
|
866
1021
|
```
|
|
867
1022
|
|
|
868
|
-
<sub>`api.ogt` line
|
|
1023
|
+
<sub>`api.ogt` line 12886</sub>
|
|
869
1024
|
|
|
870
1025
|
<a id="type-AdvanceOperation"></a>
|
|
871
1026
|
|
|
@@ -884,7 +1039,7 @@ struct AdvanceOperation {
|
|
|
884
1039
|
}
|
|
885
1040
|
```
|
|
886
1041
|
|
|
887
|
-
<sub>`api.ogt` line
|
|
1042
|
+
<sub>`api.ogt` line 12896</sub>
|
|
888
1043
|
|
|
889
1044
|
<a id="type-InputOperation"></a>
|
|
890
1045
|
|
|
@@ -903,7 +1058,7 @@ struct InputOperation {
|
|
|
903
1058
|
}
|
|
904
1059
|
```
|
|
905
1060
|
|
|
906
|
-
<sub>`api.ogt` line
|
|
1061
|
+
<sub>`api.ogt` line 12901</sub>
|
|
907
1062
|
|
|
908
1063
|
<a id="type-PickOperation"></a>
|
|
909
1064
|
|
|
@@ -924,7 +1079,7 @@ struct PickOperation {
|
|
|
924
1079
|
}
|
|
925
1080
|
```
|
|
926
1081
|
|
|
927
|
-
<sub>`api.ogt` line
|
|
1082
|
+
<sub>`api.ogt` line 12906</sub>
|
|
928
1083
|
|
|
929
1084
|
<a id="type-EntityOperation"></a>
|
|
930
1085
|
|
|
@@ -943,7 +1098,26 @@ struct EntityOperation {
|
|
|
943
1098
|
}
|
|
944
1099
|
```
|
|
945
1100
|
|
|
946
|
-
<sub>`api.ogt` line
|
|
1101
|
+
<sub>`api.ogt` line 12912</sub>
|
|
1102
|
+
|
|
1103
|
+
<a id="type-ExpectOperation"></a>
|
|
1104
|
+
|
|
1105
|
+
### `ExpectOperation` (struct)
|
|
1106
|
+
|
|
1107
|
+
The expect operation's payload.
|
|
1108
|
+
|
|
1109
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
1110
|
+
|---|---|---|---|---|---|---|
|
|
1111
|
+
| `what` | `string` | `""` | — | — | — | The expectation, as after `expect:` in a script, such as `state:started==true`. |
|
|
1112
|
+
|
|
1113
|
+
```ogt
|
|
1114
|
+
struct ExpectOperation {
|
|
1115
|
+
doc "The expect operation's payload."
|
|
1116
|
+
field what String "The expectation, as after `expect:` in a script, such as `state:started==true`."
|
|
1117
|
+
}
|
|
1118
|
+
```
|
|
1119
|
+
|
|
1120
|
+
<sub>`api.ogt` line 12917</sub>
|
|
947
1121
|
|
|
948
1122
|
<a id="type-ProbeOperation"></a>
|
|
949
1123
|
|
|
@@ -962,6 +1136,8 @@ Tagged by `op`.
|
|
|
962
1136
|
| `op: "read"` | — | Read the state; answers `{ tick, state }`. |
|
|
963
1137
|
| `op: "pick"` | [`PickOperation`](#type-PickOperation) | Pick a point; answers its result or null. |
|
|
964
1138
|
| `op: "entity"` | [`EntityOperation`](#type-EntityOperation) | Read an entity's parameters; null is a refusal. |
|
|
1139
|
+
| `op: "expect"` | [`ExpectOperation`](#type-ExpectOperation) | Evaluate an expectation; answers its ExpectResult, failed or not (a malformed one is a refusal). |
|
|
1140
|
+
| `op: "describe"` | — | Describe the frame; answers its Description. |
|
|
965
1141
|
|
|
966
1142
|
```ogt
|
|
967
1143
|
union ProbeOperation {
|
|
@@ -974,10 +1150,12 @@ union ProbeOperation {
|
|
|
974
1150
|
case read "Read the state; answers `{ tick, state }`."
|
|
975
1151
|
case pick PickOperation "Pick a point; answers its result or null."
|
|
976
1152
|
case entity EntityOperation "Read an entity's parameters; null is a refusal."
|
|
1153
|
+
case expect ExpectOperation "Evaluate an expectation; answers its ExpectResult, failed or not (a malformed one is a refusal)."
|
|
1154
|
+
case describe "Describe the frame; answers its Description."
|
|
977
1155
|
}
|
|
978
1156
|
```
|
|
979
1157
|
|
|
980
|
-
<sub>`api.ogt` line
|
|
1158
|
+
<sub>`api.ogt` line 12922</sub>
|
|
981
1159
|
|
|
982
1160
|
<a id="type-ProbeProgramResult"></a>
|
|
983
1161
|
|
|
@@ -1000,7 +1178,7 @@ struct ProbeProgramResult {
|
|
|
1000
1178
|
}
|
|
1001
1179
|
```
|
|
1002
1180
|
|
|
1003
|
-
<sub>`api.ogt` line
|
|
1181
|
+
<sub>`api.ogt` line 12936</sub>
|
|
1004
1182
|
|
|
1005
1183
|
<a id="type-Hello"></a>
|
|
1006
1184
|
|
|
@@ -1037,7 +1215,7 @@ struct Hello {
|
|
|
1037
1215
|
}
|
|
1038
1216
|
```
|
|
1039
1217
|
|
|
1040
|
-
<sub>`api.ogt` line
|
|
1218
|
+
<sub>`api.ogt` line 12943</sub>
|
|
1041
1219
|
|
|
1042
1220
|
<a id="type-BuildProfile"></a>
|
|
1043
1221
|
|
|
@@ -1062,7 +1240,7 @@ enum BuildProfile {
|
|
|
1062
1240
|
}
|
|
1063
1241
|
```
|
|
1064
1242
|
|
|
1065
|
-
<sub>`api.ogt` line
|
|
1243
|
+
<sub>`api.ogt` line 12958</sub>
|
|
1066
1244
|
|
|
1067
1245
|
<a id="type-Capture"></a>
|
|
1068
1246
|
|
|
@@ -1087,7 +1265,7 @@ struct Capture {
|
|
|
1087
1265
|
}
|
|
1088
1266
|
```
|
|
1089
1267
|
|
|
1090
|
-
<sub>`api.ogt` line
|
|
1268
|
+
<sub>`api.ogt` line 12965</sub>
|
|
1091
1269
|
|
|
1092
1270
|
<a id="type-Heard"></a>
|
|
1093
1271
|
|
|
@@ -1118,7 +1296,7 @@ struct Heard {
|
|
|
1118
1296
|
}
|
|
1119
1297
|
```
|
|
1120
1298
|
|
|
1121
|
-
<sub>`api.ogt` line
|
|
1299
|
+
<sub>`api.ogt` line 12973</sub>
|
|
1122
1300
|
|
|
1123
1301
|
<a id="type-ProbeHeap"></a>
|
|
1124
1302
|
|
|
@@ -1145,7 +1323,7 @@ struct ProbeHeap {
|
|
|
1145
1323
|
}
|
|
1146
1324
|
```
|
|
1147
1325
|
|
|
1148
|
-
<sub>`api.ogt` line
|
|
1326
|
+
<sub>`api.ogt` line 12985</sub>
|
|
1149
1327
|
|
|
1150
1328
|
<a id="type-ProbeWorldMemory"></a>
|
|
1151
1329
|
|
|
@@ -1164,7 +1342,7 @@ struct ProbeWorldMemory {
|
|
|
1164
1342
|
}
|
|
1165
1343
|
```
|
|
1166
1344
|
|
|
1167
|
-
<sub>`api.ogt` line
|
|
1345
|
+
<sub>`api.ogt` line 12996</sub>
|
|
1168
1346
|
|
|
1169
1347
|
<a id="type-ProbeStreamMemory"></a>
|
|
1170
1348
|
|
|
@@ -1193,7 +1371,7 @@ struct ProbeStreamMemory {
|
|
|
1193
1371
|
}
|
|
1194
1372
|
```
|
|
1195
1373
|
|
|
1196
|
-
<sub>`api.ogt` line
|
|
1374
|
+
<sub>`api.ogt` line 13001</sub>
|
|
1197
1375
|
|
|
1198
1376
|
<a id="type-ProbeMemory"></a>
|
|
1199
1377
|
|
|
@@ -1230,7 +1408,7 @@ struct ProbeMemory {
|
|
|
1230
1408
|
}
|
|
1231
1409
|
```
|
|
1232
1410
|
|
|
1233
|
-
<sub>`api.ogt` line
|
|
1411
|
+
<sub>`api.ogt` line 13014</sub>
|
|
1234
1412
|
|
|
1235
1413
|
<a id="type-SweepDesc"></a>
|
|
1236
1414
|
|
|
@@ -1262,7 +1440,7 @@ struct SweepDesc {
|
|
|
1262
1440
|
}
|
|
1263
1441
|
```
|
|
1264
1442
|
|
|
1265
|
-
<sub>`api.ogt` line
|
|
1443
|
+
<sub>`api.ogt` line 13031</sub>
|
|
1266
1444
|
|
|
1267
1445
|
<a id="type-SweepFrame"></a>
|
|
1268
1446
|
|
|
@@ -1285,7 +1463,7 @@ struct SweepFrame {
|
|
|
1285
1463
|
}
|
|
1286
1464
|
```
|
|
1287
1465
|
|
|
1288
|
-
<sub>`api.ogt` line
|
|
1466
|
+
<sub>`api.ogt` line 13042</sub>
|
|
1289
1467
|
|
|
1290
1468
|
<a id="type-SweepResult"></a>
|
|
1291
1469
|
|
|
@@ -1304,7 +1482,7 @@ struct SweepResult {
|
|
|
1304
1482
|
}
|
|
1305
1483
|
```
|
|
1306
1484
|
|
|
1307
|
-
<sub>`api.ogt` line
|
|
1485
|
+
<sub>`api.ogt` line 13049</sub>
|
|
1308
1486
|
|
|
1309
1487
|
<a id="type-ReloadReport"></a>
|
|
1310
1488
|
|
|
@@ -1333,7 +1511,7 @@ struct ReloadReport {
|
|
|
1333
1511
|
}
|
|
1334
1512
|
```
|
|
1335
1513
|
|
|
1336
|
-
<sub>`api.ogt` line
|
|
1514
|
+
<sub>`api.ogt` line 13054</sub>
|
|
1337
1515
|
|
|
1338
1516
|
<a id="type-SnapshotInfo"></a>
|
|
1339
1517
|
|
|
@@ -1360,7 +1538,7 @@ struct SnapshotInfo {
|
|
|
1360
1538
|
}
|
|
1361
1539
|
```
|
|
1362
1540
|
|
|
1363
|
-
<sub>`api.ogt` line
|
|
1541
|
+
<sub>`api.ogt` line 13065</sub>
|
|
1364
1542
|
|
|
1365
1543
|
<a id="type-DumpKind"></a>
|
|
1366
1544
|
|
|
@@ -1375,6 +1553,7 @@ A string: one of the variants below. The zero value is `"world"`.
|
|
|
1375
1553
|
| `"world"` | Archetype tables, systems and their matched counts. |
|
|
1376
1554
|
| `"entity"` | One entity's components and transform. |
|
|
1377
1555
|
| `"ui"` | The UI tree with bounds. |
|
|
1556
|
+
| `"desync"` | The first desync of a lockstep session (og.net): its tick, both hashes and the component-level diff of the two peers' snapshots. |
|
|
1378
1557
|
|
|
1379
1558
|
```ogt
|
|
1380
1559
|
enum DumpKind {
|
|
@@ -1382,10 +1561,11 @@ enum DumpKind {
|
|
|
1382
1561
|
variant world "Archetype tables, systems and their matched counts."
|
|
1383
1562
|
variant entity "One entity's components and transform."
|
|
1384
1563
|
variant ui "The UI tree with bounds."
|
|
1564
|
+
variant desync "The first desync of a lockstep session (og.net): its tick, both hashes and the component-level diff of the two peers' snapshots."
|
|
1385
1565
|
}
|
|
1386
1566
|
```
|
|
1387
1567
|
|
|
1388
|
-
<sub>`api.ogt` line
|
|
1568
|
+
<sub>`api.ogt` line 13075</sub>
|
|
1389
1569
|
|
|
1390
1570
|
<a id="type-DumpDesc"></a>
|
|
1391
1571
|
|
|
@@ -1409,7 +1589,7 @@ struct DumpDesc {
|
|
|
1409
1589
|
}
|
|
1410
1590
|
```
|
|
1411
1591
|
|
|
1412
|
-
<sub>`api.ogt` line
|
|
1592
|
+
<sub>`api.ogt` line 13083</sub>
|
|
1413
1593
|
|
|
1414
1594
|
<a id="type-ArchetypeDump"></a>
|
|
1415
1595
|
|
|
@@ -1430,7 +1610,7 @@ struct ArchetypeDump {
|
|
|
1430
1610
|
}
|
|
1431
1611
|
```
|
|
1432
1612
|
|
|
1433
|
-
<sub>`api.ogt` line
|
|
1613
|
+
<sub>`api.ogt` line 13090</sub>
|
|
1434
1614
|
|
|
1435
1615
|
<a id="type-SystemDump"></a>
|
|
1436
1616
|
|
|
@@ -1459,7 +1639,7 @@ struct SystemDump {
|
|
|
1459
1639
|
}
|
|
1460
1640
|
```
|
|
1461
1641
|
|
|
1462
|
-
<sub>`api.ogt` line
|
|
1642
|
+
<sub>`api.ogt` line 13096</sub>
|
|
1463
1643
|
|
|
1464
1644
|
<a id="type-WorldDump"></a>
|
|
1465
1645
|
|
|
@@ -1488,7 +1668,7 @@ struct WorldDump {
|
|
|
1488
1668
|
}
|
|
1489
1669
|
```
|
|
1490
1670
|
|
|
1491
|
-
<sub>`api.ogt` line
|
|
1671
|
+
<sub>`api.ogt` line 13107</sub>
|
|
1492
1672
|
|
|
1493
1673
|
<a id="type-EntityDump"></a>
|
|
1494
1674
|
|
|
@@ -1511,7 +1691,7 @@ struct EntityDump {
|
|
|
1511
1691
|
}
|
|
1512
1692
|
```
|
|
1513
1693
|
|
|
1514
|
-
<sub>`api.ogt` line
|
|
1694
|
+
<sub>`api.ogt` line 13117</sub>
|
|
1515
1695
|
|
|
1516
1696
|
<a id="type-UiElement"></a>
|
|
1517
1697
|
|
|
@@ -1531,6 +1711,7 @@ One UI element with its bounds.
|
|
|
1531
1711
|
| `name` | `string` | `""` | — | — | — | Its accessible name: its text, a name the widget gives it (an icon's name, a dialog's title, Decrease and Increase for a stepper's buttons), a control's own text gathered from its children, or else its id. |
|
|
1532
1712
|
| `value` | `string` | `""` | — | — | — | Its value as text: a slider's or stepper's number, a progress's or meter's amount, a field's text, a select's choice; empty for none. |
|
|
1533
1713
|
| `states` | `readonly string[]` | `[]` | — | — | — | Its states: disabled, focused, focusable (keys and pads reach it now, in this order), checked, selected, expanded, pressed, busy. |
|
|
1714
|
+
| `opaque` | `boolean` | `false` | — | — | — | It draws an opaque background over its whole box (its fill's alpha times its opacity is 1), hiding the scene under it. |
|
|
1534
1715
|
| `x` | `number` | `0` | — | `cssPx` | — | Left edge. |
|
|
1535
1716
|
| `y` | `number` | `0` | — | `cssPx` | — | Top edge. |
|
|
1536
1717
|
| `width` | `number` | `0` | — | `cssPx` | — | Width. |
|
|
@@ -1549,6 +1730,7 @@ struct UiElement {
|
|
|
1549
1730
|
field name String "Its accessible name: its text, a name the widget gives it (an icon's name, a dialog's title, Decrease and Increase for a stepper's buttons), a control's own text gathered from its children, or else its id."
|
|
1550
1731
|
field value String "Its value as text: a slider's or stepper's number, a progress's or meter's amount, a field's text, a select's choice; empty for none."
|
|
1551
1732
|
field states List.String "Its states: disabled, focused, focusable (keys and pads reach it now, in this order), checked, selected, expanded, pressed, busy."
|
|
1733
|
+
field opaque bool "It draws an opaque background over its whole box (its fill's alpha times its opacity is 1), hiding the scene under it."
|
|
1552
1734
|
field x f32 "Left edge." {
|
|
1553
1735
|
unit cssPx
|
|
1554
1736
|
}
|
|
@@ -1564,7 +1746,7 @@ struct UiElement {
|
|
|
1564
1746
|
}
|
|
1565
1747
|
```
|
|
1566
1748
|
|
|
1567
|
-
<sub>`api.ogt` line
|
|
1749
|
+
<sub>`api.ogt` line 13124</sub>
|
|
1568
1750
|
|
|
1569
1751
|
<a id="type-UiSurface"></a>
|
|
1570
1752
|
|
|
@@ -1593,7 +1775,7 @@ struct UiSurface {
|
|
|
1593
1775
|
}
|
|
1594
1776
|
```
|
|
1595
1777
|
|
|
1596
|
-
<sub>`api.ogt` line
|
|
1778
|
+
<sub>`api.ogt` line 13151</sub>
|
|
1597
1779
|
|
|
1598
1780
|
<a id="type-UiDump"></a>
|
|
1599
1781
|
|
|
@@ -1616,7 +1798,34 @@ struct UiDump {
|
|
|
1616
1798
|
}
|
|
1617
1799
|
```
|
|
1618
1800
|
|
|
1619
|
-
<sub>`api.ogt` line
|
|
1801
|
+
<sub>`api.ogt` line 13164</sub>
|
|
1802
|
+
|
|
1803
|
+
<a id="type-DesyncDump"></a>
|
|
1804
|
+
|
|
1805
|
+
### `DesyncDump` (struct)
|
|
1806
|
+
|
|
1807
|
+
The first desync of this peer's lockstep session (og.net), as `dump_desync` writes it.
|
|
1808
|
+
|
|
1809
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
1810
|
+
|---|---|---|---|---|---|---|
|
|
1811
|
+
| `desync` | `boolean` | `false` | — | — | — | Whether a desync happened; false lists the ticks compared with each peer so far. |
|
|
1812
|
+
| `tick` | `number \| null` | `null` | — | — | — | The first divergent tick: og.Time.tick of the two worlds that differ. |
|
|
1813
|
+
| `local` | `unknown` | `null` | — | — | — | This peer: `{ peer, player, hash }`. |
|
|
1814
|
+
| `remote` | `unknown` | `null` | — | — | — | The other peer: `{ peer, player, hash }`. |
|
|
1815
|
+
| `diff` | `unknown` | `null` | — | — | — | What differs: `{ components: [{ entity, component, fields: [{ field, local, remote }] }], entities: { onlyLocal, onlyRemote }, resources, events, blocks, allocator }`, in the local world's entity order (the first entry is the first difference in storage order); `{ pending }` until the other peer's snapshot arrived. |
|
|
1816
|
+
|
|
1817
|
+
```ogt
|
|
1818
|
+
struct DesyncDump {
|
|
1819
|
+
doc "The first desync of this peer's lockstep session (og.net), as `dump_desync` writes it."
|
|
1820
|
+
field desync bool "Whether a desync happened; false lists the ticks compared with each peer so far."
|
|
1821
|
+
field tick Option.u32 "The first divergent tick: og.Time.tick of the two worlds that differ."
|
|
1822
|
+
field local Json "This peer: `{ peer, player, hash }`."
|
|
1823
|
+
field remote Json "The other peer: `{ peer, player, hash }`."
|
|
1824
|
+
field diff Json "What differs: `{ components: [{ entity, component, fields: [{ field, local, remote }] }], entities: { onlyLocal, onlyRemote }, resources, events, blocks, allocator }`, in the local world's entity order (the first entry is the first difference in storage order); `{ pending }` until the other peer's snapshot arrived."
|
|
1825
|
+
}
|
|
1826
|
+
```
|
|
1827
|
+
|
|
1828
|
+
<sub>`api.ogt` line 13171</sub>
|
|
1620
1829
|
|
|
1621
1830
|
<a id="type-DumpResult"></a>
|
|
1622
1831
|
|
|
@@ -1631,6 +1840,7 @@ Tagged by `kind`.
|
|
|
1631
1840
|
| `kind: "world"` | [`WorldDump`](#type-WorldDump) | The world dump. |
|
|
1632
1841
|
| `kind: "entity"` | [`EntityDump`](#type-EntityDump) | An entity dump. |
|
|
1633
1842
|
| `kind: "ui"` | [`UiDump`](#type-UiDump) | The UI dump. |
|
|
1843
|
+
| `kind: "desync"` | [`DesyncDump`](#type-DesyncDump) | The desync dump. |
|
|
1634
1844
|
|
|
1635
1845
|
```ogt
|
|
1636
1846
|
union DumpResult {
|
|
@@ -1639,10 +1849,414 @@ union DumpResult {
|
|
|
1639
1849
|
case world WorldDump "The world dump."
|
|
1640
1850
|
case entity EntityDump "An entity dump."
|
|
1641
1851
|
case ui UiDump "The UI dump."
|
|
1852
|
+
case desync DesyncDump "The desync dump."
|
|
1853
|
+
}
|
|
1854
|
+
```
|
|
1855
|
+
|
|
1856
|
+
<sub>`api.ogt` line 13180</sub>
|
|
1857
|
+
|
|
1858
|
+
<a id="type-ScreenBox"></a>
|
|
1859
|
+
|
|
1860
|
+
### `ScreenBox` (struct)
|
|
1861
|
+
|
|
1862
|
+
A box on the play surface.
|
|
1863
|
+
|
|
1864
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
1865
|
+
|---|---|---|---|---|---|---|
|
|
1866
|
+
| `x` | `number` | `0` | — | `cssPx` | — | Left edge. |
|
|
1867
|
+
| `y` | `number` | `0` | — | `cssPx` | — | Top edge. |
|
|
1868
|
+
| `width` | `number` | `0` | — | `cssPx` | — | Width. |
|
|
1869
|
+
| `height` | `number` | `0` | — | `cssPx` | — | Height. |
|
|
1870
|
+
|
|
1871
|
+
```ogt
|
|
1872
|
+
struct ScreenBox {
|
|
1873
|
+
doc "A box on the play surface."
|
|
1874
|
+
field x f32 "Left edge." {
|
|
1875
|
+
unit cssPx
|
|
1876
|
+
}
|
|
1877
|
+
field y f32 "Top edge." {
|
|
1878
|
+
unit cssPx
|
|
1879
|
+
}
|
|
1880
|
+
field width f32 "Width." {
|
|
1881
|
+
unit cssPx
|
|
1882
|
+
}
|
|
1883
|
+
field height f32 "Height." {
|
|
1884
|
+
unit cssPx
|
|
1885
|
+
}
|
|
1886
|
+
}
|
|
1887
|
+
```
|
|
1888
|
+
|
|
1889
|
+
<sub>`api.ogt` line 13189</sub>
|
|
1890
|
+
|
|
1891
|
+
<a id="type-ScreenPoint"></a>
|
|
1892
|
+
|
|
1893
|
+
### `ScreenPoint` (struct)
|
|
1894
|
+
|
|
1895
|
+
A point on the play surface.
|
|
1896
|
+
|
|
1897
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
1898
|
+
|---|---|---|---|---|---|---|
|
|
1899
|
+
| `x` | `number` | `0` | — | `cssPx` | — | Horizontal position. |
|
|
1900
|
+
| `y` | `number` | `0` | — | `cssPx` | — | Vertical position. |
|
|
1901
|
+
|
|
1902
|
+
```ogt
|
|
1903
|
+
struct ScreenPoint {
|
|
1904
|
+
doc "A point on the play surface."
|
|
1905
|
+
field x f32 "Horizontal position." {
|
|
1906
|
+
unit cssPx
|
|
1907
|
+
}
|
|
1908
|
+
field y f32 "Vertical position." {
|
|
1909
|
+
unit cssPx
|
|
1910
|
+
}
|
|
1911
|
+
}
|
|
1912
|
+
```
|
|
1913
|
+
|
|
1914
|
+
<sub>`api.ogt` line 13205</sub>
|
|
1915
|
+
|
|
1916
|
+
<a id="type-DescribedEntity"></a>
|
|
1917
|
+
|
|
1918
|
+
### `DescribedEntity` (struct)
|
|
1919
|
+
|
|
1920
|
+
One entity the frame shows, from the entity-id pass (a CPU rasterisation of the frame's meshes, skinned meshes and world sprites at a quarter of its pixels).
|
|
1921
|
+
|
|
1922
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
1923
|
+
|---|---|---|---|---|---|---|
|
|
1924
|
+
| `id` | `string` | `""` | — | — | — | Its probe id. |
|
|
1925
|
+
| `name` | `string \| null` | `null` | — | — | — | Its name. |
|
|
1926
|
+
| `order` | `number` | `0` | — | — | — | Its depth order: 0 is the nearest. |
|
|
1927
|
+
| `archetype` | `readonly string[]` | `[]` | — | — | — | Its components, by name. |
|
|
1928
|
+
| `labels` | `readonly string[]` | `[]` | — | — | — | What draws it: `model` with its asset path, `mesh`, `skinned`, `sprite`. |
|
|
1929
|
+
| `box` | `ScreenBox` | `{ x: 0, y: 0, width: 0, height: 0 }` | — | — | — | The box of its visible pixels. |
|
|
1930
|
+
| `drawn` | `ScreenBox` | `{ x: 0, y: 0, width: 0, height: 0 }` | — | — | — | The box of what it covers with nothing in front of it. |
|
|
1931
|
+
| `point` | `ScreenPoint` | `{ x: 0, y: 0 }` | — | — | — | A visible point nearest the box's centre: pick answers this entity there. |
|
|
1932
|
+
| `depth` | `number` | `0` | — | `m` | — | From the camera to its nearest visible point, along the view. |
|
|
1933
|
+
| `coverage` | `number` | `0` | — | `ratio` | — | Its visible share of the surface. |
|
|
1934
|
+
| `occlusion` | `number` | `0` | — | `ratio` | — | The share of what it covers alone that something else hides: another object in front, or a UI element drawn opaque over it (DescribedUi.opaque); on a secondary camera's image, objects only. |
|
|
1935
|
+
| `views` | `readonly string[]` | `[]` | — | — | — | The probe ids of the og.CameraView and og.Mirror entities whose image also shows it, from their own id passes on their own layers; empty when only the main camera does (under DescribedView.entities it is empty). |
|
|
1936
|
+
|
|
1937
|
+
```ogt
|
|
1938
|
+
struct DescribedEntity {
|
|
1939
|
+
doc "One entity the frame shows, from the entity-id pass (a CPU rasterisation of the frame's meshes, skinned meshes and world sprites at a quarter of its pixels)."
|
|
1940
|
+
field id String "Its probe id."
|
|
1941
|
+
field name Option.String "Its name."
|
|
1942
|
+
field order u32 "Its depth order: 0 is the nearest."
|
|
1943
|
+
field archetype List.String "Its components, by name."
|
|
1944
|
+
field labels List.String "What draws it: `model` with its asset path, `mesh`, `skinned`, `sprite`."
|
|
1945
|
+
field box ScreenBox "The box of its visible pixels."
|
|
1946
|
+
field drawn ScreenBox "The box of what it covers with nothing in front of it."
|
|
1947
|
+
field point ScreenPoint "A visible point nearest the box's centre: pick answers this entity there."
|
|
1948
|
+
field depth f32 "From the camera to its nearest visible point, along the view." {
|
|
1949
|
+
unit m
|
|
1950
|
+
}
|
|
1951
|
+
field coverage f32 "Its visible share of the surface." {
|
|
1952
|
+
unit ratio
|
|
1953
|
+
}
|
|
1954
|
+
field occlusion f32 "The share of what it covers alone that something else hides: another object in front, or a UI element drawn opaque over it (DescribedUi.opaque); on a secondary camera's image, objects only." {
|
|
1955
|
+
unit ratio
|
|
1956
|
+
}
|
|
1957
|
+
field views List.String "The probe ids of the og.CameraView and og.Mirror entities whose image also shows it, from their own id passes on their own layers; empty when only the main camera does (under DescribedView.entities it is empty)."
|
|
1958
|
+
}
|
|
1959
|
+
```
|
|
1960
|
+
|
|
1961
|
+
<sub>`api.ogt` line 13215</sub>
|
|
1962
|
+
|
|
1963
|
+
<a id="type-DescribedView"></a>
|
|
1964
|
+
|
|
1965
|
+
### `DescribedView` (struct)
|
|
1966
|
+
|
|
1967
|
+
A secondary camera (og.CameraView, og.Mirror) and what its image shows: its own entity-id pass, from its eye and on its layers, at a quarter of its image's pixels, whatever its `every`. An entity only its layers admit (a layer the main camera leaves out) is listed here and not in Description.entities.
|
|
1968
|
+
|
|
1969
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
1970
|
+
|---|---|---|---|---|---|---|
|
|
1971
|
+
| `id` | `string` | `""` | — | — | — | The view entity's probe id. |
|
|
1972
|
+
| `name` | `string \| null` | `null` | — | — | — | Its name. |
|
|
1973
|
+
| `kind` | `string` | `""` | — | — | — | `camera` (og.CameraView) or `mirror` (og.Mirror). |
|
|
1974
|
+
| `size` | `PassSize` | `{ width: 0, height: 0 }` | — | — | — | The pixels its image covers: its render target's, or its viewport's rect of the frame. |
|
|
1975
|
+
| `entities` | `readonly DescribedEntity[]` | `[]` | — | — | — | What it shows, nearest its eye first, boxes and points in its image's pixels. |
|
|
1976
|
+
|
|
1977
|
+
```ogt
|
|
1978
|
+
struct DescribedView {
|
|
1979
|
+
doc "A secondary camera (og.CameraView, og.Mirror) and what its image shows: its own entity-id pass, from its eye and on its layers, at a quarter of its image's pixels, whatever its `every`. An entity only its layers admit (a layer the main camera leaves out) is listed here and not in Description.entities."
|
|
1980
|
+
field id String "The view entity's probe id."
|
|
1981
|
+
field name Option.String "Its name."
|
|
1982
|
+
field kind String "`camera` (og.CameraView) or `mirror` (og.Mirror)."
|
|
1983
|
+
field size PassSize "The pixels its image covers: its render target's, or its viewport's rect of the frame."
|
|
1984
|
+
field entities List.DescribedEntity "What it shows, nearest its eye first, boxes and points in its image's pixels."
|
|
1985
|
+
}
|
|
1986
|
+
```
|
|
1987
|
+
|
|
1988
|
+
<sub>`api.ogt` line 13237</sub>
|
|
1989
|
+
|
|
1990
|
+
<a id="type-DescribedUi"></a>
|
|
1991
|
+
|
|
1992
|
+
### `DescribedUi` (struct)
|
|
1993
|
+
|
|
1994
|
+
One UI element as describe lists it (the tree dump_ui writes).
|
|
1995
|
+
|
|
1996
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
1997
|
+
|---|---|---|---|---|---|---|
|
|
1998
|
+
| `id` | `string` | `""` | — | — | — | Its id. |
|
|
1999
|
+
| `parent` | `string` | `""` | — | — | — | Its parent's id. |
|
|
2000
|
+
| `kind` | `string` | `""` | — | — | — | What made it. |
|
|
2001
|
+
| `role` | `string` | `""` | — | — | — | Its accessibility role. |
|
|
2002
|
+
| `text` | `string` | `""` | — | — | — | The text it shows. |
|
|
2003
|
+
| `value` | `string` | `""` | — | — | — | Its value as text. |
|
|
2004
|
+
| `states` | `readonly string[]` | `[]` | — | — | — | Its states. |
|
|
2005
|
+
| `opaque` | `boolean` | `false` | — | — | — | It draws an opaque background over its whole box: the entities under it count it in their occlusion. |
|
|
2006
|
+
| `box` | `ScreenBox` | `{ x: 0, y: 0, width: 0, height: 0 }` | — | — | — | Its rect. |
|
|
2007
|
+
|
|
2008
|
+
```ogt
|
|
2009
|
+
struct DescribedUi {
|
|
2010
|
+
doc "One UI element as describe lists it (the tree dump_ui writes)."
|
|
2011
|
+
field id String "Its id."
|
|
2012
|
+
field parent String "Its parent's id."
|
|
2013
|
+
field kind String "What made it."
|
|
2014
|
+
field role String "Its accessibility role."
|
|
2015
|
+
field text String "The text it shows."
|
|
2016
|
+
field value String "Its value as text."
|
|
2017
|
+
field states List.String "Its states."
|
|
2018
|
+
field opaque bool "It draws an opaque background over its whole box: the entities under it count it in their occlusion."
|
|
2019
|
+
field box ScreenBox "Its rect."
|
|
2020
|
+
}
|
|
2021
|
+
```
|
|
2022
|
+
|
|
2023
|
+
<sub>`api.ogt` line 13246</sub>
|
|
2024
|
+
|
|
2025
|
+
<a id="type-DescribedCamera"></a>
|
|
2026
|
+
|
|
2027
|
+
### `DescribedCamera` (struct)
|
|
2028
|
+
|
|
2029
|
+
The camera as drawn, with its shake.
|
|
2030
|
+
|
|
2031
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
2032
|
+
|---|---|---|---|---|---|---|
|
|
2033
|
+
| `position` | `[number, number, number]` | `[0, 0, 0]` | — | — | — | Where it is. |
|
|
2034
|
+
| `target` | `[number, number, number]` | `[0, 0, 0]` | — | — | — | What it looks at. |
|
|
2035
|
+
| `up` | `[number, number, number]` | `[0, 0, 0]` | — | — | — | Its up. |
|
|
2036
|
+
| `projection` | `string` | `""` | — | — | — | `perspective` or `orthographic`. |
|
|
2037
|
+
| `fov` | `number \| null` | `null` | — | `deg` | — | The vertical field of view (perspective). |
|
|
2038
|
+
| `height` | `number \| null` | `null` | — | `m` | — | The height in view (orthographic). |
|
|
2039
|
+
| `near` | `number` | `0` | — | `m` | — | The near plane. |
|
|
2040
|
+
| `far` | `number` | `0` | — | `m` | — | The far plane. |
|
|
2041
|
+
|
|
2042
|
+
```ogt
|
|
2043
|
+
struct DescribedCamera {
|
|
2044
|
+
doc "The camera as drawn, with its shake."
|
|
2045
|
+
field position Array.f32.3 "Where it is."
|
|
2046
|
+
field target Array.f32.3 "What it looks at."
|
|
2047
|
+
field up Array.f32.3 "Its up."
|
|
2048
|
+
field projection String "`perspective` or `orthographic`."
|
|
2049
|
+
field fov Option.f32 "The vertical field of view (perspective)." {
|
|
2050
|
+
unit deg
|
|
2051
|
+
}
|
|
2052
|
+
field height Option.f32 "The height in view (orthographic)." {
|
|
2053
|
+
unit m
|
|
2054
|
+
}
|
|
2055
|
+
field near f32 "The near plane." {
|
|
2056
|
+
unit m
|
|
2057
|
+
}
|
|
2058
|
+
field far f32 "The far plane." {
|
|
2059
|
+
unit m
|
|
2060
|
+
}
|
|
2061
|
+
}
|
|
2062
|
+
```
|
|
2063
|
+
|
|
2064
|
+
<sub>`api.ogt` line 13259</sub>
|
|
2065
|
+
|
|
2066
|
+
<a id="type-PassSize"></a>
|
|
2067
|
+
|
|
2068
|
+
### `PassSize` (struct)
|
|
2069
|
+
|
|
2070
|
+
The entity-id pass's size.
|
|
2071
|
+
|
|
2072
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
2073
|
+
|---|---|---|---|---|---|---|
|
|
2074
|
+
| `width` | `number` | `0` | — | — | — | Width in pixels. |
|
|
2075
|
+
| `height` | `number` | `0` | — | — | — | Height in pixels. |
|
|
2076
|
+
|
|
2077
|
+
```ogt
|
|
2078
|
+
struct PassSize {
|
|
2079
|
+
doc "The entity-id pass's size."
|
|
2080
|
+
field width u32 "Width in pixels."
|
|
2081
|
+
field height u32 "Height in pixels."
|
|
2082
|
+
}
|
|
2083
|
+
```
|
|
2084
|
+
|
|
2085
|
+
<sub>`api.ogt` line 13279</sub>
|
|
2086
|
+
|
|
2087
|
+
<a id="type-Description"></a>
|
|
2088
|
+
|
|
2089
|
+
### `Description` (struct)
|
|
2090
|
+
|
|
2091
|
+
The frame as data: deterministic, the same JSON on every host and backend for the same world.
|
|
2092
|
+
|
|
2093
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
2094
|
+
|---|---|---|---|---|---|---|
|
|
2095
|
+
| `tick` | `number` | `0` | — | — | — | The tick. |
|
|
2096
|
+
| `surface` | `UiSurface \| null` | `null` | — | — | — | The play surface. |
|
|
2097
|
+
| `pass` | `PassSize \| null` | `null` | — | — | — | The entity-id pass; null without a scene. |
|
|
2098
|
+
| `camera` | `DescribedCamera \| null` | `null` | — | — | — | The camera; null without a scene. |
|
|
2099
|
+
| `entities` | `readonly DescribedEntity[]` | `[]` | — | — | — | The entities the main camera shows, nearest first (each names the views that also show it). |
|
|
2100
|
+
| `views` | `readonly DescribedView[]` | `[]` | — | — | — | The secondary cameras the frame draws, in its view order, each with what it shows. |
|
|
2101
|
+
| `ui` | `readonly DescribedUi[]` | `[]` | — | — | — | The UI elements in draw order. |
|
|
2102
|
+
|
|
2103
|
+
```ogt
|
|
2104
|
+
struct Description {
|
|
2105
|
+
doc "The frame as data: deterministic, the same JSON on every host and backend for the same world."
|
|
2106
|
+
field tick u32 "The tick."
|
|
2107
|
+
field surface Option.UiSurface "The play surface."
|
|
2108
|
+
field pass Option.PassSize "The entity-id pass; null without a scene."
|
|
2109
|
+
field camera Option.DescribedCamera "The camera; null without a scene."
|
|
2110
|
+
field entities List.DescribedEntity "The entities the main camera shows, nearest first (each names the views that also show it)."
|
|
2111
|
+
field views List.DescribedView "The secondary cameras the frame draws, in its view order, each with what it shows."
|
|
2112
|
+
field ui List.DescribedUi "The UI elements in draw order."
|
|
2113
|
+
}
|
|
2114
|
+
```
|
|
2115
|
+
|
|
2116
|
+
<sub>`api.ogt` line 13285</sub>
|
|
2117
|
+
|
|
2118
|
+
<a id="type-ExpectStatus"></a>
|
|
2119
|
+
|
|
2120
|
+
### `ExpectStatus` (enum)
|
|
2121
|
+
|
|
2122
|
+
How an expectation came out.
|
|
2123
|
+
|
|
2124
|
+
A string: one of the variants below. The zero value is `"pass"`.
|
|
2125
|
+
|
|
2126
|
+
| Variant | Doc |
|
|
2127
|
+
|---|---|
|
|
2128
|
+
| `"pass"` | It held. |
|
|
2129
|
+
| `"fail"` | It did not: the result carries the tick and the observed value. |
|
|
2130
|
+
| `"unchecked"` | It reads a frame and the host has no renderer. |
|
|
2131
|
+
|
|
2132
|
+
```ogt
|
|
2133
|
+
enum ExpectStatus {
|
|
2134
|
+
doc "How an expectation came out."
|
|
2135
|
+
variant pass "It held."
|
|
2136
|
+
variant fail "It did not: the result carries the tick and the observed value."
|
|
2137
|
+
variant unchecked "It reads a frame and the host has no renderer."
|
|
2138
|
+
}
|
|
2139
|
+
```
|
|
2140
|
+
|
|
2141
|
+
<sub>`api.ogt` line 13296</sub>
|
|
2142
|
+
|
|
2143
|
+
<a id="type-ExpectResult"></a>
|
|
2144
|
+
|
|
2145
|
+
### `ExpectResult` (struct)
|
|
2146
|
+
|
|
2147
|
+
One evaluated expectation.
|
|
2148
|
+
|
|
2149
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
2150
|
+
|---|---|---|---|---|---|---|
|
|
2151
|
+
| `tick` | `number` | `0` | — | — | — | The tick it was evaluated at. |
|
|
2152
|
+
| `at` | `number \| null` | `null` | — | `s` | — | The script step's time, when a script ran it. |
|
|
2153
|
+
| `expect` | `string` | `""` | — | — | — | As written after `expect:`. |
|
|
2154
|
+
| `kind` | `string` | `""` | — | — | — | `entity`, `event`, `ui`, `region`, `frame` or `state`. |
|
|
2155
|
+
| `status` | `ExpectStatus` | `"pass"` | — | — | — | The outcome. |
|
|
2156
|
+
| `expected` | `unknown` | `null` | — | — | — | What was expected. |
|
|
2157
|
+
| `observed` | `unknown` | `null` | — | — | — | What was there. |
|
|
2158
|
+
| `reason` | `string` | `""` | — | — | — | Why it failed or was unchecked; empty on a pass. |
|
|
2159
|
+
|
|
2160
|
+
```ogt
|
|
2161
|
+
struct ExpectResult {
|
|
2162
|
+
doc "One evaluated expectation."
|
|
2163
|
+
field tick u32 "The tick it was evaluated at."
|
|
2164
|
+
field at Option.f32 "The script step's time, when a script ran it." {
|
|
2165
|
+
unit s
|
|
2166
|
+
}
|
|
2167
|
+
field expect String "As written after `expect:`."
|
|
2168
|
+
field kind String "`entity`, `event`, `ui`, `region`, `frame` or `state`."
|
|
2169
|
+
field status ExpectStatus "The outcome."
|
|
2170
|
+
field expected Json "What was expected."
|
|
2171
|
+
field observed Json "What was there."
|
|
2172
|
+
field reason String "Why it failed or was unchecked; empty on a pass."
|
|
2173
|
+
}
|
|
2174
|
+
```
|
|
2175
|
+
|
|
2176
|
+
<sub>`api.ogt` line 13303</sub>
|
|
2177
|
+
|
|
2178
|
+
<a id="type-ExpectReport"></a>
|
|
2179
|
+
|
|
2180
|
+
### `ExpectReport` (struct)
|
|
2181
|
+
|
|
2182
|
+
The expectations evaluated since the last call.
|
|
2183
|
+
|
|
2184
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
2185
|
+
|---|---|---|---|---|---|---|
|
|
2186
|
+
| `passed` | `number` | `0` | — | — | — | Those that held. |
|
|
2187
|
+
| `failed` | `number` | `0` | — | — | — | Those that did not. |
|
|
2188
|
+
| `unchecked` | `number` | `0` | — | — | — | Those that needed a renderer. |
|
|
2189
|
+
| `results` | `readonly ExpectResult[]` | `[]` | — | — | — | Each, in order. |
|
|
2190
|
+
|
|
2191
|
+
```ogt
|
|
2192
|
+
struct ExpectReport {
|
|
2193
|
+
doc "The expectations evaluated since the last call."
|
|
2194
|
+
field passed u32 "Those that held."
|
|
2195
|
+
field failed u32 "Those that did not."
|
|
2196
|
+
field unchecked u32 "Those that needed a renderer."
|
|
2197
|
+
field results List.ExpectResult "Each, in order."
|
|
2198
|
+
}
|
|
2199
|
+
```
|
|
2200
|
+
|
|
2201
|
+
<sub>`api.ogt` line 13317</sub>
|
|
2202
|
+
|
|
2203
|
+
<a id="type-SavedScene"></a>
|
|
2204
|
+
|
|
2205
|
+
### `SavedScene` (struct)
|
|
2206
|
+
|
|
2207
|
+
The scenes written back from the world: the head is the boot scene's (or the first instantiated one's), `scenes` lists every one.
|
|
2208
|
+
|
|
2209
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
2210
|
+
|---|---|---|---|---|---|---|
|
|
2211
|
+
| `tick` | `number` | `0` | — | — | — | The tick of the world it was written from. |
|
|
2212
|
+
| `source` | `string` | `""` | — | — | — | The first scene's source, project-relative. |
|
|
2213
|
+
| `written` | `string` | `""` | — | — | — | Where it was written; empty when only returned. |
|
|
2214
|
+
| `lines` | `readonly number[]` | `[]` | — | — | — | The 1-based lines of the first scene's new text that changed or were added. |
|
|
2215
|
+
| `skipped` | `readonly string[]` | `[]` | — | — | — | Tuned fields that were not written, each with its reason: an entity no scene made (without `spawned`), a resource no scene sets where no boot scene takes it. |
|
|
2216
|
+
| `text` | `string` | `""` | — | — | — | The first scene's new text. |
|
|
2217
|
+
| `spawned` | `number` | `0` | — | — | — | Entities written under the boot scene's spawned section (0 without `spawned`). |
|
|
2218
|
+
| `scenes` | `readonly SavedSceneFile[]` | `[]` | — | — | — | Every scene written back: the boot scene's first, then each og.world.instantiate made, once each. |
|
|
2219
|
+
|
|
2220
|
+
```ogt
|
|
2221
|
+
struct SavedScene {
|
|
2222
|
+
doc "The scenes written back from the world: the head is the boot scene's (or the first instantiated one's), `scenes` lists every one."
|
|
2223
|
+
field tick u32 "The tick of the world it was written from."
|
|
2224
|
+
field source String "The first scene's source, project-relative."
|
|
2225
|
+
field written String "Where it was written; empty when only returned."
|
|
2226
|
+
field lines List.u32 "The 1-based lines of the first scene's new text that changed or were added."
|
|
2227
|
+
field skipped List.String "Tuned fields that were not written, each with its reason: an entity no scene made (without `spawned`), a resource no scene sets where no boot scene takes it."
|
|
2228
|
+
field text String "The first scene's new text."
|
|
2229
|
+
field spawned u32 "Entities written under the boot scene's spawned section (0 without `spawned`)."
|
|
2230
|
+
field scenes List.SavedSceneFile "Every scene written back: the boot scene's first, then each og.world.instantiate made, once each."
|
|
2231
|
+
}
|
|
2232
|
+
```
|
|
2233
|
+
|
|
2234
|
+
<sub>`api.ogt` line 13325</sub>
|
|
2235
|
+
|
|
2236
|
+
<a id="type-SavedSceneFile"></a>
|
|
2237
|
+
|
|
2238
|
+
### `SavedSceneFile` (struct)
|
|
2239
|
+
|
|
2240
|
+
One scene file written back.
|
|
2241
|
+
|
|
2242
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
2243
|
+
|---|---|---|---|---|---|---|
|
|
2244
|
+
| `source` | `string` | `""` | — | — | — | Its source, project-relative. |
|
|
2245
|
+
| `written` | `string` | `""` | — | — | — | Where it was written; empty when only returned. |
|
|
2246
|
+
| `lines` | `readonly number[]` | `[]` | — | — | — | The 1-based lines of its new text that changed or were added. |
|
|
2247
|
+
| `text` | `string` | `""` | — | — | — | Its new text. |
|
|
2248
|
+
|
|
2249
|
+
```ogt
|
|
2250
|
+
struct SavedSceneFile {
|
|
2251
|
+
doc "One scene file written back."
|
|
2252
|
+
field source String "Its source, project-relative."
|
|
2253
|
+
field written String "Where it was written; empty when only returned."
|
|
2254
|
+
field lines List.u32 "The 1-based lines of its new text that changed or were added."
|
|
2255
|
+
field text String "Its new text."
|
|
1642
2256
|
}
|
|
1643
2257
|
```
|
|
1644
2258
|
|
|
1645
|
-
<sub>`api.ogt` line
|
|
2259
|
+
<sub>`api.ogt` line 13337</sub>
|
|
1646
2260
|
|
|
1647
2261
|
## Constants
|
|
1648
2262
|
|
|
@@ -1659,34 +2273,34 @@ union DumpResult {
|
|
|
1659
2273
|
const PROBE_GLOBAL String "__runtime_probe__" "The global the page publishes the probe on."
|
|
1660
2274
|
```
|
|
1661
2275
|
|
|
1662
|
-
<sub>`api.ogt` line
|
|
2276
|
+
<sub>`api.ogt` line 12822</sub>
|
|
1663
2277
|
|
|
1664
2278
|
```ogt
|
|
1665
2279
|
const PROBE_VERSION u32 5 "The RuntimeProbe contract revision both sides speak."
|
|
1666
2280
|
```
|
|
1667
2281
|
|
|
1668
|
-
<sub>`api.ogt` line
|
|
2282
|
+
<sub>`api.ogt` line 12823</sub>
|
|
1669
2283
|
|
|
1670
2284
|
```ogt
|
|
1671
2285
|
const PROBE_WIRE_VERSION u32 1 "The wire revision hello reports."
|
|
1672
2286
|
```
|
|
1673
2287
|
|
|
1674
|
-
<sub>`api.ogt` line
|
|
2288
|
+
<sub>`api.ogt` line 12824</sub>
|
|
1675
2289
|
|
|
1676
2290
|
```ogt
|
|
1677
2291
|
const REPLAY_SEED_PARAM String "replay-seed" "The page query parameter that starts a deterministic replay from a uint32 seed."
|
|
1678
2292
|
```
|
|
1679
2293
|
|
|
1680
|
-
<sub>`api.ogt` line
|
|
2294
|
+
<sub>`api.ogt` line 12825</sub>
|
|
1681
2295
|
|
|
1682
2296
|
```ogt
|
|
1683
2297
|
const PLAYTEST_MAX_TICKS u32 3600 "The longest playtest one request may advance, in fixed steps."
|
|
1684
2298
|
```
|
|
1685
2299
|
|
|
1686
|
-
<sub>`api.ogt` line
|
|
2300
|
+
<sub>`api.ogt` line 12826</sub>
|
|
1687
2301
|
|
|
1688
2302
|
```ogt
|
|
1689
2303
|
const PROBE_PROGRAM_MAX_OPERATIONS u32 256 "The most operations one probe program may carry."
|
|
1690
2304
|
```
|
|
1691
2305
|
|
|
1692
|
-
<sub>`api.ogt` line
|
|
2306
|
+
<sub>`api.ogt` line 12827</sub>
|