@wildshard/engine 0.1.21 → 0.1.23

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.
Files changed (144) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/lint/engine-sides.json +5 -0
  3. package/lint/shardfile-boundaries.mjs +4 -2
  4. package/lint/sim-players.json +2 -13
  5. package/lint/wildshard-plugin.js +1 -1
  6. package/package.json +10 -2
  7. package/scripts/apfs-clone.mjs +5 -2
  8. package/scripts/app-build/catalogue.ts +39 -8
  9. package/scripts/app-build/serviceWorker.ts +4 -1
  10. package/scripts/app-build/splitOutput.mjs +33 -11
  11. package/scripts/audio-download-proof.mjs +1 -1
  12. package/scripts/check-spelled-paths.mjs +6 -3
  13. package/scripts/ci-pack.mjs +3 -3
  14. package/scripts/committed-fast-checks.mjs +2 -2
  15. package/scripts/engine-ci-shard.mjs +11 -0
  16. package/scripts/failmode-cases.mjs +1 -1
  17. package/scripts/failmode-proof.mjs +35 -11
  18. package/scripts/fight-page-census.mjs +131 -0
  19. package/scripts/goldens/board.py +44 -11
  20. package/scripts/goldens/native-residency.d.mts +1 -0
  21. package/scripts/goldens/native-residency.mjs +18 -4
  22. package/scripts/grid-crossing-walk-proof.mjs +3 -3
  23. package/scripts/hover-speed-probe.mjs +2 -2
  24. package/scripts/keep-copy.mjs +120 -0
  25. package/scripts/land.mjs +36 -6
  26. package/scripts/lane-live.mjs +136 -0
  27. package/scripts/leftovers-report.mjs +47 -0
  28. package/scripts/loading-card-proof.mjs +42 -9
  29. package/scripts/loading-flow/benchmax.mjs +57 -7
  30. package/scripts/loading-flow/stalls.d.mts +2 -0
  31. package/scripts/loading-flow/stalls.mjs +13 -0
  32. package/scripts/mmo-bots.mjs +11 -5
  33. package/scripts/mmo-grid-proof.mjs +74 -0
  34. package/scripts/mmo-seat-proof.mjs +43 -0
  35. package/scripts/net-lag-proof.mjs +1 -1
  36. package/scripts/nightly-heads.ts +13 -13
  37. package/scripts/nightly-model.ts +26 -12
  38. package/scripts/nightly.proof.ts +18 -5
  39. package/scripts/nightly.ts +13 -8
  40. package/scripts/no-astc-boot.mjs +77 -0
  41. package/scripts/online-rig.mjs +7 -7
  42. package/scripts/parity/boot-smoke.mjs +1 -1
  43. package/scripts/physics-route.json +6 -6
  44. package/scripts/pins-reuse.mjs +1 -0
  45. package/scripts/pins-staging.ts +54 -0
  46. package/scripts/pins.ts +5 -0
  47. package/scripts/release-cook.mjs +6 -2
  48. package/scripts/ring3.proof.ts +71 -0
  49. package/scripts/ring3.ts +100 -0
  50. package/scripts/scratch-dir.mjs +31 -12
  51. package/scripts/scratch-sweep.mjs +15 -23
  52. package/scripts/server-release/items.d.mts +7 -0
  53. package/scripts/server-release/items.mjs +28 -0
  54. package/scripts/server-release/publish.mjs +9 -1
  55. package/scripts/side-parity.mjs +1 -1
  56. package/scripts/test-products.json +1 -21
  57. package/scripts/tsconfig.json +2 -0
  58. package/scripts/vitest-ci-files.ts +5 -1
  59. package/scripts/vps/cook-follow.d.mts +6 -0
  60. package/scripts/vps/cook-follow.mjs +45 -0
  61. package/scripts/vps/harden-apply.sh +10 -1
  62. package/scripts/vps/rebuild.sh +104 -36
  63. package/scripts/vps/wildshard-config +106 -3
  64. package/scripts/warm-native-chrome.mjs +9 -3
  65. package/scripts/worker-client-fights.mjs +9 -3
  66. package/scripts/worktree-reap.mjs +15 -131
  67. package/scripts/worktree.mjs +92 -12
  68. package/src/client/app/entry.ts +2 -3
  69. package/src/client/engine/audio/audioLog.ts +7 -2
  70. package/src/client/engine/boot/contentRead.ts +24 -4
  71. package/src/client/engine/boot/diagnostics.ts +69 -1
  72. package/src/client/engine/boot/downloadGiveUp.ts +34 -0
  73. package/src/client/engine/combat/EquipmentService.ts +2 -0
  74. package/src/client/engine/core/Game.ts +6 -2
  75. package/src/client/engine/core/ktx2.ts +5 -3
  76. package/src/client/engine/core/ktx2Zstd.ts +2 -1
  77. package/src/client/engine/pwa/sw.js +26 -8
  78. package/src/client/engine/render/dataLook.ts +14 -7
  79. package/src/client/engine/render/lookLight.ts +64 -20
  80. package/src/client/engine/ui/Loading.ts +6 -8
  81. package/src/client/engine/ui/downloadFailed.ts +54 -0
  82. package/src/client/engine/ui/lookLightOption.ts +1 -1
  83. package/src/client/game/audio/cueDirector.ts +2 -1
  84. package/src/client/game/boot/spawnDownload.ts +12 -1
  85. package/src/client/game/boss/arenaRoom.ts +4 -3
  86. package/src/client/game/boss/roamingProjection.ts +1 -1
  87. package/src/client/game/devScene/hook.ts +1 -1
  88. package/src/client/game/devScene/liveLook.ts +1 -1
  89. package/src/client/game/grid/copyPrompts.ts +3 -4
  90. package/src/client/game/grid/dataCellKit.ts +99 -0
  91. package/src/client/game/grid/enteredEquipment.ts +11 -2
  92. package/src/client/game/grid/live.ts +9 -299
  93. package/src/client/game/grid/liveSession.ts +31 -8
  94. package/src/client/game/grid/neighbourLife.ts +50 -32
  95. package/src/client/game/grid/products.ts +21 -7
  96. package/src/client/game/grid/reveal.ts +7 -2
  97. package/src/client/game/grid/session.ts +10 -74
  98. package/src/client/game/plugin/weaponFamily.ts +6 -0
  99. package/src/client/game/population/signals.ts +1 -1
  100. package/src/client/game/quest/chapterDirector.ts +1 -0
  101. package/src/client/game/shardfile/clientBossTelegraph.ts +4 -3
  102. package/src/client/game/shardfile/clientWorker.ts +35 -9
  103. package/src/client/game/shardfile/look.ts +1 -1
  104. package/src/client/game/shardfile/runtimeProduct.ts +9 -5
  105. package/src/client/game/shardfile/wirePage.ts +5 -2
  106. package/src/client/game/shardfile/worldSceneTextures.ts +15 -9
  107. package/src/client/host/online/shell.ts +37 -13
  108. package/src/cook/game/cookWorker.ts +8 -5
  109. package/src/cook/game/tierTextures.ts +5 -3
  110. package/src/server/engine/net/simWorld.ts +3 -4
  111. package/src/server/game/grid/cellHome.ts +58 -0
  112. package/src/server/game/grid/room.ts +2 -38
  113. package/src/server/game/grid/simulation.ts +5 -4
  114. package/src/server/game/plugin/mover.ts +18 -14
  115. package/src/server/game/shardfile/declaredKitItems.ts +39 -9
  116. package/src/server/host/bake/headlessWorker.ts +3 -3
  117. package/src/server/host/dedicated/cellHost.ts +2 -2
  118. package/src/server/host/dedicated/cellProtocol.ts +1 -1
  119. package/src/server/host/dedicated/cellWorker.ts +5 -3
  120. package/src/server/host/dedicated/dedicatedRoom.ts +8 -3
  121. package/src/server/host/dedicated/gridCells.ts +5 -3
  122. package/src/server/host/dedicated/main.ts +12 -7
  123. package/src/server/host/dedicated/packReader.ts +15 -2
  124. package/src/server/host/dedicated/playerStore.ts +1 -1
  125. package/src/server/host/dedicated/workerTable.ts +0 -10
  126. package/src/server/host/dedicated/world.ts +39 -5
  127. package/src/server/host/headlessRuntime.ts +11 -6
  128. package/src/server/host/standalone/cellWorld.ts +21 -7
  129. package/src/server/host/standalone/gridServer.ts +3 -1
  130. package/src/server/host/standalone/roadWorld.ts +6 -0
  131. package/src/shared/engine/physics/gridBorders.ts +15 -1
  132. package/src/shared/engine/saves/shape.ts +17 -2
  133. package/src/shared/engine/sim/snapshot.ts +5 -5
  134. package/src/shared/engine/strings.ts +10 -0
  135. package/src/shared/game/grid/placementRows.ts +4 -3
  136. package/src/shared/game/ledger.ts +13 -4
  137. package/src/shared/game/loot/platformCatalogue.ts +14 -0
  138. package/src/shared/game/quest/ledger.ts +3 -3
  139. package/src/shared/game/shardfile/items.ts +9 -1
  140. package/src/shared/host/headlessJourney.ts +3 -3
  141. package/src/shared/host/headlessTape.ts +7 -6
  142. package/src/shared/host/releaseRows.ts +4 -1
  143. package/src/client/game/grid/cellLoading.ts +0 -110
  144. package/src/client/game/grid/cellScreens.ts +0 -48
@@ -1,110 +0,0 @@
1
- /**
2
- * G555 (Jake, 2026-10-21): one loading screen, the detailed step-by-step one, everywhere. A grid cell entry or re-entry
3
- * that waits shows the same screen as SHARD SELECT (`Loading`, in its scoped mid-play mode, on the `cell` loading path)
4
- * over the region's live admission: product, region world, equipment, gameplay, colliders and simulation, the entry
5
- * warm-up, then entry. It replaced G217's in-world hex card (`cellScreen.ts`, deleted with its 4-step plan).
6
- *
7
- * `cellLoadingStep` is the pure part: a cell's live state to its current step and detail, a refusal's reason, or done.
8
- * `CellLoading` owns the one scoped screen: it opens on the cell the traveller waits at (or has entered before it is
9
- * gameplay-ready), steps it at most a few times a second, and fades it out when the cell is ready or left.
10
- *
11
- * QA 2026-11-13 (Jake: "make it look the same as the one for Shard Select"): G578's in-world canvas panel is gone; the
12
- * screen is SHARD SELECT's own card again, drawn as a screen-space inset over the live world (`cellScreens.ts`).
13
- */
14
- import { loadingPath } from '../boot/loadingPaths';
15
-
16
- /** One waiting cell's live admission, read through the grid session's read-only port. */
17
- export interface CellLoadingInput {
18
- readonly instance: string; readonly slug: string; readonly name: string;
19
- /** the admission refused this shard, or it cannot enter the grid yet: the screen shows why */
20
- readonly refusal: string | null;
21
- /** its product is admitted (its claim in the one allocator) and how much it holds */
22
- readonly product: boolean; readonly claimedMB: number;
23
- /** the readiness fences */
24
- readonly requested: boolean; readonly runtime: boolean; readonly colliders: boolean; readonly sim: boolean;
25
- /** a runtime region's entered hooks finished since this load began, and the one running now */
26
- readonly hooks: ReadonlySet<string>; readonly hook: string | null;
27
- /** whether it has hooks at all (a declared bodyless region has none) */
28
- readonly hybrid: boolean;
29
- /** the traveller is in it; and its gameplay is ready */
30
- readonly entered: boolean; readonly gameplayReady: boolean;
31
- /** Running warm-up of this destination root; absent for a bodyless or not-yet-warming cell. */
32
- readonly warm?: { readonly phase: string; readonly completed: boolean;
33
- readonly progress: { readonly done: number; readonly total: number; readonly detail: string } | null } | null;
34
- }
35
- export type CellLoadingStep = { readonly kind: 'step'; readonly key: string; readonly detail: string }
36
- | { readonly kind: 'failed'; readonly reason: string } | { readonly kind: 'done' };
37
-
38
- /** The cell's current step on the `cell` path, its detail, its refusal, or done (entered and gameplay-ready). */
39
- export function cellLoadingStep(input: CellLoadingInput): CellLoadingStep {
40
- if (input.refusal !== null) return { kind: 'failed', reason: input.refusal };
41
- if (input.entered && input.gameplayReady) return { kind: 'done' };
42
- if (input.warm !== undefined && input.warm !== null && input.hook === 'afterPlay') {
43
- if (input.warm.completed) return { kind: 'step', key: 'warm', detail: 'Entry warm-up complete' };
44
- const phases: Readonly<Record<string, string>> = { 'before-warm': 'Prepare scene lighting', 'post-preparation': 'Prepare render effects',
45
- 'shaders-and-composer': 'Compile shaders', 'shader-links': 'Link shaders', 'texture-uploads': 'Upload textures',
46
- 'parked-viewmodels': 'Warm held models', 'parked-draws': 'Warm scene draws', 'offscreen-draws': 'Warm render passes' };
47
- const phase = phases[input.warm.phase] ?? 'Prepare first frame', work = input.warm.progress;
48
- return { kind: 'step', key: 'warm', detail: work === null ? phase : `${phase} · ${work.detail}` };
49
- }
50
- const hooksDone = (last: string): boolean => !input.hybrid || input.hooks.has(last);
51
- if (!input.product) return { kind: 'step', key: 'world', detail: input.requested ? 'reading its region files' : 'requested as you approach' };
52
- // QA 11-13 row 43: a resident product but no readiness request is a world nobody is building yet; its hooks are a past
53
- // visit's, not progress (a return visit read "saved state and its systems" for 11 s while nothing built it)
54
- if (!input.requested) return { kind: 'step', key: 'world', detail: 'waiting for its world to start' };
55
- const running = input.hook === null ? '' : ` · ${input.hook}`;
56
- if (!hooksDone('afterWorld')) return { kind: 'step', key: 'world', detail: `${input.claimedMB.toFixed(0)} MB admitted${running}` };
57
- if (!hooksDone('afterKit')) return { kind: 'step', key: 'loadout', detail: `weapons, held items and HUD${running}` };
58
- if (!hooksDone('afterPlay') || !input.runtime) return { kind: 'step', key: 'gameplay', detail: `saved state and its systems${running}` };
59
- if (!input.colliders || !input.sim) return { kind: 'step', key: 'colliders', detail: `${input.colliders ? 'colliders ready' : 'colliders'} · ${input.sim ? 'simulation ready' : 'simulation'}` };
60
- if (!input.entered) return { kind: 'step', key: 'enter', detail: 'ready: drive in' };
61
- return { kind: 'step', key: input.hook === 'activate' ? 'enter' : 'warm', detail: `preparing its first frame${running}` };
62
- }
63
-
64
- /** One row of the screen: its label and whether it is done, running now (with the detail) or still to come. */
65
- export interface CellLoadingRow { readonly label: string; readonly state: 'done' | 'now' | 'next' }
66
- /** What the screen shows: whose cell, the step running now (a key of the `cell` path), its rows and detail, or the refusal. */
67
- export interface CellLoadingView { readonly instance: string; readonly name: string; readonly step: string; readonly rows: readonly CellLoadingRow[];
68
- readonly detail: string; readonly failed: string | null }
69
- /** The screen a waiting cell's steps draw on: shown (or stepped) per poll, hidden when the cell is entered or left. */
70
- export interface CellLoadingScreen { readonly show: (view: CellLoadingView) => void; readonly hide: (entered: boolean) => void }
71
- /** The waiting cell's steps on the loading card (`CellLoadingScreen`); the 3D world, the road and the other cells stay live. */
72
- export class CellLoading {
73
- private instance: string | null = null;
74
- /** the step shown: a running hook's own step, else the furthest reached (a region learns it has hooks only when they
75
- * start, so between hooks a row never goes back) */
76
- private reached = -1;
77
- /** GC8: the step the screen shows now and its detail, for a harness to time each step (null while closed). */
78
- private shown: { readonly step: string; readonly detail: string } | null = null;
79
- /** `known`: whether the waiting cell is one of this session's neighbours (no screen for one that is not) */
80
- constructor(private readonly screen: CellLoadingScreen, private readonly known: (instance: string) => boolean) {}
81
- /** Show, step or hide the screen from this cell's live state (null: no cell is waiting). */
82
- step(input: CellLoadingInput | null): void {
83
- if (input === null || input.instance !== this.instance) this.close();
84
- if (input === null) return;
85
- const step = cellLoadingStep(input);
86
- if (step.kind === 'done' || !this.known(input.instance)) { this.close(step.kind === 'done'); return; }
87
- this.instance = input.instance;
88
- const path = loadingPath('cell').steps;
89
- if (step.kind === 'step') {
90
- const index = path.findIndex(row => row.key === step.key);
91
- this.reached = input.hook === null ? Math.max(this.reached, index) : index;
92
- }
93
- const rows = path.map((row, i): CellLoadingRow => ({ label: row.label, state: i < this.reached ? 'done' : i === this.reached ? 'now' : 'next' }));
94
- const detail = step.kind === 'step' ? step.detail : '';
95
- this.shown = { step: path[Math.max(0, this.reached)]?.key ?? '', detail };
96
- this.screen.show({ instance: input.instance, name: input.name, step: this.shown.step, rows, detail,
97
- failed: step.kind === 'failed' ? step.reason : null });
98
- }
99
- /** The screen's cell (null: none shown). */
100
- get open(): string | null { return this.instance; }
101
- /** NET-LAG NL7: the row the screen shows running now (its label), null when none is shown: a proof times each stage. */
102
- get stage(): string | null { return this.instance === null || this.reached < 0 ? null : loadingPath('cell').steps[this.reached]?.label ?? null; }
103
- /** GC8: the step shown now and its detail, or null. */
104
- get now(): { readonly step: string; readonly detail: string } | null { return this.instance === null ? null : this.shown; }
105
- /** Hide the screen: `entered`, the cell is ready (the card completes and fades); else it was left or cancelled. */
106
- close(entered = false): void {
107
- const was = this.instance; this.instance = null; this.reached = -1; this.shown = null;
108
- if (was !== null) this.screen.hide(entered);
109
- }
110
- }
@@ -1,48 +0,0 @@
1
- /**
2
- * QA 2026-11-13 (Jake: "This loading screen here, I have no idea why this loading screen in the 3D world is completely
3
- * different from the new one ... make it look the same as the one for Shard Select"): a waiting cell's steps on SHARD
4
- * SELECT's own loading card (`Loading`, scoped, in its `inset` mode), a crisp screen-space card over the live world. It
5
- * replaced G578's blurry canvas panel standing in 3D beyond the cell's wall (`CellScreen`, removed). The card opens when
6
- * a cell's preparation shows, steps with it, completes and fades when the cell is entered, and goes at once when the
7
- * traveller leaves or the session ends. Presentation only: `CellLoading` decides what it shows.
8
- */
9
- import { Loading } from '@wildshard/engine/ui/Loading';
10
- import { loadingPath } from '../boot/loadingPaths';
11
- import type { CellLoadingScreen, CellLoadingView } from './cellLoading';
12
-
13
- export class CellLoadingCard implements CellLoadingScreen {
14
- private card: { readonly instance: string; readonly loading: Loading; failed: string | null } | null = null;
15
- /** an entered cell's card while it completes and fades: a new card or a leave ends it at once */
16
- private fading: Loading | null = null;
17
-
18
- show(view: CellLoadingView): void {
19
- // a cleared refusal starts a fresh card: a failed card keeps its reason until it is disposed
20
- if (this.card !== null && (this.card.instance !== view.instance || this.card.failed !== null && view.failed === null)) this.hide(false);
21
- let card = this.card;
22
- if (card === null) {
23
- this.fading?.scope.dispose(); this.fading = null;
24
- const loading = new Loading({ id: view.instance, name: view.name }, { scoped: true, inset: true });
25
- loading.setPath(loadingPath('cell'));
26
- card = this.card = { instance: view.instance, loading, failed: null };
27
- }
28
- if (view.failed !== null) {
29
- if (card.failed !== view.failed) { card.failed = view.failed; card.loading.scopedFail(view.failed); }
30
- return;
31
- }
32
- card.loading.scopedStep(view.step, view.detail);
33
- }
34
-
35
- hide(entered: boolean): void {
36
- const card = this.card;
37
- if (!entered) { this.fading?.scope.dispose(); this.fading = null; }
38
- if (card === null) return;
39
- this.card = null;
40
- if (entered && card.failed === null) {
41
- const fading = this.fading = card.loading;
42
- void fading.done().then(() => { if (this.fading === fading) this.fading = null; return undefined; }, () => undefined);
43
- } else card.loading.scope.dispose();
44
- }
45
-
46
- /** The card's root while one is up (tests and proofs read it). */
47
- get root(): HTMLElement | null { return this.card?.loading.root ?? null; }
48
- }