@origingame/engine 0.0.0-stage → 0.1.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 +25 -0
- package/dist/web/origin-engine.d.ts +1233 -0
- package/dist/web/origin-engine.js +8628 -0
- package/dist/web/origin-engine_bg.wasm +0 -0
- package/dist/web/origin-engine_bg.wasm.d.ts +366 -0
- package/dist/web-publish/origin-engine-lanes.js +8509 -0
- package/dist/web-publish/origin-engine-lanes_bg.wasm +0 -0
- package/dist/web-publish/origin-engine.d.ts +1176 -0
- package/dist/web-publish/origin-engine.js +8313 -0
- package/dist/web-publish/origin-engine_bg.wasm +0 -0
- package/dist/web-publish/origin-engine_bg.wasm.d.ts +347 -0
- package/dist/web-publish/snippets/wasm-bindgen-rayon-38edf6e439f6d70d/src/workerHelpers.no-bundler.js +77 -0
- package/dist/web-publish-2d/origin-engine-lanes.js +8509 -0
- package/dist/web-publish-2d/origin-engine-lanes_bg.wasm +0 -0
- package/dist/web-publish-2d/origin-engine.d.ts +1176 -0
- package/dist/web-publish-2d/origin-engine.js +8313 -0
- package/dist/web-publish-2d/origin-engine_bg.wasm +0 -0
- package/dist/web-publish-2d/origin-engine_bg.wasm.d.ts +347 -0
- package/dist/web-publish-2d/snippets/wasm-bindgen-rayon-38edf6e439f6d70d/src/workerHelpers.no-bundler.js +77 -0
- package/knowledge/README.md +31 -0
- package/knowledge/knowledge.json +13 -0
- package/knowledge/looks/catalogue.json +1871 -0
- package/knowledge/package.json +33 -0
- package/knowledge/rules/platform.json +329 -0
- package/knowledge/scaffold/README.md +27 -0
- package/knowledge/scaffold/distribution.json +48 -0
- package/knowledge/scaffold/origin-engine.json +19 -0
- package/knowledge/scaffold/template/.origin/setup +14 -0
- package/knowledge/scaffold/template/LICENSES.md +23 -0
- package/knowledge/scaffold/template/README.md +37 -0
- package/knowledge/scaffold/template/assets/ai/guard.ogt +48 -0
- package/knowledge/scaffold/template/assets/audio/click.ogt +9 -0
- package/knowledge/scaffold/template/assets/fonts/NotoSansSC-Regular-subset.ttf.ogt +12 -0
- package/knowledge/scaffold/template/assets/fonts/OFL.txt +93 -0
- package/knowledge/scaffold/template/assets/looks/origin-game.ogt +12 -0
- package/knowledge/scaffold/template/assets/nav/yard.ogt +27 -0
- package/knowledge/scaffold/template/assets/scenes/main.ogt +34 -0
- package/knowledge/scaffold/template/assets/strings/en.ogt +14 -0
- package/knowledge/scaffold/template/assets/textures/stone_n.png.ogt +7 -0
- package/knowledge/scaffold/template/gitattributes +22 -0
- package/knowledge/scaffold/template/package.json +18 -0
- package/knowledge/scaffold/template/project.ogt +25 -0
- package/knowledge/scaffold/template/src/main.ts +246 -0
- package/knowledge/scaffold/template/tests/guard.og.ts +67 -0
- package/knowledge/scaffold/template/tests/smoke.og.ts +43 -0
- package/knowledge/scaffold/template/tsconfig.json +17 -0
- package/knowledge/scripts/lib.ts +203 -0
- package/knowledge/scripts/mount.ts +210 -0
- package/knowledge/scripts/pack.ts +24 -0
- package/knowledge/scripts/scaffold.ts +72 -0
- package/knowledge/scripts/validate.ts +749 -0
- package/knowledge/skills/og-ai/SKILL.md +386 -0
- package/knowledge/skills/og-audio/SKILL.md +191 -0
- package/knowledge/skills/og-build/SKILL.md +330 -0
- package/knowledge/skills/og-core/SKILL.md +285 -0
- package/knowledge/skills/og-feel/SKILL.md +385 -0
- package/knowledge/skills/og-game/SKILL.md +1479 -0
- package/knowledge/skills/og-i18n/SKILL.md +220 -0
- package/knowledge/skills/og-platform-sdk/SKILL.md +199 -0
- package/knowledge/skills/og-taste/SKILL.md +537 -0
- package/knowledge/skills/og-ui/SKILL.md +444 -0
- package/knowledge/wiki/ai.md +627 -0
- package/knowledge/wiki/anim.md +1187 -0
- package/knowledge/wiki/atmosphere.md +636 -0
- package/knowledge/wiki/audio.md +732 -0
- package/knowledge/wiki/camera.md +711 -0
- package/knowledge/wiki/commands.md +357 -0
- package/knowledge/wiki/game.md +220 -0
- package/knowledge/wiki/i18n.md +213 -0
- package/knowledge/wiki/index.md +1027 -0
- package/knowledge/wiki/input.md +1714 -0
- package/knowledge/wiki/load.md +1280 -0
- package/knowledge/wiki/math.md +166 -0
- package/knowledge/wiki/nav.md +1154 -0
- package/knowledge/wiki/physics.md +3142 -0
- package/knowledge/wiki/platform.md +857 -0
- package/knowledge/wiki/probe.md +1692 -0
- package/knowledge/wiki/reflect.md +285 -0
- package/knowledge/wiki/render.md +3511 -0
- package/knowledge/wiki/rng.md +393 -0
- package/knowledge/wiki/stream.md +376 -0
- package/knowledge/wiki/system.md +197 -0
- package/knowledge/wiki/systems.md +43 -0
- package/knowledge/wiki/terrain.md +727 -0
- package/knowledge/wiki/tilemap.md +422 -0
- package/knowledge/wiki/time.md +150 -0
- package/knowledge/wiki/transform.md +230 -0
- package/knowledge/wiki/tween.md +580 -0
- package/knowledge/wiki/ui.md +8000 -0
- package/knowledge/wiki/world.md +909 -0
- package/package.json +68 -4
- package/schema/api.schema.json +29675 -0
- package/shell/README.md +22 -0
- package/shell/brand/README.md +23 -0
- package/shell/brand/icon-192.png +0 -0
- package/shell/brand/icon-512.png +0 -0
- package/shell/brand/mark-on-paper.svg +6 -0
- package/shell/brand/origin-mark.svg +5 -0
- package/shell/brand/origin-motion.css +251 -0
- package/shell/brand/tokens.css +20 -0
- package/shell/brand.ts +132 -0
- package/shell/page.ts +715 -0
- package/shell/platform.ts +203 -0
- package/shell/player.ts +238 -0
- package/shell/shell.css +185 -0
- package/shell/sw.ts +177 -0
- package/shell/transport.ts +515 -0
- package/shell/wire.ts +369 -0
- package/src/e6.ts +69 -0
- package/src/env.d.ts +100 -0
- package/src/generated/abi.ts +980 -0
- package/src/index.ts +193 -0
- package/src/node/audio.ts +86 -0
- package/src/node/build.ts +109 -0
- package/src/node/device.ts +981 -0
- package/src/node/doctor.ts +60 -0
- package/src/node/index.ts +102 -0
- package/src/node/platform.ts +24 -0
- package/src/node/playtest-run.ts +249 -0
- package/src/node/png.ts +130 -0
- package/src/node/polish.ts +976 -0
- package/src/node/run.ts +373 -0
- package/src/node/web-build.ts +808 -0
- package/src/p2.ts +35 -0
- package/src/platform-local.ts +211 -0
- package/src/playtest.ts +131 -0
- package/src/runtime.ts +1509 -0
- package/src/systems/cameras.ts +247 -0
- package/src/ui-kit/bind.ts +141 -0
- package/src/ui-kit/huds.ts +303 -0
- package/src/ui-kit/index.ts +36 -0
- package/src/ui-kit/menus.ts +187 -0
- package/src/ui-kit/settings.ts +131 -0
- package/src/ui-kit/store.ts +222 -0
- package/src/ui-kit/story.ts +89 -0
- package/src/ui-kit/util.ts +106 -0
- package/src/web/a11y.ts +429 -0
- package/src/web/audio-worklet.ts +193 -0
- package/src/web/audio.ts +307 -0
- package/src/web/basis.ts +239 -0
- package/src/web/gamepad.ts +123 -0
- package/src/web/host.ts +166 -0
- package/src/web/input.ts +237 -0
- package/src/web/lanes.ts +21 -0
- package/src/web/play.ts +20 -0
- package/src/web/rpc-ring.ts +110 -0
- package/src/web/settle.ts +122 -0
- package/src/web/shell.ts +643 -0
- package/src/web/text-input.ts +248 -0
- package/src/web/worker.ts +1002 -0
- package/types/bindings.json +13654 -0
- package/types/index.d.ts +20090 -0
- package/vendor/basis/LICENSE +201 -0
- package/vendor/basis/NOTICE +15 -0
- package/vendor/basis/README.md +18 -0
- package/vendor/basis/basis_transcoder.js +19 -0
- package/vendor/basis/basis_transcoder.wasm +0 -0
- package/README.md +0 -3
|
@@ -0,0 +1,1692 @@
|
|
|
1
|
+
<!-- Generated from crates/og-api/api.ogt by `og api gen`. Do not edit: `og api check` fails on any difference; change api.ogt and regenerate. -->
|
|
2
|
+
|
|
3
|
+
# The `probe` module
|
|
4
|
+
|
|
5
|
+
The probe: RuntimeProbe protocol 5 (origin/packages/contracts/src/probe.ts) served natively, plus the engine's wire members.
|
|
6
|
+
|
|
7
|
+
In a page it is published on globalThis.__runtime_probe__; on native, `og` serves it as JSON-RPC 2.0 over a loopback WebSocket at /probe.
|
|
8
|
+
|
|
9
|
+
A refusal is false or null exactly as protocol 5; a JSON-RPC error is only for a malformed call or an unknown method.
|
|
10
|
+
|
|
11
|
+
Probe entity ids are entity names; an unnamed entity is `#<index>.<generation>`.
|
|
12
|
+
|
|
13
|
+
- **TypeScript**: functions are none at module level (its members live on the types below); components, resources and events are tokens on `og`.
|
|
14
|
+
- **Publish builds**: kept (members may override).
|
|
15
|
+
- **Skill**: `og-build`, which teaches the module (how much of it to use, and how to prove it).
|
|
16
|
+
- **Index**: [every module and name](index.md).
|
|
17
|
+
|
|
18
|
+
```ogt
|
|
19
|
+
module probe {
|
|
20
|
+
# declarations follow, each quoted below
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
<sub>`api.ogt` line 10461</sub>
|
|
24
|
+
|
|
25
|
+
## Contents
|
|
26
|
+
|
|
27
|
+
| Name | Kind | Summary |
|
|
28
|
+
|---|---|---|
|
|
29
|
+
| [`PROBE_GLOBAL`](#const-PROBE_GLOBAL) | constant | The global the page publishes the probe on. |
|
|
30
|
+
| [`PROBE_VERSION`](#const-PROBE_VERSION) | constant | The RuntimeProbe contract revision both sides speak. |
|
|
31
|
+
| [`PROBE_WIRE_VERSION`](#const-PROBE_WIRE_VERSION) | constant | The wire revision hello reports. |
|
|
32
|
+
| [`REPLAY_SEED_PARAM`](#const-REPLAY_SEED_PARAM) | constant | The page query parameter that starts a deterministic replay from a uint32 seed. |
|
|
33
|
+
| [`PLAYTEST_MAX_TICKS`](#const-PLAYTEST_MAX_TICKS) | constant | The longest playtest one request may advance, in fixed steps. |
|
|
34
|
+
| [`PROBE_PROGRAM_MAX_OPERATIONS`](#const-PROBE_PROGRAM_MAX_OPERATIONS) | constant | The most operations one probe program may carry. |
|
|
35
|
+
| [`PickResult`](#type-PickResult) | struct | What a screen point resolved to. |
|
|
36
|
+
| [`ProbeTunable`](#type-ProbeTunable) | struct | One published tunable parameter and the range it means something over. |
|
|
37
|
+
| [`ProbeEntityRef`](#type-ProbeEntityRef) | struct | One entity the probe publishes in state(). |
|
|
38
|
+
| [`ProbeTimings`](#type-ProbeTimings) | struct | The fixed timings head of state(). |
|
|
39
|
+
| [`ProbeState`](#type-ProbeState) | struct | The probe's state(): a fixed head, then the game's own facts. |
|
|
40
|
+
| [`AdvanceOperation`](#type-AdvanceOperation) | struct | The advance operation's payload. |
|
|
41
|
+
| [`InputOperation`](#type-InputOperation) | struct | The input operation's payload. |
|
|
42
|
+
| [`PickOperation`](#type-PickOperation) | struct | The pick operation's payload. |
|
|
43
|
+
| [`EntityOperation`](#type-EntityOperation) | struct | The entity operation's payload. |
|
|
44
|
+
| [`ProbeOperation`](#type-ProbeOperation) | union | One operation of a probe program, which runs in one evaluation so a scripted segment costs one round trip. |
|
|
45
|
+
| [`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
|
+
| [`Hello`](#type-Hello) | struct | The wire's hello: who is speaking. |
|
|
47
|
+
| [`BuildProfile`](#type-BuildProfile) | enum | The build configuration; publish builds keep only the player-facing probe members. |
|
|
48
|
+
| [`Capture`](#type-Capture) | struct | A captured frame. |
|
|
49
|
+
| [`Heard`](#type-Heard) | struct | What the host's mixer rendered last: the audio up to the current tick. |
|
|
50
|
+
| [`ProbeHeap`](#type-ProbeHeap) | struct | The engine's allocator, counted (both hosts install a counting global allocator). |
|
|
51
|
+
| [`ProbeWorldMemory`](#type-ProbeWorldMemory) | struct | The world's size. |
|
|
52
|
+
| [`ProbeStreamMemory`](#type-ProbeStreamMemory) | struct | The streaming memory budget (og.stream.budget): what the admitted groups' assets take. |
|
|
53
|
+
| [`ProbeMemory`](#type-ProbeMemory) | struct | What the engine holds, in one shape on both hosts; a figure a host cannot read is null. A publish page, whose probe has no `memory`, answers the same from the engine Worker (`__runtime_probe__.memory()`, docs/web-export.md). |
|
|
54
|
+
| [`SweepDesc`](#type-SweepDesc) | desc struct | A parameter sweep: for each value, restore the snapshot taken at the call, patch, advance and capture. |
|
|
55
|
+
| [`SweepFrame`](#type-SweepFrame) | struct | One frame of a sweep. |
|
|
56
|
+
| [`SweepResult`](#type-SweepResult) | struct | A sweep's frames, one per value. |
|
|
57
|
+
| [`ReloadReport`](#type-ReloadReport) | struct | What a hot reload did. Components are re-registered by name and migrated field by field through the schema. |
|
|
58
|
+
| [`SnapshotInfo`](#type-SnapshotInfo) | struct | A snapshot of the whole world (components, resources, Rng states, pending events) kept in the running process. |
|
|
59
|
+
| [`DumpKind`](#type-DumpKind) | enum | What dump() reports. |
|
|
60
|
+
| [`DumpDesc`](#type-DumpDesc) | desc struct | What to dump. |
|
|
61
|
+
| [`ArchetypeDump`](#type-ArchetypeDump) | struct | One archetype table. |
|
|
62
|
+
| [`SystemDump`](#type-SystemDump) | struct | One system. The engine fills reads, writes and matched for every system the game declared; ms is null because the probe reads no clock (state().timings has the tick's time). |
|
|
63
|
+
| [`WorldDump`](#type-WorldDump) | struct | The world: tables, systems, resources. |
|
|
64
|
+
| [`EntityDump`](#type-EntityDump) | struct | One entity. |
|
|
65
|
+
| [`UiElement`](#type-UiElement) | struct | One UI element with its bounds. |
|
|
66
|
+
| [`UiSurface`](#type-UiSurface) | struct | The surface UI bounds are laid out on. |
|
|
67
|
+
| [`UiDump`](#type-UiDump) | struct | The UI tree, flattened in draw order. |
|
|
68
|
+
| [`DumpResult`](#type-DumpResult) | union | A dump, tagged by its kind. |
|
|
69
|
+
| [`RuntimeProbe`](#type-RuntimeProbe) | interface | RuntimeProbe protocol 5, member for member. Every member answers synchronously with JSON-serialisable values. |
|
|
70
|
+
| [`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
|
+
|
|
72
|
+
## Interfaces
|
|
73
|
+
|
|
74
|
+
<a id="type-RuntimeProbe"></a>
|
|
75
|
+
|
|
76
|
+
### `RuntimeProbe` (interface)
|
|
77
|
+
|
|
78
|
+
RuntimeProbe protocol 5, member for member. Every member answers synchronously with JSON-serialisable values.
|
|
79
|
+
|
|
80
|
+
```ogt
|
|
81
|
+
interface RuntimeProbe {
|
|
82
|
+
doc "RuntimeProbe protocol 5, member for member. Every member answers synchronously with JSON-serialisable values."
|
|
83
|
+
publish false
|
|
84
|
+
# members follow, each quoted below
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
<sub>`api.ogt` line 10804</sub>
|
|
88
|
+
|
|
89
|
+
<a id="member-RuntimeProbe-version"></a>
|
|
90
|
+
|
|
91
|
+
#### `RuntimeProbe.version` (property)
|
|
92
|
+
|
|
93
|
+
PROBE_VERSION.
|
|
94
|
+
|
|
95
|
+
```ts
|
|
96
|
+
readonly version: number
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Binding symbol `og_runtime_probe_get_version` · publish builds: kept
|
|
100
|
+
|
|
101
|
+
```ogt
|
|
102
|
+
prop version u32 "PROBE_VERSION." {
|
|
103
|
+
publish true
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
<sub>`api.ogt` line 10808</sub>
|
|
108
|
+
|
|
109
|
+
<a id="member-RuntimeProbe-tick"></a>
|
|
110
|
+
|
|
111
|
+
#### `RuntimeProbe.tick`
|
|
112
|
+
|
|
113
|
+
Fixed steps the world has taken since load.
|
|
114
|
+
|
|
115
|
+
```ts
|
|
116
|
+
RuntimeProbe.tick(): number
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**Returns** `number`.
|
|
120
|
+
|
|
121
|
+
Binding symbol `og_runtime_probe_tick` · publish builds: kept
|
|
122
|
+
|
|
123
|
+
```ogt
|
|
124
|
+
fn tick {
|
|
125
|
+
doc "Fixed steps the world has taken since load."
|
|
126
|
+
publish true
|
|
127
|
+
returns u32
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
<sub>`api.ogt` line 10811</sub>
|
|
132
|
+
|
|
133
|
+
<a id="member-RuntimeProbe-state"></a>
|
|
134
|
+
|
|
135
|
+
#### `RuntimeProbe.state`
|
|
136
|
+
|
|
137
|
+
A JSON snapshot: the fixed timings head, then the game's own facts.
|
|
138
|
+
|
|
139
|
+
```ts
|
|
140
|
+
RuntimeProbe.state(): ProbeState
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**Returns** `ProbeState`.
|
|
144
|
+
|
|
145
|
+
Binding symbol `og_runtime_probe_state` · publish builds: kept
|
|
146
|
+
|
|
147
|
+
```ogt
|
|
148
|
+
fn state {
|
|
149
|
+
doc "A JSON snapshot: the fixed timings head, then the game's own facts."
|
|
150
|
+
publish true
|
|
151
|
+
returns ProbeState
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
<sub>`api.ogt` line 10816</sub>
|
|
156
|
+
|
|
157
|
+
<a id="member-RuntimeProbe-advance"></a>
|
|
158
|
+
|
|
159
|
+
#### `RuntimeProbe.advance`
|
|
160
|
+
|
|
161
|
+
Take whole fixed steps regardless of the wall clock.
|
|
162
|
+
|
|
163
|
+
```ts
|
|
164
|
+
RuntimeProbe.advance(steps: number): number
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
| Parameter | Type | Optional | Doc |
|
|
168
|
+
|---|---|---|---|
|
|
169
|
+
| `steps` | `number` | no | Fixed steps, at most PLAYTEST_MAX_TICKS. |
|
|
170
|
+
|
|
171
|
+
**Returns** `number`: The tick after the steps.
|
|
172
|
+
|
|
173
|
+
Binding symbol `og_runtime_probe_advance` · publish builds: dropped
|
|
174
|
+
|
|
175
|
+
```ogt
|
|
176
|
+
fn advance {
|
|
177
|
+
doc "Take whole fixed steps regardless of the wall clock."
|
|
178
|
+
param steps u32 "Fixed steps, at most PLAYTEST_MAX_TICKS."
|
|
179
|
+
returns u32 "The tick after the steps."
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
<sub>`api.ogt` line 10821</sub>
|
|
184
|
+
|
|
185
|
+
<a id="member-RuntimeProbe-pause"></a>
|
|
186
|
+
|
|
187
|
+
#### `RuntimeProbe.pause`
|
|
188
|
+
|
|
189
|
+
Hold the wall-clock loop; advance still steps.
|
|
190
|
+
|
|
191
|
+
```ts
|
|
192
|
+
RuntimeProbe.pause(): boolean
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
**Returns** `boolean`.
|
|
196
|
+
|
|
197
|
+
Binding symbol `og_runtime_probe_pause` · publish builds: dropped
|
|
198
|
+
|
|
199
|
+
```ogt
|
|
200
|
+
fn pause {
|
|
201
|
+
doc "Hold the wall-clock loop; advance still steps."
|
|
202
|
+
returns bool
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
<sub>`api.ogt` line 10826</sub>
|
|
207
|
+
|
|
208
|
+
<a id="member-RuntimeProbe-resume"></a>
|
|
209
|
+
|
|
210
|
+
#### `RuntimeProbe.resume`
|
|
211
|
+
|
|
212
|
+
Release the wall-clock loop.
|
|
213
|
+
|
|
214
|
+
```ts
|
|
215
|
+
RuntimeProbe.resume(): boolean
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
**Returns** `boolean`.
|
|
219
|
+
|
|
220
|
+
Binding symbol `og_runtime_probe_resume` · publish builds: dropped
|
|
221
|
+
|
|
222
|
+
```ogt
|
|
223
|
+
fn resume {
|
|
224
|
+
doc "Release the wall-clock loop."
|
|
225
|
+
returns bool
|
|
226
|
+
}
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
<sub>`api.ogt` line 10830</sub>
|
|
230
|
+
|
|
231
|
+
<a id="member-RuntimeProbe-input"></a>
|
|
232
|
+
|
|
233
|
+
#### `RuntimeProbe.input`
|
|
234
|
+
|
|
235
|
+
One event through the input layer's own path.
|
|
236
|
+
|
|
237
|
+
```ts
|
|
238
|
+
RuntimeProbe.input(event: InjectedInput): boolean
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
| Parameter | Type | Optional | Doc |
|
|
242
|
+
|---|---|---|---|
|
|
243
|
+
| `event` | `InjectedInput` | no | The event. |
|
|
244
|
+
|
|
245
|
+
**Returns** `boolean`: False is a refusal.
|
|
246
|
+
|
|
247
|
+
Binding symbol `og_runtime_probe_input` · publish builds: kept
|
|
248
|
+
|
|
249
|
+
```ogt
|
|
250
|
+
fn input {
|
|
251
|
+
doc "One event through the input layer's own path."
|
|
252
|
+
publish true
|
|
253
|
+
param event InjectedInput "The event."
|
|
254
|
+
returns bool "False is a refusal."
|
|
255
|
+
}
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
<sub>`api.ogt` line 10834</sub>
|
|
259
|
+
|
|
260
|
+
<a id="member-RuntimeProbe-accepted"></a>
|
|
261
|
+
|
|
262
|
+
#### `RuntimeProbe.accepted`
|
|
263
|
+
|
|
264
|
+
Page events (keyboard, pointer, wheel) the input layer accepted since load.
|
|
265
|
+
|
|
266
|
+
```ts
|
|
267
|
+
RuntimeProbe.accepted(): number
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
**Returns** `number`.
|
|
271
|
+
|
|
272
|
+
Binding symbol `og_runtime_probe_accepted` · publish builds: dropped
|
|
273
|
+
|
|
274
|
+
```ogt
|
|
275
|
+
fn accepted {
|
|
276
|
+
doc "Page events (keyboard, pointer, wheel) the input layer accepted since load."
|
|
277
|
+
returns u32
|
|
278
|
+
}
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
<sub>`api.ogt` line 10840</sub>
|
|
282
|
+
|
|
283
|
+
<a id="member-RuntimeProbe-pick"></a>
|
|
284
|
+
|
|
285
|
+
#### `RuntimeProbe.pick`
|
|
286
|
+
|
|
287
|
+
What is under a point of the play surface.
|
|
288
|
+
|
|
289
|
+
```ts
|
|
290
|
+
RuntimeProbe.pick(x: number, y: number): PickResult | null
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
| Parameter | Type | Optional | Doc |
|
|
294
|
+
|---|---|---|---|
|
|
295
|
+
| `x` | `number` | no | Horizontal position in CSS pixels. |
|
|
296
|
+
| `y` | `number` | no | Vertical position in CSS pixels. |
|
|
297
|
+
|
|
298
|
+
**Returns** `PickResult | null`: Null when nothing is under the point.
|
|
299
|
+
|
|
300
|
+
Binding symbol `og_runtime_probe_pick` · publish builds: kept
|
|
301
|
+
|
|
302
|
+
```ogt
|
|
303
|
+
fn pick {
|
|
304
|
+
doc "What is under a point of the play surface."
|
|
305
|
+
publish true
|
|
306
|
+
param x f32 "Horizontal position in CSS pixels."
|
|
307
|
+
param y f32 "Vertical position in CSS pixels."
|
|
308
|
+
returns Option.PickResult "Null when nothing is under the point."
|
|
309
|
+
}
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
<sub>`api.ogt` line 10844</sub>
|
|
313
|
+
|
|
314
|
+
<a id="member-RuntimeProbe-entity"></a>
|
|
315
|
+
|
|
316
|
+
#### `RuntimeProbe.entity`
|
|
317
|
+
|
|
318
|
+
One entity's published parameters: its tunable fields as `Component.field` keys.
|
|
319
|
+
|
|
320
|
+
```ts
|
|
321
|
+
RuntimeProbe.entity(id: string): Readonly<Record<string, unknown>> | null
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
| Parameter | Type | Optional | Doc |
|
|
325
|
+
|---|---|---|---|
|
|
326
|
+
| `id` | `string` | no | The probe id. |
|
|
327
|
+
|
|
328
|
+
**Returns** `Readonly<Record<string, unknown>> | null`: Null for an unknown entity.
|
|
329
|
+
|
|
330
|
+
Binding symbol `og_runtime_probe_entity` · publish builds: kept
|
|
331
|
+
|
|
332
|
+
```ogt
|
|
333
|
+
fn entity {
|
|
334
|
+
doc "One entity's published parameters: its tunable fields as `Component.field` keys."
|
|
335
|
+
publish true
|
|
336
|
+
param id String "The probe id."
|
|
337
|
+
returns Option.Map.Json "Null for an unknown entity."
|
|
338
|
+
}
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
<sub>`api.ogt` line 10851</sub>
|
|
342
|
+
|
|
343
|
+
<a id="member-RuntimeProbe-bounds"></a>
|
|
344
|
+
|
|
345
|
+
#### `RuntimeProbe.bounds`
|
|
346
|
+
|
|
347
|
+
The ranges of one entity's tunable fields, from the schema.
|
|
348
|
+
|
|
349
|
+
```ts
|
|
350
|
+
RuntimeProbe.bounds(id: string): Readonly<Record<string, ProbeTunable>> | null
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
| Parameter | Type | Optional | Doc |
|
|
354
|
+
|---|---|---|---|
|
|
355
|
+
| `id` | `string` | no | The probe id. |
|
|
356
|
+
|
|
357
|
+
**Returns** `Readonly<Record<string, ProbeTunable>> | null`: Null for an unknown entity.
|
|
358
|
+
|
|
359
|
+
Binding symbol `og_runtime_probe_bounds` · publish builds: dropped
|
|
360
|
+
|
|
361
|
+
```ogt
|
|
362
|
+
fn bounds {
|
|
363
|
+
doc "The ranges of one entity's tunable fields, from the schema."
|
|
364
|
+
param id String "The probe id."
|
|
365
|
+
returns Option.Map.ProbeTunable "Null for an unknown entity."
|
|
366
|
+
}
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
<sub>`api.ogt` line 10857</sub>
|
|
370
|
+
|
|
371
|
+
<a id="member-RuntimeProbe-patch"></a>
|
|
372
|
+
|
|
373
|
+
#### `RuntimeProbe.patch`
|
|
374
|
+
|
|
375
|
+
Move one tunable field for this run only; it applies within one frame. The probe never writes project files.
|
|
376
|
+
|
|
377
|
+
```ts
|
|
378
|
+
RuntimeProbe.patch(id: string, parameter: string, value: unknown): boolean
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
| Parameter | Type | Optional | Doc |
|
|
382
|
+
|---|---|---|---|
|
|
383
|
+
| `id` | `string` | no | The probe id. |
|
|
384
|
+
| `parameter` | `string` | no | The field, as `Health.hp`. |
|
|
385
|
+
| `value` | `unknown` | no | The new value. |
|
|
386
|
+
|
|
387
|
+
**Returns** `boolean`: False is a refusal.
|
|
388
|
+
|
|
389
|
+
Binding symbol `og_runtime_probe_patch` · publish builds: dropped
|
|
390
|
+
|
|
391
|
+
```ogt
|
|
392
|
+
fn patch {
|
|
393
|
+
doc "Move one tunable field for this run only; it applies within one frame. The probe never writes project files."
|
|
394
|
+
param id String "The probe id."
|
|
395
|
+
param parameter String "The field, as `Health.hp`."
|
|
396
|
+
param value Json "The new value."
|
|
397
|
+
returns bool "False is a refusal."
|
|
398
|
+
}
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
<sub>`api.ogt` line 10862</sub>
|
|
402
|
+
|
|
403
|
+
<a id="member-RuntimeProbe-run"></a>
|
|
404
|
+
|
|
405
|
+
#### `RuntimeProbe.run`
|
|
406
|
+
|
|
407
|
+
Run a program of the members above in order, stopping at the first refusal.
|
|
408
|
+
|
|
409
|
+
```ts
|
|
410
|
+
RuntimeProbe.run(program: readonly ProbeOperation[]): ProbeProgramResult
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
| Parameter | Type | Optional | Doc |
|
|
414
|
+
|---|---|---|---|
|
|
415
|
+
| `program` | `readonly ProbeOperation[]` | no | At most PROBE_PROGRAM_MAX_OPERATIONS operations. |
|
|
416
|
+
|
|
417
|
+
**Returns** `ProbeProgramResult`.
|
|
418
|
+
|
|
419
|
+
Binding symbol `og_runtime_probe_run` · publish builds: dropped
|
|
420
|
+
|
|
421
|
+
```ogt
|
|
422
|
+
fn run {
|
|
423
|
+
doc "Run a program of the members above in order, stopping at the first refusal."
|
|
424
|
+
param program List.ProbeOperation "At most PROBE_PROGRAM_MAX_OPERATIONS operations."
|
|
425
|
+
returns ProbeProgramResult
|
|
426
|
+
}
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
<sub>`api.ogt` line 10869</sub>
|
|
430
|
+
|
|
431
|
+
<a id="type-EngineProbe"></a>
|
|
432
|
+
|
|
433
|
+
### `EngineProbe` (interface)
|
|
434
|
+
|
|
435
|
+
The engine's probe: protocol 5 plus the wire members of the loopback WebSocket and the in-page request ring.
|
|
436
|
+
|
|
437
|
+
Extends [`RuntimeProbe`](#type-RuntimeProbe): every member of it is a member here.
|
|
438
|
+
|
|
439
|
+
```ogt
|
|
440
|
+
interface EngineProbe {
|
|
441
|
+
doc "The engine's probe: protocol 5 plus the wire members of the loopback WebSocket and the in-page request ring."
|
|
442
|
+
extends RuntimeProbe
|
|
443
|
+
publish false
|
|
444
|
+
# members follow, each quoted below
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
<sub>`api.ogt` line 10876</sub>
|
|
448
|
+
|
|
449
|
+
<a id="member-EngineProbe-hello"></a>
|
|
450
|
+
|
|
451
|
+
#### `EngineProbe.hello`
|
|
452
|
+
|
|
453
|
+
Who is speaking: protocol, wire, engine version, tick rate, renderer tier, build.
|
|
454
|
+
|
|
455
|
+
```ts
|
|
456
|
+
EngineProbe.hello(): Hello
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
**Returns** `Hello`.
|
|
460
|
+
|
|
461
|
+
Binding symbol `og_engine_probe_hello` · publish builds: kept
|
|
462
|
+
|
|
463
|
+
```ogt
|
|
464
|
+
fn hello {
|
|
465
|
+
doc "Who is speaking: protocol, wire, engine version, tick rate, renderer tier, build."
|
|
466
|
+
publish true
|
|
467
|
+
returns Hello
|
|
468
|
+
}
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
<sub>`api.ogt` line 10881</sub>
|
|
472
|
+
|
|
473
|
+
<a id="member-EngineProbe-capture"></a>
|
|
474
|
+
|
|
475
|
+
#### `EngineProbe.capture`
|
|
476
|
+
|
|
477
|
+
The frame of the current tick, rendered offscreen and read back as a PNG; null without a renderer (hello's tier `none`).
|
|
478
|
+
|
|
479
|
+
Size rule: width and height are both 0 (or absent), which is the render target's size, or both 1 to 4096, which renders that size with the same camera (the aspect follows the requested size); one zero and one not is a malformed call.
|
|
480
|
+
|
|
481
|
+
On the web the readback is asynchronous: through the request ring the answer arrives when the copy completes; a synchronous in-page call answers null on the first tick and the frame from then on (a capture is requested on tick N and answered on N + 1).
|
|
482
|
+
|
|
483
|
+
```ts
|
|
484
|
+
EngineProbe.capture(width?: number, height?: number): Capture | null
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
| Parameter | Type | Optional | Doc |
|
|
488
|
+
|---|---|---|---|
|
|
489
|
+
| `width` | `number` | yes | Width in pixels; 0 is the render target's. Default `0`. |
|
|
490
|
+
| `height` | `number` | yes | Height in pixels; 0 is the render target's. Default `0`. |
|
|
491
|
+
|
|
492
|
+
**Returns** `Capture | null`: Null without a renderer.
|
|
493
|
+
|
|
494
|
+
Binding symbol `og_engine_probe_capture` · publish builds: kept
|
|
495
|
+
|
|
496
|
+
```ogt
|
|
497
|
+
fn capture {
|
|
498
|
+
doc "The frame of the current tick, rendered offscreen and read back as a PNG; null without a renderer (hello's tier `none`)."
|
|
499
|
+
doc "Size rule: width and height are both 0 (or absent), which is the render target's size, or both 1 to 4096, which renders that size with the same camera (the aspect follows the requested size); one zero and one not is a malformed call."
|
|
500
|
+
doc "On the web the readback is asynchronous: through the request ring the answer arrives when the copy completes; a synchronous in-page call answers null on the first tick and the frame from then on (a capture is requested on tick N and answered on N + 1)."
|
|
501
|
+
publish true
|
|
502
|
+
param width u32 "Width in pixels; 0 is the render target's." {
|
|
503
|
+
default 0
|
|
504
|
+
}
|
|
505
|
+
param height u32 "Height in pixels; 0 is the render target's." {
|
|
506
|
+
default 0
|
|
507
|
+
}
|
|
508
|
+
returns Option.Capture "Null without a renderer."
|
|
509
|
+
}
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
<sub>`api.ogt` line 10886</sub>
|
|
513
|
+
|
|
514
|
+
<a id="member-EngineProbe-sweep"></a>
|
|
515
|
+
|
|
516
|
+
#### `EngineProbe.sweep`
|
|
517
|
+
|
|
518
|
+
A filmstrip over one tunable: per value, restore, patch, advance, capture.
|
|
519
|
+
|
|
520
|
+
```ts
|
|
521
|
+
EngineProbe.sweep(desc?: SweepDesc): SweepResult | null
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
| Parameter | Type | Optional | Doc |
|
|
525
|
+
|---|---|---|---|
|
|
526
|
+
| `desc` | `SweepDesc` | yes | The parameter, values, steps and size. Its fields travel as the call's own parameters on the wire. |
|
|
527
|
+
|
|
528
|
+
**Returns** `SweepResult | null`: Null for an unknown entity or parameter, or without a renderer.
|
|
529
|
+
|
|
530
|
+
Binding symbol `og_engine_probe_sweep` · publish builds: dropped
|
|
531
|
+
|
|
532
|
+
```ogt
|
|
533
|
+
fn sweep {
|
|
534
|
+
doc "A filmstrip over one tunable: per value, restore, patch, advance, capture."
|
|
535
|
+
param desc SweepDesc "The parameter, values, steps and size." {
|
|
536
|
+
flatten true
|
|
537
|
+
}
|
|
538
|
+
returns Option.SweepResult "Null for an unknown entity or parameter, or without a renderer."
|
|
539
|
+
}
|
|
540
|
+
```
|
|
541
|
+
|
|
542
|
+
<sub>`api.ogt` line 10899</sub>
|
|
543
|
+
|
|
544
|
+
<a id="member-EngineProbe-reload"></a>
|
|
545
|
+
|
|
546
|
+
#### `EngineProbe.reload`
|
|
547
|
+
|
|
548
|
+
Hot reload: snapshot, swap the game bundle, re-register components by name, restore.
|
|
549
|
+
|
|
550
|
+
```ts
|
|
551
|
+
EngineProbe.reload(): ReloadReport | null
|
|
552
|
+
```
|
|
553
|
+
|
|
554
|
+
**Returns** `ReloadReport | null`: Null when the new bundle fails to load; the old one keeps running.
|
|
555
|
+
|
|
556
|
+
Binding symbol `og_engine_probe_reload` · publish builds: dropped
|
|
557
|
+
|
|
558
|
+
```ogt
|
|
559
|
+
fn reload {
|
|
560
|
+
doc "Hot reload: snapshot, swap the game bundle, re-register components by name, restore."
|
|
561
|
+
returns Option.ReloadReport "Null when the new bundle fails to load; the old one keeps running."
|
|
562
|
+
}
|
|
563
|
+
```
|
|
564
|
+
|
|
565
|
+
<sub>`api.ogt` line 10906</sub>
|
|
566
|
+
|
|
567
|
+
<a id="member-EngineProbe-snapshot"></a>
|
|
568
|
+
|
|
569
|
+
#### `EngineProbe.snapshot`
|
|
570
|
+
|
|
571
|
+
Snapshot the whole world in the running process.
|
|
572
|
+
|
|
573
|
+
```ts
|
|
574
|
+
EngineProbe.snapshot(): SnapshotInfo | null
|
|
575
|
+
```
|
|
576
|
+
|
|
577
|
+
**Returns** `SnapshotInfo | null`.
|
|
578
|
+
|
|
579
|
+
Binding symbol `og_engine_probe_snapshot` · publish builds: dropped
|
|
580
|
+
|
|
581
|
+
```ogt
|
|
582
|
+
fn snapshot {
|
|
583
|
+
doc "Snapshot the whole world in the running process."
|
|
584
|
+
returns Option.SnapshotInfo
|
|
585
|
+
}
|
|
586
|
+
```
|
|
587
|
+
|
|
588
|
+
<sub>`api.ogt` line 10910</sub>
|
|
589
|
+
|
|
590
|
+
<a id="member-EngineProbe-restore"></a>
|
|
591
|
+
|
|
592
|
+
#### `EngineProbe.restore`
|
|
593
|
+
|
|
594
|
+
Restore a snapshot taken by this process.
|
|
595
|
+
|
|
596
|
+
```ts
|
|
597
|
+
EngineProbe.restore(id: string): boolean
|
|
598
|
+
```
|
|
599
|
+
|
|
600
|
+
| Parameter | Type | Optional | Doc |
|
|
601
|
+
|---|---|---|---|
|
|
602
|
+
| `id` | `string` | no | The snapshot id. |
|
|
603
|
+
|
|
604
|
+
**Returns** `boolean`: False for an unknown id.
|
|
605
|
+
|
|
606
|
+
Binding symbol `og_engine_probe_restore` · publish builds: dropped
|
|
607
|
+
|
|
608
|
+
```ogt
|
|
609
|
+
fn restore {
|
|
610
|
+
doc "Restore a snapshot taken by this process."
|
|
611
|
+
param id String "The snapshot id."
|
|
612
|
+
returns bool "False for an unknown id."
|
|
613
|
+
}
|
|
614
|
+
```
|
|
615
|
+
|
|
616
|
+
<sub>`api.ogt` line 10914</sub>
|
|
617
|
+
|
|
618
|
+
<a id="member-EngineProbe-dump"></a>
|
|
619
|
+
|
|
620
|
+
#### `EngineProbe.dump`
|
|
621
|
+
|
|
622
|
+
A world, entity or UI dump, as the command channel's dump actions write.
|
|
623
|
+
|
|
624
|
+
```ts
|
|
625
|
+
EngineProbe.dump(desc?: DumpDesc): DumpResult | null
|
|
626
|
+
```
|
|
627
|
+
|
|
628
|
+
| Parameter | Type | Optional | Doc |
|
|
629
|
+
|---|---|---|---|
|
|
630
|
+
| `desc` | `DumpDesc` | yes | What to dump. Its fields travel as the call's own parameters on the wire. |
|
|
631
|
+
|
|
632
|
+
**Returns** `DumpResult | null`: Null for an unknown entity.
|
|
633
|
+
|
|
634
|
+
Binding symbol `og_engine_probe_dump` · publish builds: dropped
|
|
635
|
+
|
|
636
|
+
```ogt
|
|
637
|
+
fn dump {
|
|
638
|
+
doc "A world, entity or UI dump, as the command channel's dump actions write."
|
|
639
|
+
param desc DumpDesc "What to dump." {
|
|
640
|
+
flatten true
|
|
641
|
+
}
|
|
642
|
+
returns Option.DumpResult "Null for an unknown entity."
|
|
643
|
+
}
|
|
644
|
+
```
|
|
645
|
+
|
|
646
|
+
<sub>`api.ogt` line 10919</sub>
|
|
647
|
+
|
|
648
|
+
<a id="member-EngineProbe-commands"></a>
|
|
649
|
+
|
|
650
|
+
#### `EngineProbe.commands`
|
|
651
|
+
|
|
652
|
+
Schedule a command script on simulation time, as `og run --commands`.
|
|
653
|
+
|
|
654
|
+
```ts
|
|
655
|
+
EngineProbe.commands(script: string): CommandsReport | null
|
|
656
|
+
```
|
|
657
|
+
|
|
658
|
+
| Parameter | Type | Optional | Doc |
|
|
659
|
+
|---|---|---|---|
|
|
660
|
+
| `script` | `string` | no | `t:action[:args];...`. |
|
|
661
|
+
|
|
662
|
+
**Returns** `CommandsReport | null`: Null for a malformed script.
|
|
663
|
+
|
|
664
|
+
Binding symbol `og_engine_probe_commands` · publish builds: dropped
|
|
665
|
+
|
|
666
|
+
```ogt
|
|
667
|
+
fn commands {
|
|
668
|
+
doc "Schedule a command script on simulation time, as `og run --commands`."
|
|
669
|
+
param script String "`t:action[:args];...`."
|
|
670
|
+
returns Option.CommandsReport "Null for a malformed script."
|
|
671
|
+
}
|
|
672
|
+
```
|
|
673
|
+
|
|
674
|
+
<sub>`api.ogt` line 10926</sub>
|
|
675
|
+
|
|
676
|
+
<a id="member-EngineProbe-listen"></a>
|
|
677
|
+
|
|
678
|
+
#### `EngineProbe.listen`
|
|
679
|
+
|
|
680
|
+
The last seconds of audio the host's mixer rendered (a null sink renders too, into a two-second ring), as a WAV with its peak and RMS: what a person would have heard.
|
|
681
|
+
|
|
682
|
+
```ts
|
|
683
|
+
EngineProbe.listen(seconds?: number): Heard | null
|
|
684
|
+
```
|
|
685
|
+
|
|
686
|
+
| Parameter | Type | Optional | Doc |
|
|
687
|
+
|---|---|---|---|
|
|
688
|
+
| `seconds` | `number` | yes | How many seconds, 0 to 2. Default `1`. |
|
|
689
|
+
|
|
690
|
+
**Returns** `Heard | null`: Null without audio, or before anything was rendered.
|
|
691
|
+
|
|
692
|
+
Binding symbol `og_engine_probe_listen` · publish builds: dropped
|
|
693
|
+
|
|
694
|
+
```ogt
|
|
695
|
+
fn listen {
|
|
696
|
+
doc "The last seconds of audio the host's mixer rendered (a null sink renders too, into a two-second ring), as a WAV with its peak and RMS: what a person would have heard."
|
|
697
|
+
param seconds f32 "How many seconds, 0 to 2." {
|
|
698
|
+
default 1
|
|
699
|
+
}
|
|
700
|
+
returns Option.Heard "Null without audio, or before anything was rendered."
|
|
701
|
+
}
|
|
702
|
+
```
|
|
703
|
+
|
|
704
|
+
<sub>`api.ogt` line 10931</sub>
|
|
705
|
+
|
|
706
|
+
<a id="member-EngineProbe-memory"></a>
|
|
707
|
+
|
|
708
|
+
#### `EngineProbe.memory`
|
|
709
|
+
|
|
710
|
+
What the engine holds: the wasm linear memory on the web or the process's resident memory natively, the engine's counted heap, the world's entities, the streaming budget and the audio bank, in the same shape on both hosts.
|
|
711
|
+
|
|
712
|
+
```ts
|
|
713
|
+
EngineProbe.memory(): ProbeMemory | null
|
|
714
|
+
```
|
|
715
|
+
|
|
716
|
+
**Returns** `ProbeMemory | null`: Null from a host that gives no figures.
|
|
717
|
+
|
|
718
|
+
Binding symbol `og_engine_probe_memory` · publish builds: dropped
|
|
719
|
+
|
|
720
|
+
```ogt
|
|
721
|
+
fn memory {
|
|
722
|
+
doc "What the engine holds: the wasm linear memory on the web or the process's resident memory natively, the engine's counted heap, the world's entities, the streaming budget and the audio bank, in the same shape on both hosts."
|
|
723
|
+
returns Option.ProbeMemory "Null from a host that gives no figures."
|
|
724
|
+
}
|
|
725
|
+
```
|
|
726
|
+
|
|
727
|
+
<sub>`api.ogt` line 10938</sub>
|
|
728
|
+
|
|
729
|
+
## Types
|
|
730
|
+
|
|
731
|
+
<a id="type-PickResult"></a>
|
|
732
|
+
|
|
733
|
+
### `PickResult` (struct)
|
|
734
|
+
|
|
735
|
+
What a screen point resolved to.
|
|
736
|
+
|
|
737
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
738
|
+
|---|---|---|---|---|---|---|
|
|
739
|
+
| `entity` | `string` | `""` | — | — | — | The probe id of the entity under the point. |
|
|
740
|
+
| `world` | `[number, number] \| [number, number, number]` | — | — | — | — | Where the pick landed in world space: two components in the 2D profile, three in 3D; nothing pads a plane with an unmeasured zero. |
|
|
741
|
+
| `source` | `string \| null` | `null` | — | — | — | Where a person would change it, as `player.ts::jump`. |
|
|
742
|
+
|
|
743
|
+
```ogt
|
|
744
|
+
struct PickResult {
|
|
745
|
+
doc "What a screen point resolved to."
|
|
746
|
+
field entity String "The probe id of the entity under the point."
|
|
747
|
+
field world OneOf.Array.f32.2.Array.f32.3 "Where the pick landed in world space: two components in the 2D profile, three in 3D; nothing pads a plane with an unmeasured zero."
|
|
748
|
+
field source Option.String "Where a person would change it, as `player.ts::jump`."
|
|
749
|
+
}
|
|
750
|
+
```
|
|
751
|
+
|
|
752
|
+
<sub>`api.ogt` line 10475</sub>
|
|
753
|
+
|
|
754
|
+
<a id="type-ProbeTunable"></a>
|
|
755
|
+
|
|
756
|
+
### `ProbeTunable` (struct)
|
|
757
|
+
|
|
758
|
+
One published tunable parameter and the range it means something over.
|
|
759
|
+
|
|
760
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
761
|
+
|---|---|---|---|---|---|---|
|
|
762
|
+
| `path` | `string` | `""` | — | — | — | Where the value lives, as `Health.hp`. |
|
|
763
|
+
| `label` | `string` | `""` | — | — | optional | The person-facing name. |
|
|
764
|
+
| `min` | `number` | `0` | — | — | optional | The smallest meaningful value. |
|
|
765
|
+
| `max` | `number` | `0` | — | — | optional | The largest meaningful value. |
|
|
766
|
+
| `step` | `number` | `0` | — | — | optional | Tune's increment. |
|
|
767
|
+
|
|
768
|
+
```ogt
|
|
769
|
+
struct ProbeTunable {
|
|
770
|
+
doc "One published tunable parameter and the range it means something over."
|
|
771
|
+
field path String "Where the value lives, as `Health.hp`."
|
|
772
|
+
field label String "The person-facing name." {
|
|
773
|
+
optional true
|
|
774
|
+
}
|
|
775
|
+
field min f32 "The smallest meaningful value." {
|
|
776
|
+
optional true
|
|
777
|
+
}
|
|
778
|
+
field max f32 "The largest meaningful value." {
|
|
779
|
+
optional true
|
|
780
|
+
}
|
|
781
|
+
field step f32 "Tune's increment." {
|
|
782
|
+
optional true
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
```
|
|
786
|
+
|
|
787
|
+
<sub>`api.ogt` line 10482</sub>
|
|
788
|
+
|
|
789
|
+
<a id="type-ProbeEntityRef"></a>
|
|
790
|
+
|
|
791
|
+
### `ProbeEntityRef` (struct)
|
|
792
|
+
|
|
793
|
+
One entity the probe publishes in state().
|
|
794
|
+
|
|
795
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
796
|
+
|---|---|---|---|---|---|---|
|
|
797
|
+
| `id` | `string` | `""` | — | — | — | Its probe id. |
|
|
798
|
+
| `label` | `string` | `""` | — | — | optional | A person-facing name. |
|
|
799
|
+
|
|
800
|
+
```ogt
|
|
801
|
+
struct ProbeEntityRef {
|
|
802
|
+
doc "One entity the probe publishes in state()."
|
|
803
|
+
field id String "Its probe id."
|
|
804
|
+
field label String "A person-facing name." {
|
|
805
|
+
optional true
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
```
|
|
809
|
+
|
|
810
|
+
<sub>`api.ogt` line 10499</sub>
|
|
811
|
+
|
|
812
|
+
<a id="type-ProbeTimings"></a>
|
|
813
|
+
|
|
814
|
+
### `ProbeTimings` (struct)
|
|
815
|
+
|
|
816
|
+
The fixed timings head of state().
|
|
817
|
+
|
|
818
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
819
|
+
|---|---|---|---|---|---|---|
|
|
820
|
+
| `step` | `number` | `0` | — | `ms` | — | Time the last tick took. |
|
|
821
|
+
| `render` | `number` | `0` | — | `ms` | — | Time the last frame's render took; 0 without a renderer. |
|
|
822
|
+
| `frameMs` | `number` | `0` | — | `ms` | — | step + render. |
|
|
823
|
+
|
|
824
|
+
```ogt
|
|
825
|
+
struct ProbeTimings {
|
|
826
|
+
doc "The fixed timings head of state()."
|
|
827
|
+
field step f32 "Time the last tick took." {
|
|
828
|
+
unit ms
|
|
829
|
+
}
|
|
830
|
+
field render f32 "Time the last frame's render took; 0 without a renderer." {
|
|
831
|
+
unit ms
|
|
832
|
+
}
|
|
833
|
+
field frameMs f32 "step + render." {
|
|
834
|
+
unit ms
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
```
|
|
838
|
+
|
|
839
|
+
<sub>`api.ogt` line 10507</sub>
|
|
840
|
+
|
|
841
|
+
<a id="type-ProbeState"></a>
|
|
842
|
+
|
|
843
|
+
### `ProbeState` (struct)
|
|
844
|
+
|
|
845
|
+
The probe's state(): a fixed head, then the game's own facts.
|
|
846
|
+
|
|
847
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
848
|
+
|---|---|---|---|---|---|---|
|
|
849
|
+
| `tick` | `number` | `0` | — | — | — | Fixed steps since load. |
|
|
850
|
+
| `paused` | `boolean` | `false` | — | — | — | Whether the clock is held. |
|
|
851
|
+
| `seed` | `number` | `0` | — | — | — | The seed the world was assembled from. |
|
|
852
|
+
| `timings` | `ProbeTimings` | `{ step: 0, render: 0, frameMs: 0 }` | — | — | — | The last tick's timings. |
|
|
853
|
+
| `entities` | `readonly ProbeEntityRef[]` | `[]` | — | — | — | The named entities. |
|
|
854
|
+
| `facts` | `unknown` | `null` | — | — | — | What GameDesc.facts returned, or null. |
|
|
855
|
+
|
|
856
|
+
```ogt
|
|
857
|
+
struct ProbeState {
|
|
858
|
+
doc "The probe's state(): a fixed head, then the game's own facts."
|
|
859
|
+
field tick u32 "Fixed steps since load."
|
|
860
|
+
field paused bool "Whether the clock is held."
|
|
861
|
+
field seed u32 "The seed the world was assembled from."
|
|
862
|
+
field timings ProbeTimings "The last tick's timings."
|
|
863
|
+
field entities List.ProbeEntityRef "The named entities."
|
|
864
|
+
field facts Json "What GameDesc.facts returned, or null."
|
|
865
|
+
}
|
|
866
|
+
```
|
|
867
|
+
|
|
868
|
+
<sub>`api.ogt` line 10520</sub>
|
|
869
|
+
|
|
870
|
+
<a id="type-AdvanceOperation"></a>
|
|
871
|
+
|
|
872
|
+
### `AdvanceOperation` (struct)
|
|
873
|
+
|
|
874
|
+
The advance operation's payload.
|
|
875
|
+
|
|
876
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
877
|
+
|---|---|---|---|---|---|---|
|
|
878
|
+
| `steps` | `number` | `0` | — | — | — | Fixed steps to take. |
|
|
879
|
+
|
|
880
|
+
```ogt
|
|
881
|
+
struct AdvanceOperation {
|
|
882
|
+
doc "The advance operation's payload."
|
|
883
|
+
field steps u32 "Fixed steps to take."
|
|
884
|
+
}
|
|
885
|
+
```
|
|
886
|
+
|
|
887
|
+
<sub>`api.ogt` line 10530</sub>
|
|
888
|
+
|
|
889
|
+
<a id="type-InputOperation"></a>
|
|
890
|
+
|
|
891
|
+
### `InputOperation` (struct)
|
|
892
|
+
|
|
893
|
+
The input operation's payload.
|
|
894
|
+
|
|
895
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
896
|
+
|---|---|---|---|---|---|---|
|
|
897
|
+
| `event` | `InjectedInput` | — | — | — | — | The event. |
|
|
898
|
+
|
|
899
|
+
```ogt
|
|
900
|
+
struct InputOperation {
|
|
901
|
+
doc "The input operation's payload."
|
|
902
|
+
field event InjectedInput "The event."
|
|
903
|
+
}
|
|
904
|
+
```
|
|
905
|
+
|
|
906
|
+
<sub>`api.ogt` line 10535</sub>
|
|
907
|
+
|
|
908
|
+
<a id="type-PickOperation"></a>
|
|
909
|
+
|
|
910
|
+
### `PickOperation` (struct)
|
|
911
|
+
|
|
912
|
+
The pick operation's payload.
|
|
913
|
+
|
|
914
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
915
|
+
|---|---|---|---|---|---|---|
|
|
916
|
+
| `x` | `number` | `0` | — | — | — | Horizontal position in CSS pixels. |
|
|
917
|
+
| `y` | `number` | `0` | — | — | — | Vertical position in CSS pixels. |
|
|
918
|
+
|
|
919
|
+
```ogt
|
|
920
|
+
struct PickOperation {
|
|
921
|
+
doc "The pick operation's payload."
|
|
922
|
+
field x f32 "Horizontal position in CSS pixels."
|
|
923
|
+
field y f32 "Vertical position in CSS pixels."
|
|
924
|
+
}
|
|
925
|
+
```
|
|
926
|
+
|
|
927
|
+
<sub>`api.ogt` line 10540</sub>
|
|
928
|
+
|
|
929
|
+
<a id="type-EntityOperation"></a>
|
|
930
|
+
|
|
931
|
+
### `EntityOperation` (struct)
|
|
932
|
+
|
|
933
|
+
The entity operation's payload.
|
|
934
|
+
|
|
935
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
936
|
+
|---|---|---|---|---|---|---|
|
|
937
|
+
| `id` | `string` | `""` | — | — | — | The probe id. |
|
|
938
|
+
|
|
939
|
+
```ogt
|
|
940
|
+
struct EntityOperation {
|
|
941
|
+
doc "The entity operation's payload."
|
|
942
|
+
field id String "The probe id."
|
|
943
|
+
}
|
|
944
|
+
```
|
|
945
|
+
|
|
946
|
+
<sub>`api.ogt` line 10546</sub>
|
|
947
|
+
|
|
948
|
+
<a id="type-ProbeOperation"></a>
|
|
949
|
+
|
|
950
|
+
### `ProbeOperation` (union)
|
|
951
|
+
|
|
952
|
+
One operation of a probe program, which runs in one evaluation so a scripted segment costs one round trip.
|
|
953
|
+
|
|
954
|
+
Tagged by `op`.
|
|
955
|
+
|
|
956
|
+
| Case | Payload | Doc |
|
|
957
|
+
|---|---|---|
|
|
958
|
+
| `op: "advance"` | [`AdvanceOperation`](#type-AdvanceOperation) | Take fixed steps; answers the tick. |
|
|
959
|
+
| `op: "input"` | [`InputOperation`](#type-InputOperation) | Inject an event; answers true. |
|
|
960
|
+
| `op: "pause"` | — | Hold the clock; answers true. |
|
|
961
|
+
| `op: "resume"` | — | Release the clock; answers true. |
|
|
962
|
+
| `op: "read"` | — | Read the state; answers `{ tick, state }`. |
|
|
963
|
+
| `op: "pick"` | [`PickOperation`](#type-PickOperation) | Pick a point; answers its result or null. |
|
|
964
|
+
| `op: "entity"` | [`EntityOperation`](#type-EntityOperation) | Read an entity's parameters; null is a refusal. |
|
|
965
|
+
|
|
966
|
+
```ogt
|
|
967
|
+
union ProbeOperation {
|
|
968
|
+
doc "One operation of a probe program, which runs in one evaluation so a scripted segment costs one round trip."
|
|
969
|
+
tag op
|
|
970
|
+
case advance AdvanceOperation "Take fixed steps; answers the tick."
|
|
971
|
+
case input InputOperation "Inject an event; answers true."
|
|
972
|
+
case pause "Hold the clock; answers true."
|
|
973
|
+
case resume "Release the clock; answers true."
|
|
974
|
+
case read "Read the state; answers `{ tick, state }`."
|
|
975
|
+
case pick PickOperation "Pick a point; answers its result or null."
|
|
976
|
+
case entity EntityOperation "Read an entity's parameters; null is a refusal."
|
|
977
|
+
}
|
|
978
|
+
```
|
|
979
|
+
|
|
980
|
+
<sub>`api.ogt` line 10551</sub>
|
|
981
|
+
|
|
982
|
+
<a id="type-ProbeProgramResult"></a>
|
|
983
|
+
|
|
984
|
+
### `ProbeProgramResult` (struct)
|
|
985
|
+
|
|
986
|
+
What a program observed: one answer per operation that ran. A false, or entity's null, stops the program and `refused` names its index.
|
|
987
|
+
|
|
988
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
989
|
+
|---|---|---|---|---|---|---|
|
|
990
|
+
| `results` | `readonly unknown[]` | `[]` | — | — | — | The answers, in order. |
|
|
991
|
+
| `refused` | `number \| null` | `null` | — | — | — | The index of the refusing operation, or null. |
|
|
992
|
+
| `tick` | `number` | `0` | — | — | — | The tick after the last operation that ran. |
|
|
993
|
+
|
|
994
|
+
```ogt
|
|
995
|
+
struct ProbeProgramResult {
|
|
996
|
+
doc "What a program observed: one answer per operation that ran. A false, or entity's null, stops the program and `refused` names its index."
|
|
997
|
+
field results List.Json "The answers, in order."
|
|
998
|
+
field refused Option.u32 "The index of the refusing operation, or null."
|
|
999
|
+
field tick u32 "The tick after the last operation that ran."
|
|
1000
|
+
}
|
|
1001
|
+
```
|
|
1002
|
+
|
|
1003
|
+
<sub>`api.ogt` line 10563</sub>
|
|
1004
|
+
|
|
1005
|
+
<a id="type-Hello"></a>
|
|
1006
|
+
|
|
1007
|
+
### `Hello` (struct)
|
|
1008
|
+
|
|
1009
|
+
The wire's hello: who is speaking.
|
|
1010
|
+
|
|
1011
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
1012
|
+
|---|---|---|---|---|---|---|
|
|
1013
|
+
| `protocol` | `number` | `0` | — | — | — | PROBE_VERSION. |
|
|
1014
|
+
| `wire` | `number` | `0` | — | — | — | PROBE_WIRE_VERSION. |
|
|
1015
|
+
| `substrate` | `string` | `""` | — | — | — | Always `origin-engine`. |
|
|
1016
|
+
| `engine` | `string` | `""` | — | — | — | `origin-engine <version>`. |
|
|
1017
|
+
| `ticksPerSecond` | `number` | `0` | — | `hz` | — | The fixed tick rate. |
|
|
1018
|
+
| `tier` | `RenderTier` | `"webgpu"` | — | — | — | The renderer backend. |
|
|
1019
|
+
| `build` | `BuildProfile` | `"dev"` | — | — | — | The build configuration. |
|
|
1020
|
+
| `members` | `readonly string[]` | `[]` | — | — | — | The probe members this build serves. |
|
|
1021
|
+
| `modules` | `readonly string[]` | `[]` | — | — | — | The engine modules this build carries beyond the core (`physics`, `audio`, `ui`, `cook`), so a client knows which members do something. |
|
|
1022
|
+
|
|
1023
|
+
```ogt
|
|
1024
|
+
struct Hello {
|
|
1025
|
+
doc "The wire's hello: who is speaking."
|
|
1026
|
+
field protocol u32 "PROBE_VERSION."
|
|
1027
|
+
field wire u32 "PROBE_WIRE_VERSION."
|
|
1028
|
+
field substrate String "Always `origin-engine`."
|
|
1029
|
+
field engine String "`origin-engine <version>`."
|
|
1030
|
+
field ticksPerSecond u32 "The fixed tick rate." {
|
|
1031
|
+
unit hz
|
|
1032
|
+
}
|
|
1033
|
+
field tier RenderTier "The renderer backend."
|
|
1034
|
+
field build BuildProfile "The build configuration."
|
|
1035
|
+
field members List.String "The probe members this build serves."
|
|
1036
|
+
field modules List.String "The engine modules this build carries beyond the core (`physics`, `audio`, `ui`, `cook`), so a client knows which members do something."
|
|
1037
|
+
}
|
|
1038
|
+
```
|
|
1039
|
+
|
|
1040
|
+
<sub>`api.ogt` line 10570</sub>
|
|
1041
|
+
|
|
1042
|
+
<a id="type-BuildProfile"></a>
|
|
1043
|
+
|
|
1044
|
+
### `BuildProfile` (enum)
|
|
1045
|
+
|
|
1046
|
+
The build configuration; publish builds keep only the player-facing probe members.
|
|
1047
|
+
|
|
1048
|
+
A string: one of the variants below. The zero value is `"dev"`.
|
|
1049
|
+
|
|
1050
|
+
| Variant | Doc |
|
|
1051
|
+
|---|---|
|
|
1052
|
+
| `"dev"` | A development build: every member, the command channel, dumps. |
|
|
1053
|
+
| `"release"` | An optimised build with every member. |
|
|
1054
|
+
| `"publish"` | A published game: hello, tick, state, pick, entity, input and capture only. |
|
|
1055
|
+
|
|
1056
|
+
```ogt
|
|
1057
|
+
enum BuildProfile {
|
|
1058
|
+
doc "The build configuration; publish builds keep only the player-facing probe members."
|
|
1059
|
+
variant dev "A development build: every member, the command channel, dumps."
|
|
1060
|
+
variant release "An optimised build with every member."
|
|
1061
|
+
variant publish "A published game: hello, tick, state, pick, entity, input and capture only."
|
|
1062
|
+
}
|
|
1063
|
+
```
|
|
1064
|
+
|
|
1065
|
+
<sub>`api.ogt` line 10585</sub>
|
|
1066
|
+
|
|
1067
|
+
<a id="type-Capture"></a>
|
|
1068
|
+
|
|
1069
|
+
### `Capture` (struct)
|
|
1070
|
+
|
|
1071
|
+
A captured frame.
|
|
1072
|
+
|
|
1073
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
1074
|
+
|---|---|---|---|---|---|---|
|
|
1075
|
+
| `tick` | `number` | `0` | — | — | — | The tick the frame shows. |
|
|
1076
|
+
| `width` | `number` | `0` | — | — | — | Width in pixels. |
|
|
1077
|
+
| `height` | `number` | `0` | — | — | — | Height in pixels. |
|
|
1078
|
+
| `png` | `string` | `""` | — | — | — | The PNG, base64. |
|
|
1079
|
+
|
|
1080
|
+
```ogt
|
|
1081
|
+
struct Capture {
|
|
1082
|
+
doc "A captured frame."
|
|
1083
|
+
field tick u32 "The tick the frame shows."
|
|
1084
|
+
field width u32 "Width in pixels."
|
|
1085
|
+
field height u32 "Height in pixels."
|
|
1086
|
+
field png String "The PNG, base64."
|
|
1087
|
+
}
|
|
1088
|
+
```
|
|
1089
|
+
|
|
1090
|
+
<sub>`api.ogt` line 10592</sub>
|
|
1091
|
+
|
|
1092
|
+
<a id="type-Heard"></a>
|
|
1093
|
+
|
|
1094
|
+
### `Heard` (struct)
|
|
1095
|
+
|
|
1096
|
+
What the host's mixer rendered last: the audio up to the current tick.
|
|
1097
|
+
|
|
1098
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
1099
|
+
|---|---|---|---|---|---|---|
|
|
1100
|
+
| `tick` | `number` | `0` | — | — | — | The tick it ends at. |
|
|
1101
|
+
| `rate` | `number` | `0` | — | `hz` | — | Frames per second. |
|
|
1102
|
+
| `frames` | `number` | `0` | — | — | — | Stereo frames in the WAV. |
|
|
1103
|
+
| `peak` | `number` | `0` | — | — | — | The largest sample, 0 to 1. |
|
|
1104
|
+
| `rms` | `number` | `0` | — | — | — | The root mean square of both channels. |
|
|
1105
|
+
| `wav` | `string` | `""` | — | — | — | A 16-bit stereo WAV, base64. |
|
|
1106
|
+
|
|
1107
|
+
```ogt
|
|
1108
|
+
struct Heard {
|
|
1109
|
+
doc "What the host's mixer rendered last: the audio up to the current tick."
|
|
1110
|
+
field tick u32 "The tick it ends at."
|
|
1111
|
+
field rate u32 "Frames per second." {
|
|
1112
|
+
unit hz
|
|
1113
|
+
}
|
|
1114
|
+
field frames u32 "Stereo frames in the WAV."
|
|
1115
|
+
field peak f32 "The largest sample, 0 to 1."
|
|
1116
|
+
field rms f32 "The root mean square of both channels."
|
|
1117
|
+
field wav String "A 16-bit stereo WAV, base64."
|
|
1118
|
+
}
|
|
1119
|
+
```
|
|
1120
|
+
|
|
1121
|
+
<sub>`api.ogt` line 10600</sub>
|
|
1122
|
+
|
|
1123
|
+
<a id="type-ProbeHeap"></a>
|
|
1124
|
+
|
|
1125
|
+
### `ProbeHeap` (struct)
|
|
1126
|
+
|
|
1127
|
+
The engine's allocator, counted (both hosts install a counting global allocator).
|
|
1128
|
+
|
|
1129
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
1130
|
+
|---|---|---|---|---|---|---|
|
|
1131
|
+
| `live` | `number` | `0` | — | `bytes` | — | Bytes allocated and not freed. |
|
|
1132
|
+
| `peak` | `number` | `0` | — | `bytes` | — | The most bytes live at once since load. |
|
|
1133
|
+
| `allocations` | `number` | `0` | — | — | — | Allocations made since load. |
|
|
1134
|
+
|
|
1135
|
+
```ogt
|
|
1136
|
+
struct ProbeHeap {
|
|
1137
|
+
doc "The engine's allocator, counted (both hosts install a counting global allocator)."
|
|
1138
|
+
field live f64 "Bytes allocated and not freed." {
|
|
1139
|
+
unit bytes
|
|
1140
|
+
}
|
|
1141
|
+
field peak f64 "The most bytes live at once since load." {
|
|
1142
|
+
unit bytes
|
|
1143
|
+
}
|
|
1144
|
+
field allocations f64 "Allocations made since load."
|
|
1145
|
+
}
|
|
1146
|
+
```
|
|
1147
|
+
|
|
1148
|
+
<sub>`api.ogt` line 10612</sub>
|
|
1149
|
+
|
|
1150
|
+
<a id="type-ProbeWorldMemory"></a>
|
|
1151
|
+
|
|
1152
|
+
### `ProbeWorldMemory` (struct)
|
|
1153
|
+
|
|
1154
|
+
The world's size.
|
|
1155
|
+
|
|
1156
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
1157
|
+
|---|---|---|---|---|---|---|
|
|
1158
|
+
| `entities` | `number` | `0` | — | — | — | Entities alive. |
|
|
1159
|
+
|
|
1160
|
+
```ogt
|
|
1161
|
+
struct ProbeWorldMemory {
|
|
1162
|
+
doc "The world's size."
|
|
1163
|
+
field entities u32 "Entities alive."
|
|
1164
|
+
}
|
|
1165
|
+
```
|
|
1166
|
+
|
|
1167
|
+
<sub>`api.ogt` line 10623</sub>
|
|
1168
|
+
|
|
1169
|
+
<a id="type-ProbeStreamMemory"></a>
|
|
1170
|
+
|
|
1171
|
+
### `ProbeStreamMemory` (struct)
|
|
1172
|
+
|
|
1173
|
+
The streaming memory budget (og.stream.budget): what the admitted groups' assets take.
|
|
1174
|
+
|
|
1175
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
1176
|
+
|---|---|---|---|---|---|---|
|
|
1177
|
+
| `budget` | `number` | `0` | — | `bytes` | — | The budget. |
|
|
1178
|
+
| `used` | `number` | `0` | — | `bytes` | — | What the admitted groups take now. |
|
|
1179
|
+
| `peak` | `number` | `0` | — | `bytes` | — | The most they took at once. |
|
|
1180
|
+
|
|
1181
|
+
```ogt
|
|
1182
|
+
struct ProbeStreamMemory {
|
|
1183
|
+
doc "The streaming memory budget (og.stream.budget): what the admitted groups' assets take."
|
|
1184
|
+
field budget f64 "The budget." {
|
|
1185
|
+
unit bytes
|
|
1186
|
+
}
|
|
1187
|
+
field used f64 "What the admitted groups take now." {
|
|
1188
|
+
unit bytes
|
|
1189
|
+
}
|
|
1190
|
+
field peak f64 "The most they took at once." {
|
|
1191
|
+
unit bytes
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
```
|
|
1195
|
+
|
|
1196
|
+
<sub>`api.ogt` line 10628</sub>
|
|
1197
|
+
|
|
1198
|
+
<a id="type-ProbeMemory"></a>
|
|
1199
|
+
|
|
1200
|
+
### `ProbeMemory` (struct)
|
|
1201
|
+
|
|
1202
|
+
What the engine holds, in one shape on both hosts; a figure a host cannot read is null. A publish page, whose probe has no `memory`, answers the same from the engine Worker (`__runtime_probe__.memory()`, docs/web-export.md).
|
|
1203
|
+
|
|
1204
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
1205
|
+
|---|---|---|---|---|---|---|
|
|
1206
|
+
| `host` | `string` | `""` | — | — | — | `web` or `native`. |
|
|
1207
|
+
| `linear` | `number \| null` | `null` | — | `bytes` | — | The wasm linear memory's size, which the browser reserved for the engine and never takes back; null natively. |
|
|
1208
|
+
| `resident` | `number \| null` | `null` | — | `bytes` | — | The process's resident memory (Linux /proc/self/status, macOS task_info); null on the web, where a page cannot read its process's. |
|
|
1209
|
+
| `heap` | `ProbeHeap \| null` | `null` | — | — | — | The engine's allocator; null where the host counts nothing. |
|
|
1210
|
+
| `world` | `ProbeWorldMemory` | `{ entities: 0 }` | — | — | — | The world. |
|
|
1211
|
+
| `stream` | `ProbeStreamMemory \| null` | `null` | — | — | — | The streaming budget. |
|
|
1212
|
+
| `audio` | `number \| null` | `null` | — | `bytes` | — | The sound bank's samples in memory (decoded sounds and the resident chunks of streamed ones); null without audio. |
|
|
1213
|
+
|
|
1214
|
+
```ogt
|
|
1215
|
+
struct ProbeMemory {
|
|
1216
|
+
doc "What the engine holds, in one shape on both hosts; a figure a host cannot read is null. A publish page, whose probe has no `memory`, answers the same from the engine Worker (`__runtime_probe__.memory()`, docs/web-export.md)."
|
|
1217
|
+
field host String "`web` or `native`."
|
|
1218
|
+
field linear Option.f64 "The wasm linear memory's size, which the browser reserved for the engine and never takes back; null natively." {
|
|
1219
|
+
unit bytes
|
|
1220
|
+
}
|
|
1221
|
+
field resident Option.f64 "The process's resident memory (Linux /proc/self/status, macOS task_info); null on the web, where a page cannot read its process's." {
|
|
1222
|
+
unit bytes
|
|
1223
|
+
}
|
|
1224
|
+
field heap Option.ProbeHeap "The engine's allocator; null where the host counts nothing."
|
|
1225
|
+
field world ProbeWorldMemory "The world."
|
|
1226
|
+
field stream Option.ProbeStreamMemory "The streaming budget."
|
|
1227
|
+
field audio Option.f64 "The sound bank's samples in memory (decoded sounds and the resident chunks of streamed ones); null without audio." {
|
|
1228
|
+
unit bytes
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1231
|
+
```
|
|
1232
|
+
|
|
1233
|
+
<sub>`api.ogt` line 10641</sub>
|
|
1234
|
+
|
|
1235
|
+
<a id="type-SweepDesc"></a>
|
|
1236
|
+
|
|
1237
|
+
### `SweepDesc` (desc struct)
|
|
1238
|
+
|
|
1239
|
+
A parameter sweep: for each value, restore the snapshot taken at the call, patch, advance and capture.
|
|
1240
|
+
|
|
1241
|
+
A desc: every field may be omitted and takes its default; `{}` is valid.
|
|
1242
|
+
|
|
1243
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
1244
|
+
|---|---|---|---|---|---|---|
|
|
1245
|
+
| `id` | `string` | `""` | — | — | — | The probe id of the entity. |
|
|
1246
|
+
| `parameter` | `string` | `""` | — | — | — | The parameter, as `Health.hp`. |
|
|
1247
|
+
| `values` | `readonly unknown[]` | `[]` | — | — | — | The values to try, in order. |
|
|
1248
|
+
| `steps` | `number` | `0` | — | — | — | Fixed steps to advance after each patch. |
|
|
1249
|
+
| `width` | `number` | `0` | — | — | — | Capture width; 0 is the render target's. |
|
|
1250
|
+
| `height` | `number` | `0` | — | — | — | Capture height; 0 is the render target's. |
|
|
1251
|
+
|
|
1252
|
+
```ogt
|
|
1253
|
+
struct SweepDesc {
|
|
1254
|
+
doc "A parameter sweep: for each value, restore the snapshot taken at the call, patch, advance and capture."
|
|
1255
|
+
desc true
|
|
1256
|
+
field id String "The probe id of the entity."
|
|
1257
|
+
field parameter String "The parameter, as `Health.hp`."
|
|
1258
|
+
field values List.Json "The values to try, in order."
|
|
1259
|
+
field steps u32 "Fixed steps to advance after each patch."
|
|
1260
|
+
field width u32 "Capture width; 0 is the render target's."
|
|
1261
|
+
field height u32 "Capture height; 0 is the render target's."
|
|
1262
|
+
}
|
|
1263
|
+
```
|
|
1264
|
+
|
|
1265
|
+
<sub>`api.ogt` line 10658</sub>
|
|
1266
|
+
|
|
1267
|
+
<a id="type-SweepFrame"></a>
|
|
1268
|
+
|
|
1269
|
+
### `SweepFrame` (struct)
|
|
1270
|
+
|
|
1271
|
+
One frame of a sweep.
|
|
1272
|
+
|
|
1273
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
1274
|
+
|---|---|---|---|---|---|---|
|
|
1275
|
+
| `value` | `unknown` | `null` | — | — | — | The value patched in. |
|
|
1276
|
+
| `tick` | `number` | `0` | — | — | — | The tick captured. |
|
|
1277
|
+
| `png` | `string` | `""` | — | — | — | The PNG, base64. |
|
|
1278
|
+
|
|
1279
|
+
```ogt
|
|
1280
|
+
struct SweepFrame {
|
|
1281
|
+
doc "One frame of a sweep."
|
|
1282
|
+
field value Json "The value patched in."
|
|
1283
|
+
field tick u32 "The tick captured."
|
|
1284
|
+
field png String "The PNG, base64."
|
|
1285
|
+
}
|
|
1286
|
+
```
|
|
1287
|
+
|
|
1288
|
+
<sub>`api.ogt` line 10669</sub>
|
|
1289
|
+
|
|
1290
|
+
<a id="type-SweepResult"></a>
|
|
1291
|
+
|
|
1292
|
+
### `SweepResult` (struct)
|
|
1293
|
+
|
|
1294
|
+
A sweep's frames, one per value.
|
|
1295
|
+
|
|
1296
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
1297
|
+
|---|---|---|---|---|---|---|
|
|
1298
|
+
| `frames` | `readonly SweepFrame[]` | `[]` | — | — | — | The frames. |
|
|
1299
|
+
|
|
1300
|
+
```ogt
|
|
1301
|
+
struct SweepResult {
|
|
1302
|
+
doc "A sweep's frames, one per value."
|
|
1303
|
+
field frames List.SweepFrame "The frames."
|
|
1304
|
+
}
|
|
1305
|
+
```
|
|
1306
|
+
|
|
1307
|
+
<sub>`api.ogt` line 10676</sub>
|
|
1308
|
+
|
|
1309
|
+
<a id="type-ReloadReport"></a>
|
|
1310
|
+
|
|
1311
|
+
### `ReloadReport` (struct)
|
|
1312
|
+
|
|
1313
|
+
What a hot reload did. Components are re-registered by name and migrated field by field through the schema.
|
|
1314
|
+
|
|
1315
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
1316
|
+
|---|---|---|---|---|---|---|
|
|
1317
|
+
| `tick` | `number` | `0` | — | — | — | The tick the world was restored at. |
|
|
1318
|
+
| `ms` | `number` | `0` | — | `ms` | — | From bundle swap to restored world. |
|
|
1319
|
+
| `migrated` | `readonly string[]` | `[]` | — | — | — | Fields carried across a layout change, as `Health.hp`. |
|
|
1320
|
+
| `dropped` | `readonly string[]` | `[]` | — | — | — | Components or fields that no longer exist, dropped with their data. |
|
|
1321
|
+
| `warnings` | `readonly string[]` | `[]` | — | — | — | Anything else worth reading, each naming the fix. |
|
|
1322
|
+
|
|
1323
|
+
```ogt
|
|
1324
|
+
struct ReloadReport {
|
|
1325
|
+
doc "What a hot reload did. Components are re-registered by name and migrated field by field through the schema."
|
|
1326
|
+
field tick u32 "The tick the world was restored at."
|
|
1327
|
+
field ms f32 "From bundle swap to restored world." {
|
|
1328
|
+
unit ms
|
|
1329
|
+
}
|
|
1330
|
+
field migrated List.String "Fields carried across a layout change, as `Health.hp`."
|
|
1331
|
+
field dropped List.String "Components or fields that no longer exist, dropped with their data."
|
|
1332
|
+
field warnings List.String "Anything else worth reading, each naming the fix."
|
|
1333
|
+
}
|
|
1334
|
+
```
|
|
1335
|
+
|
|
1336
|
+
<sub>`api.ogt` line 10681</sub>
|
|
1337
|
+
|
|
1338
|
+
<a id="type-SnapshotInfo"></a>
|
|
1339
|
+
|
|
1340
|
+
### `SnapshotInfo` (struct)
|
|
1341
|
+
|
|
1342
|
+
A snapshot of the whole world (components, resources, Rng states, pending events) kept in the running process.
|
|
1343
|
+
|
|
1344
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
1345
|
+
|---|---|---|---|---|---|---|
|
|
1346
|
+
| `id` | `string` | `""` | — | — | — | The snapshot's id, for restore. |
|
|
1347
|
+
| `tick` | `number` | `0` | — | — | — | The tick it was taken at. |
|
|
1348
|
+
| `hash` | `string` | `""` | — | — | — | The world hash at that tick, hex: equal hashes mean equal worlds. |
|
|
1349
|
+
| `bytes` | `number` | `0` | — | `bytes` | — | Its size. |
|
|
1350
|
+
|
|
1351
|
+
```ogt
|
|
1352
|
+
struct SnapshotInfo {
|
|
1353
|
+
doc "A snapshot of the whole world (components, resources, Rng states, pending events) kept in the running process."
|
|
1354
|
+
field id String "The snapshot's id, for restore."
|
|
1355
|
+
field tick u32 "The tick it was taken at."
|
|
1356
|
+
field hash String "The world hash at that tick, hex: equal hashes mean equal worlds."
|
|
1357
|
+
field bytes u32 "Its size." {
|
|
1358
|
+
unit bytes
|
|
1359
|
+
}
|
|
1360
|
+
}
|
|
1361
|
+
```
|
|
1362
|
+
|
|
1363
|
+
<sub>`api.ogt` line 10692</sub>
|
|
1364
|
+
|
|
1365
|
+
<a id="type-DumpKind"></a>
|
|
1366
|
+
|
|
1367
|
+
### `DumpKind` (enum)
|
|
1368
|
+
|
|
1369
|
+
What dump() reports.
|
|
1370
|
+
|
|
1371
|
+
A string: one of the variants below. The zero value is `"world"`.
|
|
1372
|
+
|
|
1373
|
+
| Variant | Doc |
|
|
1374
|
+
|---|---|
|
|
1375
|
+
| `"world"` | Archetype tables, systems and their matched counts. |
|
|
1376
|
+
| `"entity"` | One entity's components and transform. |
|
|
1377
|
+
| `"ui"` | The UI tree with bounds. |
|
|
1378
|
+
|
|
1379
|
+
```ogt
|
|
1380
|
+
enum DumpKind {
|
|
1381
|
+
doc "What dump() reports."
|
|
1382
|
+
variant world "Archetype tables, systems and their matched counts."
|
|
1383
|
+
variant entity "One entity's components and transform."
|
|
1384
|
+
variant ui "The UI tree with bounds."
|
|
1385
|
+
}
|
|
1386
|
+
```
|
|
1387
|
+
|
|
1388
|
+
<sub>`api.ogt` line 10702</sub>
|
|
1389
|
+
|
|
1390
|
+
<a id="type-DumpDesc"></a>
|
|
1391
|
+
|
|
1392
|
+
### `DumpDesc` (desc struct)
|
|
1393
|
+
|
|
1394
|
+
What to dump.
|
|
1395
|
+
|
|
1396
|
+
A desc: every field may be omitted and takes its default; `{}` is valid.
|
|
1397
|
+
|
|
1398
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
1399
|
+
|---|---|---|---|---|---|---|
|
|
1400
|
+
| `what` | `DumpKind` | `"world"` | — | — | — | The kind of dump. |
|
|
1401
|
+
| `id` | `string` | `""` | — | — | — | The probe id, for an entity dump. |
|
|
1402
|
+
|
|
1403
|
+
```ogt
|
|
1404
|
+
struct DumpDesc {
|
|
1405
|
+
doc "What to dump."
|
|
1406
|
+
desc true
|
|
1407
|
+
field what DumpKind "The kind of dump."
|
|
1408
|
+
field id String "The probe id, for an entity dump."
|
|
1409
|
+
}
|
|
1410
|
+
```
|
|
1411
|
+
|
|
1412
|
+
<sub>`api.ogt` line 10709</sub>
|
|
1413
|
+
|
|
1414
|
+
<a id="type-ArchetypeDump"></a>
|
|
1415
|
+
|
|
1416
|
+
### `ArchetypeDump` (struct)
|
|
1417
|
+
|
|
1418
|
+
One archetype table.
|
|
1419
|
+
|
|
1420
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
1421
|
+
|---|---|---|---|---|---|---|
|
|
1422
|
+
| `components` | `readonly string[]` | `[]` | — | — | — | Its components, by name. |
|
|
1423
|
+
| `count` | `number` | `0` | — | — | — | Entities in it. |
|
|
1424
|
+
|
|
1425
|
+
```ogt
|
|
1426
|
+
struct ArchetypeDump {
|
|
1427
|
+
doc "One archetype table."
|
|
1428
|
+
field components List.String "Its components, by name."
|
|
1429
|
+
field count u32 "Entities in it."
|
|
1430
|
+
}
|
|
1431
|
+
```
|
|
1432
|
+
|
|
1433
|
+
<sub>`api.ogt` line 10716</sub>
|
|
1434
|
+
|
|
1435
|
+
<a id="type-SystemDump"></a>
|
|
1436
|
+
|
|
1437
|
+
### `SystemDump` (struct)
|
|
1438
|
+
|
|
1439
|
+
One system. The engine fills reads, writes and matched for every system the game declared; ms is null because the probe reads no clock (state().timings has the tick's time).
|
|
1440
|
+
|
|
1441
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
1442
|
+
|---|---|---|---|---|---|---|
|
|
1443
|
+
| `name` | `string` | `""` | — | — | — | Its name. |
|
|
1444
|
+
| `matched` | `number \| null` | `null` | — | — | — | Entities its queries match now; null for a system the host did not declare to the probe. |
|
|
1445
|
+
| `reads` | `readonly string[] \| null` | `null` | — | — | — | What it declared it reads; null when undeclared. |
|
|
1446
|
+
| `writes` | `readonly string[] \| null` | `null` | — | — | — | What it declared it writes; null when undeclared. |
|
|
1447
|
+
| `ms` | `number \| null` | `null` | — | `ms` | — | Time it took on the last tick; null when not measured. |
|
|
1448
|
+
|
|
1449
|
+
```ogt
|
|
1450
|
+
struct SystemDump {
|
|
1451
|
+
doc "One system. The engine fills reads, writes and matched for every system the game declared; ms is null because the probe reads no clock (state().timings has the tick's time)."
|
|
1452
|
+
field name String "Its name."
|
|
1453
|
+
field matched Option.u32 "Entities its queries match now; null for a system the host did not declare to the probe."
|
|
1454
|
+
field reads Option.List.String "What it declared it reads; null when undeclared."
|
|
1455
|
+
field writes Option.List.String "What it declared it writes; null when undeclared."
|
|
1456
|
+
field ms Option.f32 "Time it took on the last tick; null when not measured." {
|
|
1457
|
+
unit ms
|
|
1458
|
+
}
|
|
1459
|
+
}
|
|
1460
|
+
```
|
|
1461
|
+
|
|
1462
|
+
<sub>`api.ogt` line 10722</sub>
|
|
1463
|
+
|
|
1464
|
+
<a id="type-WorldDump"></a>
|
|
1465
|
+
|
|
1466
|
+
### `WorldDump` (struct)
|
|
1467
|
+
|
|
1468
|
+
The world: tables, systems, resources.
|
|
1469
|
+
|
|
1470
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
1471
|
+
|---|---|---|---|---|---|---|
|
|
1472
|
+
| `tick` | `number` | `0` | — | — | — | The tick. |
|
|
1473
|
+
| `hash` | `string` | `""` | — | — | — | The world hash, hex. |
|
|
1474
|
+
| `entities` | `number` | `0` | — | — | — | Live entities. |
|
|
1475
|
+
| `archetypes` | `readonly ArchetypeDump[]` | `[]` | — | — | — | The archetype tables. |
|
|
1476
|
+
| `systems` | `readonly SystemDump[]` | `[]` | — | — | — | The systems in run order. |
|
|
1477
|
+
| `resources` | `readonly string[]` | `[]` | — | — | — | The registered resources. |
|
|
1478
|
+
|
|
1479
|
+
```ogt
|
|
1480
|
+
struct WorldDump {
|
|
1481
|
+
doc "The world: tables, systems, resources."
|
|
1482
|
+
field tick u32 "The tick."
|
|
1483
|
+
field hash String "The world hash, hex."
|
|
1484
|
+
field entities u32 "Live entities."
|
|
1485
|
+
field archetypes List.ArchetypeDump "The archetype tables."
|
|
1486
|
+
field systems List.SystemDump "The systems in run order."
|
|
1487
|
+
field resources List.String "The registered resources."
|
|
1488
|
+
}
|
|
1489
|
+
```
|
|
1490
|
+
|
|
1491
|
+
<sub>`api.ogt` line 10733</sub>
|
|
1492
|
+
|
|
1493
|
+
<a id="type-EntityDump"></a>
|
|
1494
|
+
|
|
1495
|
+
### `EntityDump` (struct)
|
|
1496
|
+
|
|
1497
|
+
One entity.
|
|
1498
|
+
|
|
1499
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
1500
|
+
|---|---|---|---|---|---|---|
|
|
1501
|
+
| `id` | `string` | `""` | — | — | — | Its probe id. |
|
|
1502
|
+
| `name` | `string \| null` | `null` | — | — | — | Its name. |
|
|
1503
|
+
| `components` | `Readonly<Record<string, unknown>>` | `{}` | — | — | — | Each component's field values, by component name. |
|
|
1504
|
+
|
|
1505
|
+
```ogt
|
|
1506
|
+
struct EntityDump {
|
|
1507
|
+
doc "One entity."
|
|
1508
|
+
field id String "Its probe id."
|
|
1509
|
+
field name Option.String "Its name."
|
|
1510
|
+
field components Map.Json "Each component's field values, by component name."
|
|
1511
|
+
}
|
|
1512
|
+
```
|
|
1513
|
+
|
|
1514
|
+
<sub>`api.ogt` line 10743</sub>
|
|
1515
|
+
|
|
1516
|
+
<a id="type-UiElement"></a>
|
|
1517
|
+
|
|
1518
|
+
### `UiElement` (struct)
|
|
1519
|
+
|
|
1520
|
+
One UI element with its bounds.
|
|
1521
|
+
|
|
1522
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
1523
|
+
|---|---|---|---|---|---|---|
|
|
1524
|
+
| `id` | `string` | `""` | — | — | — | Its stable id, as the command channel targets it. |
|
|
1525
|
+
| `parent` | `string` | `""` | — | — | — | Its parent's id; empty at the root. |
|
|
1526
|
+
| `kind` | `string` | `""` | — | — | — | What made it: `label`, `button`, `icon`, `image`, `panel` and the other widget names; empty when the UI module does not say. |
|
|
1527
|
+
| `disabled` | `boolean` | `false` | — | — | — | A disabled control (its text is exempt from contrast rules, as WCAG exempts inactive controls). |
|
|
1528
|
+
| `clipped` | `boolean` | `false` | — | — | — | Only part of it shows: a scroll container or the surface cuts it, and the bounds are the part that shows. |
|
|
1529
|
+
| `text` | `string` | `""` | — | — | — | The text it shows, if any. |
|
|
1530
|
+
| `role` | `string` | `""` | — | — | — | Its accessibility role (og.ui.a11y): button, link, text, heading, image, checkbox, radio, switch, slider, spinbutton, textbox, combobox, listbox, option, tab, tablist, radiogroup, progressbar, meter, timer, status, alert, dialog, tooltip, separator, group; empty for a presentational element (a layout container, a spacer). |
|
|
1531
|
+
| `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
|
+
| `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
|
+
| `states` | `readonly string[]` | `[]` | — | — | — | Its states: disabled, focused, focusable (keys and pads reach it now, in this order), checked, selected, expanded, pressed, busy. |
|
|
1534
|
+
| `x` | `number` | `0` | — | `cssPx` | — | Left edge. |
|
|
1535
|
+
| `y` | `number` | `0` | — | `cssPx` | — | Top edge. |
|
|
1536
|
+
| `width` | `number` | `0` | — | `cssPx` | — | Width. |
|
|
1537
|
+
| `height` | `number` | `0` | — | `cssPx` | — | Height. |
|
|
1538
|
+
|
|
1539
|
+
```ogt
|
|
1540
|
+
struct UiElement {
|
|
1541
|
+
doc "One UI element with its bounds."
|
|
1542
|
+
field id String "Its stable id, as the command channel targets it."
|
|
1543
|
+
field parent String "Its parent's id; empty at the root."
|
|
1544
|
+
field kind String "What made it: `label`, `button`, `icon`, `image`, `panel` and the other widget names; empty when the UI module does not say."
|
|
1545
|
+
field disabled bool "A disabled control (its text is exempt from contrast rules, as WCAG exempts inactive controls)."
|
|
1546
|
+
field clipped bool "Only part of it shows: a scroll container or the surface cuts it, and the bounds are the part that shows."
|
|
1547
|
+
field text String "The text it shows, if any."
|
|
1548
|
+
field role String "Its accessibility role (og.ui.a11y): button, link, text, heading, image, checkbox, radio, switch, slider, spinbutton, textbox, combobox, listbox, option, tab, tablist, radiogroup, progressbar, meter, timer, status, alert, dialog, tooltip, separator, group; empty for a presentational element (a layout container, a spacer)."
|
|
1549
|
+
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
|
+
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
|
+
field states List.String "Its states: disabled, focused, focusable (keys and pads reach it now, in this order), checked, selected, expanded, pressed, busy."
|
|
1552
|
+
field x f32 "Left edge." {
|
|
1553
|
+
unit cssPx
|
|
1554
|
+
}
|
|
1555
|
+
field y f32 "Top edge." {
|
|
1556
|
+
unit cssPx
|
|
1557
|
+
}
|
|
1558
|
+
field width f32 "Width." {
|
|
1559
|
+
unit cssPx
|
|
1560
|
+
}
|
|
1561
|
+
field height f32 "Height." {
|
|
1562
|
+
unit cssPx
|
|
1563
|
+
}
|
|
1564
|
+
}
|
|
1565
|
+
```
|
|
1566
|
+
|
|
1567
|
+
<sub>`api.ogt` line 10750</sub>
|
|
1568
|
+
|
|
1569
|
+
<a id="type-UiSurface"></a>
|
|
1570
|
+
|
|
1571
|
+
### `UiSurface` (struct)
|
|
1572
|
+
|
|
1573
|
+
The surface UI bounds are laid out on.
|
|
1574
|
+
|
|
1575
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
1576
|
+
|---|---|---|---|---|---|---|
|
|
1577
|
+
| `width` | `number` | `0` | — | `cssPx` | — | Its width. |
|
|
1578
|
+
| `height` | `number` | `0` | — | `cssPx` | — | Its height. |
|
|
1579
|
+
| `dpr` | `number` | `1` | — | — | — | Device pixels per CSS pixel: a frame of this surface is width × dpr pixels wide. |
|
|
1580
|
+
|
|
1581
|
+
```ogt
|
|
1582
|
+
struct UiSurface {
|
|
1583
|
+
doc "The surface UI bounds are laid out on."
|
|
1584
|
+
field width f32 "Its width." {
|
|
1585
|
+
unit cssPx
|
|
1586
|
+
}
|
|
1587
|
+
field height f32 "Its height." {
|
|
1588
|
+
unit cssPx
|
|
1589
|
+
}
|
|
1590
|
+
field dpr f32 "Device pixels per CSS pixel: a frame of this surface is width × dpr pixels wide." {
|
|
1591
|
+
default 1
|
|
1592
|
+
}
|
|
1593
|
+
}
|
|
1594
|
+
```
|
|
1595
|
+
|
|
1596
|
+
<sub>`api.ogt` line 10776</sub>
|
|
1597
|
+
|
|
1598
|
+
<a id="type-UiDump"></a>
|
|
1599
|
+
|
|
1600
|
+
### `UiDump` (struct)
|
|
1601
|
+
|
|
1602
|
+
The UI tree, flattened in draw order.
|
|
1603
|
+
|
|
1604
|
+
| Field | Type | Default | Range | Unit | Notes | Doc |
|
|
1605
|
+
|---|---|---|---|---|---|---|
|
|
1606
|
+
| `tick` | `number` | `0` | — | — | — | The tick. |
|
|
1607
|
+
| `surface` | `UiSurface \| null` | `null` | — | — | — | The surface the bounds are on; null without a UI module. |
|
|
1608
|
+
| `elements` | `readonly UiElement[]` | `[]` | — | — | — | The elements. |
|
|
1609
|
+
|
|
1610
|
+
```ogt
|
|
1611
|
+
struct UiDump {
|
|
1612
|
+
doc "The UI tree, flattened in draw order."
|
|
1613
|
+
field tick u32 "The tick."
|
|
1614
|
+
field surface Option.UiSurface "The surface the bounds are on; null without a UI module."
|
|
1615
|
+
field elements List.UiElement "The elements."
|
|
1616
|
+
}
|
|
1617
|
+
```
|
|
1618
|
+
|
|
1619
|
+
<sub>`api.ogt` line 10789</sub>
|
|
1620
|
+
|
|
1621
|
+
<a id="type-DumpResult"></a>
|
|
1622
|
+
|
|
1623
|
+
### `DumpResult` (union)
|
|
1624
|
+
|
|
1625
|
+
A dump, tagged by its kind.
|
|
1626
|
+
|
|
1627
|
+
Tagged by `kind`.
|
|
1628
|
+
|
|
1629
|
+
| Case | Payload | Doc |
|
|
1630
|
+
|---|---|---|
|
|
1631
|
+
| `kind: "world"` | [`WorldDump`](#type-WorldDump) | The world dump. |
|
|
1632
|
+
| `kind: "entity"` | [`EntityDump`](#type-EntityDump) | An entity dump. |
|
|
1633
|
+
| `kind: "ui"` | [`UiDump`](#type-UiDump) | The UI dump. |
|
|
1634
|
+
|
|
1635
|
+
```ogt
|
|
1636
|
+
union DumpResult {
|
|
1637
|
+
doc "A dump, tagged by its kind."
|
|
1638
|
+
tag kind
|
|
1639
|
+
case world WorldDump "The world dump."
|
|
1640
|
+
case entity EntityDump "An entity dump."
|
|
1641
|
+
case ui UiDump "The UI dump."
|
|
1642
|
+
}
|
|
1643
|
+
```
|
|
1644
|
+
|
|
1645
|
+
<sub>`api.ogt` line 10796</sub>
|
|
1646
|
+
|
|
1647
|
+
## Constants
|
|
1648
|
+
|
|
1649
|
+
| Constant | Type | Value | Doc |
|
|
1650
|
+
|---|---|---|---|
|
|
1651
|
+
| <a id="const-PROBE_GLOBAL"></a>`PROBE_GLOBAL` | `string` | `"__runtime_probe__"` | The global the page publishes the probe on. |
|
|
1652
|
+
| <a id="const-PROBE_VERSION"></a>`PROBE_VERSION` | `number` | `5` | The RuntimeProbe contract revision both sides speak. |
|
|
1653
|
+
| <a id="const-PROBE_WIRE_VERSION"></a>`PROBE_WIRE_VERSION` | `number` | `1` | The wire revision hello reports. |
|
|
1654
|
+
| <a id="const-REPLAY_SEED_PARAM"></a>`REPLAY_SEED_PARAM` | `string` | `"replay-seed"` | The page query parameter that starts a deterministic replay from a uint32 seed. |
|
|
1655
|
+
| <a id="const-PLAYTEST_MAX_TICKS"></a>`PLAYTEST_MAX_TICKS` | `number` | `3600` | The longest playtest one request may advance, in fixed steps. |
|
|
1656
|
+
| <a id="const-PROBE_PROGRAM_MAX_OPERATIONS"></a>`PROBE_PROGRAM_MAX_OPERATIONS` | `number` | `256` | The most operations one probe program may carry. |
|
|
1657
|
+
|
|
1658
|
+
```ogt
|
|
1659
|
+
const PROBE_GLOBAL String "__runtime_probe__" "The global the page publishes the probe on."
|
|
1660
|
+
```
|
|
1661
|
+
|
|
1662
|
+
<sub>`api.ogt` line 10468</sub>
|
|
1663
|
+
|
|
1664
|
+
```ogt
|
|
1665
|
+
const PROBE_VERSION u32 5 "The RuntimeProbe contract revision both sides speak."
|
|
1666
|
+
```
|
|
1667
|
+
|
|
1668
|
+
<sub>`api.ogt` line 10469</sub>
|
|
1669
|
+
|
|
1670
|
+
```ogt
|
|
1671
|
+
const PROBE_WIRE_VERSION u32 1 "The wire revision hello reports."
|
|
1672
|
+
```
|
|
1673
|
+
|
|
1674
|
+
<sub>`api.ogt` line 10470</sub>
|
|
1675
|
+
|
|
1676
|
+
```ogt
|
|
1677
|
+
const REPLAY_SEED_PARAM String "replay-seed" "The page query parameter that starts a deterministic replay from a uint32 seed."
|
|
1678
|
+
```
|
|
1679
|
+
|
|
1680
|
+
<sub>`api.ogt` line 10471</sub>
|
|
1681
|
+
|
|
1682
|
+
```ogt
|
|
1683
|
+
const PLAYTEST_MAX_TICKS u32 3600 "The longest playtest one request may advance, in fixed steps."
|
|
1684
|
+
```
|
|
1685
|
+
|
|
1686
|
+
<sub>`api.ogt` line 10472</sub>
|
|
1687
|
+
|
|
1688
|
+
```ogt
|
|
1689
|
+
const PROBE_PROGRAM_MAX_OPERATIONS u32 256 "The most operations one probe program may carry."
|
|
1690
|
+
```
|
|
1691
|
+
|
|
1692
|
+
<sub>`api.ogt` line 10473</sub>
|