@volter/editor-game 0.5.66 → 0.5.68
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/contributions/audio-unlock.service.ts +2 -2
- package/contributions/autoplay.service.ts +1 -1
- package/contributions/bridge.command.ts +3 -3
- package/contributions/build-player.document.tsx +95 -0
- package/contributions/canvas/component-board.service.ts +16 -0
- package/contributions/canvas/design-time-mount.service.ts +45 -0
- package/contributions/canvas-story-capture.service.ts +12 -0
- package/contributions/edit-mode-audio.service.ts +2 -2
- package/contributions/edit-mode-networking.service.ts +1 -1
- package/contributions/gameplay.command.ts +4 -4
- package/contributions/generation.service.ts +1 -1
- package/contributions/godot.style.ts +26 -6
- package/contributions/godot.view.ts +6 -0
- package/contributions/ingest.service.ts +2 -2
- package/contributions/instances.command.ts +1 -1
- package/contributions/navmesh.menu.ts +1 -1
- package/contributions/network-observer.service.ts +14 -0
- package/contributions/play.command.ts +10 -4
- package/contributions/react/component-board.service.ts +1 -1
- package/contributions/react/design-time-mount.service.ts +1 -1
- package/contributions/scene-document.service.ts +3 -3
- package/contributions/state-watch.menu.ts +1 -1
- package/contributions/state-watch.utility.tsx +1 -1
- package/contributions/team-playtest.service.ts +4 -4
- package/contributions/three/component-board.service.ts +1 -1
- package/contributions/three/component-verbs.command.ts +6 -6
- package/contributions/three/three-authoring.service.ts +8 -5
- package/contributions/three-story-capture.service.ts +12 -0
- package/contributions/unity.style.ts +17 -7
- package/contributions/unity.view.ts +6 -0
- package/contributions/unreal.style.ts +10 -2
- package/contributions/unreal.view.ts +5 -0
- package/package.json +21 -10
- package/src/asset-budget/AssetBudgetPanel.tsx +1 -1
- package/src/asset-budget/asset-budget-model.ts +1 -1
- package/src/audio/AudioDebuggerPanel.tsx +1 -1
- package/src/bridge/dispatch.ts +14 -14
- package/src/bridge/live-frames.ts +1 -1
- package/src/bridge/screenshot.ts +3 -3
- package/src/build/BuildProfilesPanel.tsx +14 -3
- package/src/build/build-session.ts +35 -0
- package/src/canvas/canvas-board/CanvasBoardDocument.tsx +749 -0
- package/src/canvas/canvas-board/canvas-board-model.ts +407 -0
- package/src/canvas/canvas-board/canvas-component-board.ts +56 -0
- package/src/canvas/canvas-design-mount.ts +524 -0
- package/src/canvas/design-time-canvas-mount.ts +79 -0
- package/src/coverage/live-authoring-surface.ts +5 -5
- package/src/coverage/live-project-verbs.ts +1 -1
- package/src/coverage/native-system-coverage.ts +5 -5
- package/src/coverage/root-coverage.ts +1 -1
- package/src/coverage/session-coverage.ts +3 -3
- package/src/design-system-stories/ApplicationChrome.stories.tsx +5 -5
- package/src/design-system-stories/InspectorNarrowBodies.stories.tsx +7 -7
- package/src/edit-mode/edit-mode-audio.ts +4 -4
- package/src/edit-mode/edit-mode-networking.ts +2 -2
- package/src/game-document/GameCaptureFrameButton.tsx +1 -1
- package/src/game-document/GameDocument.tsx +2 -2
- package/src/game-document/GamePanel.tsx +4 -4
- package/src/game-document/InstanceInspectorPicker.tsx +2 -2
- package/src/game-document/crowd-debug.ts +1 -1
- package/src/game-document/device-preview.ts +10 -11
- package/src/game-document/physics-debug.ts +1 -1
- package/src/generation/GenerationActivity.tsx +3 -3
- package/src/generation/generation-documents.tsx +5 -5
- package/src/generation/generation-jobs.ts +1 -1
- package/src/host/adapter-runtime-bindings.ts +96 -5
- package/src/host/authoring/babylon-authoring-adapter.ts +6 -6
- package/src/host/authoring/gesture-persist.ts +1 -1
- package/src/host/authoring/ingest-data-writer.ts +1 -1
- package/src/host/authoring/ingest-source-persistence.ts +4 -4
- package/src/host/authoring/mounted-authoring.ts +4 -4
- package/src/host/authoring/phaser-live-authoring-adapter.ts +4 -4
- package/src/host/authoring/pixi-authoring-adapter.ts +178 -31
- package/src/host/authoring/pixi-creatable-kinds.ts +62 -0
- package/src/host/authoring/pixi-creation-site-write-target.ts +2 -2
- package/src/host/authoring/pixi-live-write-target.ts +4 -4
- package/src/host/authoring/pixi-source-identity.ts +3 -3
- package/src/host/authoring/pixi-source-write-target.ts +1709 -0
- package/src/host/authoring/pixi-still-presentation.ts +1 -1
- package/src/host/authoring/pixi-structure-history.ts +2 -2
- package/src/host/authoring/pixi-transform-channels.ts +16 -14
- package/src/host/authoring/source-persistence-backend.ts +3 -3
- package/src/host/authoring/struct-write-pipe.ts +1 -1
- package/src/host/binding-resolver.ts +8 -9
- package/src/host/browser-transpile.ts +1 -1
- package/src/host/canvas-entry-runtime.ts +58 -47
- package/src/host/canvas-preview-frames.ts +482 -0
- package/src/host/components/CameraAuthoringOverlay.tsx +1 -1
- package/src/host/components/HeaderTelemetry.tsx +4 -4
- package/src/host/components/PixiIsolationSceneContent.tsx +11 -11
- package/src/host/components/ThreeIsolationSceneContent.tsx +3 -3
- package/src/host/components/frame-debugger-model.ts +2 -2
- package/src/host/components/header-telemetry-model.ts +2 -2
- package/src/host/components/scene-document.tsx +14 -14
- package/src/host/components/utility-view-state.ts +1 -1
- package/src/host/components/world-root-stage-binding.tsx +12 -12
- package/src/host/components/world-root-stage.ts +70 -49
- package/src/host/coverage/system-adapter-coverage.ts +3 -4
- package/src/host/design-system-stories/fixtures/editor-runtime.tsx +9 -11
- package/src/host/document-preview-three.ts +1 -1
- package/src/host/entry-adjudication.ts +6 -6
- package/src/host/game-css-scope-transform.ts +4 -0
- package/src/host/game-realm-page.ts +1 -1
- package/src/host/gameplay-export.ts +25 -14
- package/src/host/gameplay-recording.ts +5 -5
- package/src/host/gated-globals.ts +2 -2
- package/src/host/history/json-history-resource.ts +1 -1
- package/src/host/projection/pixi.ts +24 -2
- package/src/host/r3f-entry-runtime.ts +65 -34
- package/src/host/react-mount-runtime.ts +7 -48
- package/src/host/realm-services.ts +1 -1
- package/src/host/roots/canvas-root.tsx +373 -0
- package/src/host/roots/r3f-root.tsx +473 -0
- package/src/host/roots/react-root.ts +9 -43
- package/src/host/served-bundle-runtime-modules.ts +3 -19
- package/src/host/server-log-bridge.ts +2 -2
- package/src/host/stories/mounted-story-viewport-source.ts +1 -1
- package/src/host/stories/pixi-story-model.ts +30 -0
- package/src/host/stories/story-media-captures.ts +46 -0
- package/src/host/stories/story-media-presence.ts +3 -3
- package/src/host/stories/story-pixi-preview.ts +408 -0
- package/src/host/stories/story-three-preview.ts +806 -0
- package/src/host/stories/three-story-captures.ts +35 -0
- package/src/host/story-three-preview-runtime.ts +56 -0
- package/src/host/use-active-performance-source.ts +2 -2
- package/src/host/viewport-pose-memory.ts +1 -1
- package/src/host/viewport-root-presentation.ts +6 -5
- package/src/ingest/active-ingest.ts +1 -1
- package/src/ingest/authoring/ingest-dom-surface-authoring.ts +4 -4
- package/src/ingest/authoring/ingest-root-adapter.ts +8 -8
- package/src/ingest/deferred-ingest-play.ts +6 -6
- package/src/ingest/discovery-public-ingest.ts +2 -2
- package/src/ingest/ingest-boot-viewport.ts +2 -2
- package/src/ingest/ingest-canvas-scene-document.tsx +9 -9
- package/src/ingest/ingest-canvas-scene.ts +3 -3
- package/src/ingest/ingest-evidence-hook.ts +1 -1
- package/src/ingest/ingest-frame-snapshot.ts +1 -1
- package/src/ingest/ingest-play-control.ts +1 -1
- package/src/ingest/ingest-render-debug.ts +10 -10
- package/src/ingest/ingest-siblings.ts +13 -25
- package/src/ingest/module-mode.ts +14 -14
- package/src/ingest/mount-canvas-ingest-root.ts +21 -21
- package/src/ingest/mount-coverage.ts +2 -2
- package/src/ingest/mount-dom-ingest-root.ts +11 -11
- package/src/ingest/mount-ingest-root.ts +8 -8
- package/src/ingest/mount-three-ingest-root.ts +8 -8
- package/src/ingest/resolve-canvas.ts +1 -1
- package/src/ingest/served-html-boot.ts +1 -1
- package/src/ingest/surface-canvas.ts +1 -1
- package/src/ingest/unmount-ingest-root.ts +5 -5
- package/src/navmesh/navmesh-handler.ts +24 -16
- package/src/network/NetworkInspectorPanel.tsx +939 -37
- package/src/network/network-inspector-model.ts +20 -2
- package/src/play/play-log-events.ts +1 -1
- package/src/play/play-mode.ts +76 -133
- package/src/play/play-recording.ts +1 -1
- package/src/play/react-play-live-authoring.ts +3 -3
- package/src/play/run-selection.ts +93 -0
- package/src/play-bar/PlayBar.tsx +20 -39
- package/src/profiler/FrameDebuggerPanel.tsx +1 -1
- package/src/profiler/PerformancePanel.tsx +3 -3
- package/src/react/design-time-react-mount.ts +23 -65
- package/src/react/dom-authoring-adapter.ts +9 -9
- package/src/react/react-inspector-section.tsx +5 -5
- package/src/react/react-world-authoring-adapter.ts +11 -11
- package/src/react/story-documents/story-documents.tsx +9 -9
- package/src/react/ui-board-document.tsx +7 -7
- package/src/react/ui-component-board.ts +2 -2
- package/src/runtime/adapter/audio-meter.ts +21 -0
- package/src/runtime/adapter/first-party-audio-system.ts +230 -0
- package/src/runtime/adapter/ingest/contract-debug-adapter.ts +114 -0
- package/src/runtime/adapter/ingest/contract-system-adapters.ts +256 -0
- package/src/runtime/adapter/ingest/merge-debug-adapters.ts +197 -0
- package/src/runtime/adapter/ingest/observation-debug-adapter.ts +162 -0
- package/src/runtime/adapter/ingest/upstream-pin.ts +51 -0
- package/src/runtime/adapter/native-debug-module.ts +498 -0
- package/src/runtime/audio/bus-mixer.ts +161 -0
- package/src/runtime/audio/pose-guard.ts +80 -0
- package/src/runtime/core/frame-pacing.ts +126 -0
- package/src/runtime/core/game-loop.ts +225 -0
- package/src/runtime/core/game-scoped-slot.ts +28 -0
- package/src/runtime/core/seeded-random.ts +162 -0
- package/src/runtime/core/sim-clock.ts +391 -0
- package/src/runtime/core/system-runner.ts +269 -0
- package/src/runtime/core/types.ts +104 -0
- package/src/runtime/create-runtime.ts +1128 -0
- package/src/runtime/debug-bridge.ts +570 -0
- package/src/runtime/debug-registry.ts +899 -0
- package/src/runtime/dev/chrome-trace.ts +153 -0
- package/src/runtime/dev/instruments.ts +403 -0
- package/src/runtime/dev/logger.ts +119 -0
- package/src/runtime/dev/performance-profiler.ts +367 -0
- package/src/runtime/dev/register-render-vitals.ts +276 -0
- package/src/runtime/dev/render-census.ts +354 -0
- package/src/runtime/dev/render-debug-adapter.ts +218 -0
- package/src/runtime/dev/render-memory.ts +226 -0
- package/src/runtime/dev/render-vitals.ts +338 -0
- package/src/runtime/dev/static-batch-advisor.ts +188 -0
- package/src/runtime/dev/webgl-frame-capture.ts +366 -0
- package/src/runtime/dev/webgl-gpu-timer.ts +53 -0
- package/src/runtime/dev-build.ts +47 -0
- package/src/runtime/game.ts +1636 -0
- package/src/runtime/gameplay-rng-trap.ts +135 -0
- package/src/runtime/host-context.ts +64 -0
- package/src/runtime/input-router.ts +182 -0
- package/src/runtime/mount-manifest.ts +480 -0
- package/src/runtime/pixi/authoring.ts +706 -0
- package/src/runtime/pixi/ingest.ts +116 -0
- package/src/runtime/pixi/physics-registry.ts +49 -0
- package/src/runtime/pixi/render-pass-bracket.ts +117 -0
- package/src/runtime/pixi/scene-capture.ts +179 -0
- package/src/runtime/pixi/system-adapters.ts +69 -0
- package/src/runtime/playtest.ts +22 -0
- package/src/runtime/presentation.ts +141 -0
- package/src/runtime/render-control.ts +642 -0
- package/src/runtime/render-seed.ts +77 -0
- package/src/runtime/run-ticks-settled.ts +73 -0
- package/src/runtime/setup/setup-audio.ts +72 -0
- package/src/services/audio-pose-guard.ts +2 -2
- package/src/services/game-audio.ts +152 -0
- package/src/services/game-network.ts +767 -0
- package/src/services/game-physics.ts +334 -0
- package/src/state-watch/StateWatchPanel.tsx +1 -1
- package/src/three/authoring/camera-runtime-inspector-section.tsx +3 -2
- package/src/three/authoring/constraint-inspector-section.tsx +6 -5
- package/src/three/authoring/model-asset-inspector-section.tsx +7 -6
- package/src/three/authoring/oid-source-persistence.ts +7 -7
- package/src/three/authoring/r3f-design-session.ts +58 -54
- package/src/three/authoring/r3f-source-authoring-adapter.ts +95 -91
- package/src/three/authoring/reflection-probe-inspector-section.tsx +3 -2
- package/src/three/authoring/three-authoring-adapter.ts +29 -29
- package/src/three/component-verbs/extract-menu.ts +7 -6
- package/src/three/component-verbs/fork-menu.ts +7 -6
- package/src/three/component-verbs/internals-menu.ts +2 -2
- package/src/three/story-documents/three-story-documents.tsx +13 -13
- package/src/three/three-board/ThreeBoardDocument.tsx +13 -12
- package/src/three/three-board/board-scene.ts +6 -6
- package/src/three/three-board/three-component-board.ts +2 -2
- package/src/services/game-audio-unlock.ts +0 -48
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The game loop's own types. The PHASE VOCABULARY is not here: `SystemPhase`,
|
|
3
|
+
* `PHASE_ORDER`, `SystemPhaseName`, `SystemFn` and `SystemOptions` live in the
|
|
4
|
+
* project contract (`@volter/editor-project/core/system-phase`) because the three.js
|
|
5
|
+
* twin's animation clock orders its evaluators by the same `PHASE_ORDER`, and
|
|
6
|
+
* a vocabulary two shipped twins both read may not be one twin's.
|
|
7
|
+
*/
|
|
8
|
+
import type { SystemFn, SystemPhaseName } from '@volter/editor-project/core/system-phase';
|
|
9
|
+
|
|
10
|
+
export {
|
|
11
|
+
PHASE_ORDER,
|
|
12
|
+
type SystemFn,
|
|
13
|
+
type SystemOptions,
|
|
14
|
+
SystemPhase,
|
|
15
|
+
type SystemPhaseName,
|
|
16
|
+
} from '@volter/editor-project/core/system-phase';
|
|
17
|
+
|
|
18
|
+
export interface SystemRunObserver {
|
|
19
|
+
beginSystem(scope: string, phase: SystemPhaseName, name: string): void;
|
|
20
|
+
endSystem(scope: string, phase: SystemPhaseName, name: string): void;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** A lifecycle system with init/update/dispose hooks. */
|
|
24
|
+
export interface SystemDef {
|
|
25
|
+
/** Stable diagnostic label; falls back to the update function name. */
|
|
26
|
+
readonly name?: string;
|
|
27
|
+
/** Which phase the update function runs in */
|
|
28
|
+
phase: SystemPhaseName;
|
|
29
|
+
/** One-time setup after all entities are spawned, before the first frame */
|
|
30
|
+
init?(): void;
|
|
31
|
+
/** Per-frame update */
|
|
32
|
+
update: SystemFn;
|
|
33
|
+
/** Cleanup when the system is removed or the scene unloads */
|
|
34
|
+
dispose?(): void;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface GameLoopConfig {
|
|
38
|
+
/** Fixed timestep in seconds (default: 1/60) */
|
|
39
|
+
fixedTimestep?: number;
|
|
40
|
+
/** Max physics substeps per frame to prevent spiral of death (default: 8) */
|
|
41
|
+
maxSubSteps?: number;
|
|
42
|
+
/**
|
|
43
|
+
* Called once per consumed fixed substep — the SIM half. A real frame whose
|
|
44
|
+
* accumulator produces zero substeps calls this zero times, which is exactly
|
|
45
|
+
* why {@link GameLoopConfig.render} exists.
|
|
46
|
+
*
|
|
47
|
+
* Whether the `render`/`preRender` phases run inside this call is the
|
|
48
|
+
* CALLER's choice, not this loop's: a host that also passes `render` below
|
|
49
|
+
* asks `Game.runFrame` to skip them (`skipRenderPhases`), a host that does
|
|
50
|
+
* not keeps them here as the tail of `PHASE_ORDER`. See `game-loop.ts`'s
|
|
51
|
+
* module doc.
|
|
52
|
+
*/
|
|
53
|
+
update: (dt: number) => void;
|
|
54
|
+
/**
|
|
55
|
+
* Called EXACTLY ONCE per real (rAF) frame — the PRESENTATION half.
|
|
56
|
+
*
|
|
57
|
+
* - `alpha` — `accumulator / fixedDt` after this frame's substeps were
|
|
58
|
+
* consumed, in `[0, 1]`: how far presentation sits past the last
|
|
59
|
+
* completed fixed state. `core/frame-pacing.ts` computes it.
|
|
60
|
+
* - `displayDt` — this display frame's own delta in seconds, clamped and
|
|
61
|
+
* `timeScale`d exactly like the sim's time. Integrate per-display-frame
|
|
62
|
+
* motion against this, never against `fixedTimestep`.
|
|
63
|
+
*
|
|
64
|
+
* Optional. Never invoked at all in {@link GameLoopConfig.externalDrive}
|
|
65
|
+
* mode, where `frame()` itself never runs.
|
|
66
|
+
*/
|
|
67
|
+
render?: (alpha: number, displayDt: number) => void;
|
|
68
|
+
/**
|
|
69
|
+
* External-drive mode (I2): when `true`, `start()` never arms a
|
|
70
|
+
* `requestAnimationFrame` chain and never installs the
|
|
71
|
+
* `visibilitychange`/`document.hidden` auto-stop handler — so a
|
|
72
|
+
* headless/backgrounded capture page cannot have its loop silently killed by
|
|
73
|
+
* the tab-hidden guard, and `config.update` is never invoked by
|
|
74
|
+
* wall-clock/RAF timing at all. The caller (a render harness) drives frames
|
|
75
|
+
* itself instead — see `runtime/render-control.ts`, which calls a world's
|
|
76
|
+
* phase hooks directly rather than going through this loop's `update`
|
|
77
|
+
* callback. Default `false` (normal wall-clock RAF playback, unchanged).
|
|
78
|
+
*/
|
|
79
|
+
externalDrive?: boolean;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Truthful liveness classification for `createGameLoop`'s returned loop
|
|
84
|
+
* (issue #175 — "state must never claim health it cannot observe"). See
|
|
85
|
+
* `GameLoop.liveness`'s doc comment in `game-loop.ts` for the full contract;
|
|
86
|
+
* exported here (rather than only inline on the loop's return type) so
|
|
87
|
+
* callers elsewhere in the engine (`runtime/game.ts`, `runtime/
|
|
88
|
+
* debug-registry.ts`) can name the union without importing `game-loop.ts`
|
|
89
|
+
* as a value.
|
|
90
|
+
*
|
|
91
|
+
* - `'running'` — a real rAF callback arrived recently (or, for an
|
|
92
|
+
* `externalDrive` loop, `start()` has been called — see that mode's own
|
|
93
|
+
* liveness note below).
|
|
94
|
+
* - `'loop-starved'` — the host loop has made no recent rAF progress: either
|
|
95
|
+
* the T2.1 visibility gate deliberately parked it, or an armed visible-page
|
|
96
|
+
* callback has not arrived within the starvation threshold. This reports
|
|
97
|
+
* the LOOP measurement, never a conclusion about where the browser tab is.
|
|
98
|
+
* - `'stopped'` — `stop()` was called, or `start()` was never called.
|
|
99
|
+
*
|
|
100
|
+
* `isRunning` says whether the rAF chain is armed; it can therefore remain
|
|
101
|
+
* `true` while a visible browser starves callbacks. Read `liveness` wherever
|
|
102
|
+
* "is this host loop actually advancing" matters.
|
|
103
|
+
*/
|
|
104
|
+
export type GameLoopLiveness = 'running' | 'loop-starved' | 'stopped';
|