@wildshard/engine 0.1.15 → 0.1.17

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 (207) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/index.html +157 -11
  3. package/lint/engine-sides.json +16 -0
  4. package/lint/host-register.json +496 -0
  5. package/lint/ratchet.json +2 -2
  6. package/lint/shard-imports.d.mts +1 -0
  7. package/lint/shard-imports.mjs +56 -8
  8. package/lint/wildshard-plugin.js +22 -4
  9. package/package.json +16 -5
  10. package/scripts/app-build/buildIdentity.d.mts +3 -1
  11. package/scripts/app-build/buildIdentity.mjs +25 -5
  12. package/scripts/app-build/builtAt.d.mts +4 -0
  13. package/scripts/app-build/builtAt.mjs +21 -0
  14. package/scripts/app-build/serviceWorker.ts +16 -2
  15. package/scripts/app-build/versionFiles.ts +2 -1
  16. package/scripts/app-build-pipeline.mjs +4 -1
  17. package/scripts/audio-download-proof.mjs +843 -0
  18. package/scripts/build-app.mjs +4 -0
  19. package/scripts/build-mirror.d.mts +2 -0
  20. package/scripts/build-mirror.mjs +5 -4
  21. package/scripts/built-product.mjs +3 -3
  22. package/scripts/cell-mem/metrics-preload.mjs +65 -0
  23. package/scripts/cell-mem-bench.mjs +130 -0
  24. package/scripts/check-chunks.mjs +2 -1
  25. package/scripts/devserver-client.d.mts +5 -0
  26. package/scripts/devserver-client.mjs +68 -0
  27. package/scripts/engine-ci-budget.ts +7 -1
  28. package/scripts/format-lock.mjs +20 -11
  29. package/scripts/generate-title-launch.mjs +3 -2
  30. package/scripts/grid-crossing-walk-proof.mjs +16 -8
  31. package/scripts/heavy-lane.py +25 -1
  32. package/scripts/host-ruler/register-migrate.mjs +242 -0
  33. package/scripts/host-ruler/register.d.mts +36 -0
  34. package/scripts/host-ruler/register.mjs +116 -0
  35. package/scripts/host-ruler/roots.d.mts +29 -0
  36. package/scripts/host-ruler/roots.mjs +333 -0
  37. package/scripts/host-ruler/server-roots.d.mts +23 -0
  38. package/scripts/host-ruler/server-roots.mjs +272 -0
  39. package/scripts/main-watch.d.mts +1 -1
  40. package/scripts/main-watch.mjs +10 -6
  41. package/scripts/map-hash.mjs +3 -6
  42. package/scripts/mmo-bots.mjs +2 -2
  43. package/scripts/offline-proof-rules.d.mts +1 -0
  44. package/scripts/offline-proof-rules.mjs +22 -1
  45. package/scripts/online-rig.mjs +4 -4
  46. package/scripts/page-release/flow.d.mts +1 -0
  47. package/scripts/page-release/flow.mjs +6 -2
  48. package/scripts/page-release.mjs +5 -1
  49. package/scripts/physics-route.json +0 -71
  50. package/scripts/pins-catalogue.ts +103 -0
  51. package/scripts/pins-reuse.mjs +3 -1
  52. package/scripts/pins.ts +22 -14
  53. package/scripts/preview-grid.ts +203 -0
  54. package/scripts/road-preload-proof.mjs +167 -0
  55. package/scripts/server-release/publish.mjs +2 -2
  56. package/scripts/server-release/served-slug.d.mts +2 -0
  57. package/scripts/server-release/served-slug.mjs +10 -0
  58. package/scripts/server-release/sign.d.mts +1 -0
  59. package/scripts/server-release/sign.mjs +3 -7
  60. package/scripts/shard-components.mjs +0 -2
  61. package/scripts/shard-outputs.d.mts +8 -0
  62. package/scripts/shard-outputs.mjs +45 -11
  63. package/scripts/side-parity.d.mts +2 -1
  64. package/scripts/side-parity.mjs +25 -4
  65. package/scripts/test-amber.d.mts +1 -0
  66. package/scripts/test-amber.mjs +10 -0
  67. package/scripts/test-products.json +3 -3
  68. package/scripts/tracked-public.d.mts +1 -0
  69. package/scripts/tracked-public.mjs +17 -0
  70. package/src/cli/engine.mjs +8 -0
  71. package/src/client/app/bootRoute.ts +4 -1
  72. package/src/client/app/dropModal.ts +15 -2
  73. package/src/client/app/entry.ts +67 -11
  74. package/src/client/app/slugPath.ts +5 -0
  75. package/src/client/engine/audio/Audio.ts +20 -2
  76. package/src/client/engine/boot/bakedTextures.ts +3 -2
  77. package/src/client/engine/boot/bootTrace.ts +6 -1
  78. package/src/client/engine/boot/bytes.ts +4 -3
  79. package/src/client/engine/boot/clearDownloads.ts +1 -1
  80. package/src/client/engine/boot/contentRead.ts +4 -0
  81. package/src/client/engine/boot/dropNotice.ts +20 -6
  82. package/src/client/engine/boot/gpuFiles.ts +25 -2
  83. package/src/client/engine/boot/lastEnd.ts +8 -2
  84. package/src/client/engine/boot/shardPrefetch.ts +7 -1
  85. package/src/client/engine/boot/sw.ts +19 -0
  86. package/src/client/engine/core/Game.ts +11 -3
  87. package/src/client/engine/core/GpuRecovery.ts +7 -0
  88. package/src/client/engine/core/Volumetrics.ts +5 -0
  89. package/src/client/engine/core/assets.ts +27 -20
  90. package/src/client/engine/core/bootstrap.ts +1 -2
  91. package/src/client/engine/core/ktx2.ts +84 -11
  92. package/src/client/engine/explore/Compare.ts +2 -2
  93. package/src/client/engine/explore/TouchFly.ts +3 -5
  94. package/src/client/engine/input/dom.ts +12 -0
  95. package/src/client/engine/net/predictor.ts +6 -2
  96. package/src/client/engine/player/Player.ts +10 -2
  97. package/src/client/engine/player/TouchControls.ts +12 -4
  98. package/src/client/engine/pwa/sw.js +47 -8
  99. package/src/client/engine/render/drawCheck.ts +96 -0
  100. package/src/client/engine/saves/staleBuildNote.ts +46 -0
  101. package/src/client/engine/telemetry/browserErrors.ts +157 -20
  102. package/src/client/engine/telemetry/screenOutbox.ts +61 -0
  103. package/src/client/engine/telemetry/staleBuildReport.ts +12 -0
  104. package/src/client/engine/ui/DeathFade.ts +99 -11
  105. package/src/client/engine/ui/ErrorModal.ts +13 -6
  106. package/src/client/engine/ui/Feedback.ts +2 -1
  107. package/src/client/engine/ui/Loading.ts +10 -6
  108. package/src/client/engine/ui/Map.ts +2 -1
  109. package/src/client/engine/ui/WeaponStrip.ts +2 -1
  110. package/src/client/engine/ui/backGuard.ts +104 -0
  111. package/src/client/engine/ui/hudAdapters.ts +30 -4
  112. package/src/client/engine/ui/loading.css +17 -0
  113. package/src/client/engine/ui/namePrompt.ts +6 -5
  114. package/src/client/engine/ui/styles/combat.css +12 -0
  115. package/src/client/engine/ui/styles/namePrompt.css +4 -2
  116. package/src/client/game/boot/audio.generated.ts +0 -294
  117. package/src/client/game/boot/bytes.generated.ts +0 -11
  118. package/src/client/game/boot/versions.generated.ts +0 -11
  119. package/src/client/game/compendium/keepsakes.ts +16 -6
  120. package/src/client/game/grapple/tool.ts +10 -7
  121. package/src/client/game/grid/cellLoading.ts +23 -12
  122. package/src/client/game/grid/cellScreens.ts +39 -74
  123. package/src/client/game/grid/liveSession.ts +40 -7
  124. package/src/client/game/grid/nearPlaceholderPlan.ts +8 -0
  125. package/src/client/game/grid/nearPlaceholderView.ts +9 -3
  126. package/src/client/game/grid/oneWayIn.ts +92 -27
  127. package/src/client/game/grid/pageEntry.ts +19 -0
  128. package/src/client/game/grid/pageShell.ts +1 -1
  129. package/src/client/game/grid/plotAudio.ts +114 -0
  130. package/src/client/game/grid/products.ts +55 -5
  131. package/src/client/game/grid/roadLookPlatform.ts +2 -2
  132. package/src/client/game/grid/session.ts +38 -22
  133. package/src/client/game/grid/spawnGround.ts +68 -0
  134. package/src/client/game/grid/voidLook.ts +29 -23
  135. package/src/client/game/loot/runtime.ts +3 -1
  136. package/src/client/game/mainMenu.ts +14 -6
  137. package/src/client/game/riding/hud.ts +6 -4
  138. package/src/client/game/session/finish.ts +17 -3
  139. package/src/client/game/session/play.ts +8 -2
  140. package/src/client/game/session/session.ts +4 -1
  141. package/src/client/game/shardfile/clientWorker.ts +41 -12
  142. package/src/client/game/shardfile/serverRoute.ts +10 -22
  143. package/src/client/game/slugPage.css +11 -0
  144. package/src/client/game/slugPage.ts +84 -0
  145. package/src/client/game/systems/viewmodel/heldView.ts +6 -3
  146. package/src/client/game/titleDeck.ts +55 -32
  147. package/src/client/host/online/doctor.ts +7 -6
  148. package/src/client/host/online/linkScreens.ts +16 -0
  149. package/src/client/host/online/release.ts +51 -5
  150. package/src/client/host/online/shell.ts +48 -27
  151. package/src/client/host/standalone/shell.ts +7 -3
  152. package/src/cook/game/audioReport.ts +57 -0
  153. package/src/cook/game/entryTotals.ts +26 -6
  154. package/src/cook/game/installedRuntimeReads.ts +3 -0
  155. package/src/server/engine/sim/respawn.ts +6 -1
  156. package/src/server/engine/sim.ts +3 -0
  157. package/src/server/game/grid/simulation.ts +35 -0
  158. package/src/server/game/loot/harvest.ts +2 -0
  159. package/src/server/game/loot/keepsakeProgression.ts +40 -0
  160. package/src/server/game/loot/playerOwned.ts +5 -1
  161. package/src/server/game/plugin/simulation.ts +4 -0
  162. package/src/server/game/population/nativeBake.ts +2 -1
  163. package/src/server/game/quest/chapterRecords.ts +2 -0
  164. package/src/server/game/quest/serverChapters.ts +4 -0
  165. package/src/server/game/quest/serverDoors.ts +11 -5
  166. package/src/server/game/roomRespawn.ts +4 -0
  167. package/src/server/game/shardfile/installedSides.ts +18 -0
  168. package/src/server/game/shardfile/nativeAssemblyHosts.ts +19 -10
  169. package/src/server/game/shardfile/nativeAssemblyInput.ts +1 -4
  170. package/src/server/host/bake/headlessWorker.ts +5 -1
  171. package/src/server/host/dedicated/cellHost.ts +98 -29
  172. package/src/server/host/dedicated/cellProtocol.ts +11 -1
  173. package/src/server/host/dedicated/cellWorker.ts +9 -3
  174. package/src/server/host/dedicated/crossing.ts +6 -2
  175. package/src/server/host/dedicated/dedicatedRoom.ts +21 -8
  176. package/src/server/host/dedicated/gridCells.ts +52 -9
  177. package/src/server/host/dedicated/main.ts +31 -12
  178. package/src/server/host/dedicated/placementFile.ts +72 -0
  179. package/src/server/host/dedicated/releaseFile.ts +17 -10
  180. package/src/server/host/dedicated/roadRoom.ts +21 -5
  181. package/src/server/host/dedicated/workerTable.ts +13 -1
  182. package/src/server/host/dedicated/world.ts +81 -9
  183. package/src/server/host/headlessRuntime.ts +10 -5
  184. package/src/server/host/installers.ts +62 -0
  185. package/src/server/host/openWorld.ts +59 -0
  186. package/src/server/host/ropeDecks.ts +2 -0
  187. package/src/server/host/standalone/cellWorld.ts +25 -19
  188. package/src/server/host/standalone/fallFloor.ts +2 -2
  189. package/src/server/host/standalone/gridServer.ts +7 -4
  190. package/src/server/host/standalone/roadWorld.ts +41 -4
  191. package/src/shared/engine/audio/bootAudio.ts +33 -0
  192. package/src/shared/engine/level/spec.ts +3 -3
  193. package/src/shared/engine/net/acts.ts +3 -0
  194. package/src/shared/engine/physics/query.ts +27 -0
  195. package/src/shared/engine/physics/terrain.ts +19 -28
  196. package/src/shared/engine/saves/saves.lock.json +15 -0
  197. package/src/shared/engine/sim/actRoutes.ts +2 -0
  198. package/src/shared/game/compendium/keepsakeProgression.ts +24 -0
  199. package/src/shared/game/grid/catalogue.ts +12 -5
  200. package/src/shared/game/grid/catalogueSlot.ts +11 -0
  201. package/src/shared/game/grid/farProxy.ts +6 -5
  202. package/src/shared/game/grid/pageMode.ts +1 -1
  203. package/src/shared/game/grid/roadLayout.ts +26 -3
  204. package/src/shared/game/grid/singleplayer.json +0 -13
  205. package/src/shared/game/grid/voidFloor.ts +122 -0
  206. package/src/shared/game/strings.ts +15 -0
  207. package/src/shared/host/standalone/netInput.ts +2 -1
@@ -5,13 +5,15 @@
5
5
  *
6
6
  * The deck's shape is the generator's (`@wildshard/engine/sim/strips`): between two cells a 62.5 m gap, a 15 m road on the
7
7
  * gap's centre line and a 23.75 m strip each side; a junction where four gaps meet. The outer ring is the gap past the
8
- * outermost cells, and the rail (the void's collision wall) sits on its outer shoulder.
8
+ * outermost cells; past it lies the void's walkable floor, and the rail (the void's collision wall) stands on the 7 × 7's
9
+ * outer road shoulder (SA34), whatever the catalogue places.
9
10
  *
10
11
  * Every road segment between two junctions has one turn-in at its midpoint (G93: a shard's four entryways sit at its edge
11
12
  * midpoints), so the kerb opens there on each side that has a cell. Sign text is a cell's shard name from the catalogue's
12
13
  * slug, never a name written here (an open plot's is its open-plots output's name, G538).
13
14
  */
14
15
  import type { GridAssembly, GridCell } from './assembly';
16
+ import { DRAWN_GRID_RADIUS } from './catalogue';
15
17
  import { CHUNK_SIZE, CONTENT_CAPS, ENTRY_WIDTH, ENTRY_ASPHALT as entryAsphalt } from '@wildshard/engine/core/config';
16
18
 
17
19
  /** The road's half width (the generator's flat road band, `STRIP_OFFSETS` ±7.5). */
@@ -64,6 +66,27 @@ export interface RoadLayout {
64
66
  readonly signs: readonly RoadSign[];
65
67
  readonly lights: readonly RoadLight[];
66
68
  readonly rail: RailBox;
69
+ /** SA34: where the void's drawn floor begins, the old rail line round the placed cells (the 7 × 7's empty cells past it are void floor) */
70
+ readonly edge: RailBox;
71
+ /** SA34: the empty cells inside the placed rectangle, each a square of void floor */
72
+ readonly holes: readonly CellSquare[];
73
+ }
74
+ /** A cell's content square in grid metres: its centre and half size. */
75
+ export interface CellSquare { readonly x: number; readonly z: number; readonly hx: number; readonly hz: number }
76
+
77
+ /** SA34: the empty cells of the placed cells' rectangle (the roads run round them, their strips at road level on that side). */
78
+ export function emptyCellSquares(cells: readonly { readonly cell: readonly [number, number] }[], pitch: number): readonly CellSquare[] {
79
+ if (cells.length === 0) return [];
80
+ const xs = cells.map((c) => c.cell[0]), zs = cells.map((c) => c.cell[1]), placed = new Set(cells.map((c) => c.cell.join(','))), out: CellSquare[] = [];
81
+ for (let x = Math.min(...xs); x <= Math.max(...xs); x++) for (let z = Math.min(...zs); z <= Math.max(...zs); z++)
82
+ if (!placed.has(`${String(x)},${String(z)}`)) out.push({ x: x * pitch, z: z * pitch, hx: CHUNK_SIZE / 2, hz: CHUNK_SIZE / 2 });
83
+ return out;
84
+ }
85
+
86
+ /** SA34: the rail's square, the 7 × 7's outer road shoulder (`DRAWN_GRID_RADIUS`), the same for every catalogue. */
87
+ export function gridRail(pitch: number): RailBox {
88
+ const reach = DRAWN_GRID_RADIUS * pitch + pitch / 2 + RAIL_OFFSET;
89
+ return { minX: -reach, maxX: reach, minZ: -reach, maxZ: reach };
67
90
  }
68
91
 
69
92
  const ARM: Readonly<Record<ArmSide, { readonly x: number; readonly z: number }>> = { east: { x: 1, z: 0 }, west: { x: -1, z: 0 }, north: { x: 0, z: 1 }, south: { x: 0, z: -1 } };
@@ -158,8 +181,8 @@ export function roadLayout(assembly: GridAssembly, name: (slug: string) => strin
158
181
  for (let s = -225; s <= 225; s += 50) lights.push({ at: segmentPoint(segment, s, t * (ROAD_HALF + 1.1)), reach });
159
182
  }
160
183
  for (const junction of junctions) if (junction.roundabout) lights.push({ at: junction.centre, reach: { x: 0, z: 0 } });
161
- const rail: RailBox = { minX: minX * pitch - pitch / 2 - RAIL_OFFSET, maxX: maxX * pitch + pitch / 2 + RAIL_OFFSET, minZ: minZ * pitch - pitch / 2 - RAIL_OFFSET, maxZ: maxZ * pitch + pitch / 2 + RAIL_OFFSET };
162
- return { segments, junctions, signs, lights, rail };
184
+ const edge: RailBox = { minX: minX * pitch - pitch / 2 - RAIL_OFFSET, maxX: maxX * pitch + pitch / 2 + RAIL_OFFSET, minZ: minZ * pitch - pitch / 2 - RAIL_OFFSET, maxZ: maxZ * pitch + pitch / 2 + RAIL_OFFSET };
185
+ return { segments, junctions, signs, lights, rail: gridRail(pitch), edge, holes: emptyCellSquares(assembly.cells, pitch) };
163
186
  }
164
187
 
165
188
  /** Is the segment's `t` side the void (past the outermost cells)? */
@@ -131,19 +131,6 @@
131
131
  500
132
132
  ]
133
133
  },
134
- {
135
- "instance": "open-plot-showcase-template-solo",
136
- "slug": "open-plot-showcase-template",
137
- "cell": [
138
- -7,
139
- 8
140
- ],
141
- "size": [
142
- 500,
143
- 500,
144
- 500
145
- ]
146
- },
147
134
  {
148
135
  "instance": "open-plot-thin-ice-solo",
149
136
  "slug": "open-plot-thin-ice",
@@ -0,0 +1,122 @@
1
+ /**
2
+ * SA34 (meta SHARD-AUTHORING-PLAN, J314, grill Q9): the 7 × 7's empty cells are a walkable void floor, never a wall. The
3
+ * grid lays out all 49 cells (`DRAWN_GRID_RADIUS` 3): the roads run round the placed cells' rectangle as before (the
4
+ * generator's strips, `strips.ts`), and every other spot inside the 7 × 7's rail is the void's flat floor at road level
5
+ * (y 0, the height an empty neighbour's strip edge ends at, `assembly.ts` `emptyNeighbour`). The rail, the void's closed
6
+ * rim, stands on the 7 × 7's outer road shoulder whatever is placed, so a walk from ring 2 into an empty ring-3 cell stays
7
+ * on the floor and comes back. Each road world (the page's highway, the in-page server's road, a dedicated worker's road room)
8
+ * installs the same floor and rim with `installVoidFloor`; the look draws the floor from the same layout (`voidLook.ts`).
9
+ */
10
+ import type { Collider } from '@dimforge/rapier3d-simd';
11
+ import type { Physics } from '@wildshard/engine/physics/Physics';
12
+ import { groups } from '@wildshard/engine/physics/groups';
13
+ import { PLATFORM_COLLIDER_OWNER } from '@wildshard/engine/physics/stripColliders';
14
+ import { tagCollider } from '@wildshard/engine/physics/surface';
15
+ import { generatePlatform } from '@wildshard/engine/sim/strips';
16
+ import type { GridAssembly } from './assembly';
17
+ import { collisionStrips, type CollisionStrip } from './collisionStrips';
18
+ import { platformInputs } from './platformInputs';
19
+ import { emptyCellSquares, GAP_HALF, gridRail, type CellSquare } from './roadLayout';
20
+
21
+ /** A floor box's footprint in grid metres: its centre and half sizes. Its top is at road level, y 0. */
22
+ export type VoidBox = CellSquare;
23
+ /** How far the floor runs on past the rail, so a capsule pressed to the rim still stands on it. */
24
+ export const VOID_FLOOR_PAST_RAIL = 20;
25
+ /** How far the rim reaches below road level (m). */
26
+ export const VOID_FLOOR_DEPTH = 1;
27
+ /**
28
+ * The floor's largest square (m). One road-level slab as long as the band (2875 m × 560 m) is a cuboid Rapier can't stand a capsule on:
29
+ * its contact error grows with the shape's size, so a player walked a metre onto it, sank 0.17 m into its top and stuck there (on the
30
+ * in-page server's road and so on the page, which takes the server's state back). The floor is a flat trimesh of squares this size
31
+ * instead, as the strips are, each collider in its own box's frame.
32
+ */
33
+ export const VOID_FLOOR_TILE = 125;
34
+
35
+ /** The placed cells' rectangle, in cells (the strips' extent: `strips.ts` builds a gap round every side of it). */
36
+ function placedRange(cells: readonly { readonly cell: readonly [number, number] }[]): { minX: number; maxX: number; minZ: number; maxZ: number } {
37
+ const xs = cells.map((c) => c.cell[0]), zs = cells.map((c) => c.cell[1]);
38
+ return { minX: Math.min(...xs), maxX: Math.max(...xs), minZ: Math.min(...zs), maxZ: Math.max(...zs) };
39
+ }
40
+
41
+ /**
42
+ * Where the void's floor lies: an empty cell inside the placed rectangle (its 500 m square; the strips round it end at road
43
+ * level on its side), and the band between the strips' outer edge and just past the rail. Never under a strip or a cell.
44
+ */
45
+ export function voidFloorBoxes(cells: readonly { readonly cell: readonly [number, number] }[], pitch: number): readonly VoidBox[] {
46
+ if (cells.length === 0) return [];
47
+ const range = placedRange(cells), rail = gridRail(pitch), boxes: VoidBox[] = [...emptyCellSquares(cells, pitch)];
48
+ // the strips' outer edge, and the floor's: past the rail on every side
49
+ const x0 = range.minX * pitch - pitch / 2 - GAP_HALF, x1 = range.maxX * pitch + pitch / 2 + GAP_HALF;
50
+ const z0 = range.minZ * pitch - pitch / 2 - GAP_HALF, z1 = range.maxZ * pitch + pitch / 2 + GAP_HALF;
51
+ const X0 = rail.minX - VOID_FLOOR_PAST_RAIL, X1 = rail.maxX + VOID_FLOOR_PAST_RAIL, Z0 = rail.minZ - VOID_FLOOR_PAST_RAIL, Z1 = rail.maxZ + VOID_FLOOR_PAST_RAIL;
52
+ const band = (a: number, b: number, c: number, d: number): void => { if (b - a > 0.01 && d - c > 0.01) boxes.push({ x: (a + b) / 2, z: (c + d) / 2, hx: (b - a) / 2, hz: (d - c) / 2 }); };
53
+ band(X0, x0, Z0, Z1); band(x1, X1, Z0, Z1); // west and east, full depth
54
+ band(x0, x1, Z0, z0); band(x0, x1, z1, Z1); // south and north, between them
55
+ return boxes;
56
+ }
57
+
58
+ /** A floor box as a flat, upward-facing trimesh at road level (y 0) in the box's own frame: squares of at most `VOID_FLOOR_TILE`. */
59
+ export function voidFloorMesh(box: VoidBox): { readonly positions: Float32Array; readonly indices: Uint32Array } {
60
+ const nx = Math.max(1, Math.ceil((2 * box.hx) / VOID_FLOOR_TILE)), nz = Math.max(1, Math.ceil((2 * box.hz) / VOID_FLOOR_TILE));
61
+ const positions = new Float32Array((nx + 1) * (nz + 1) * 3), indices = new Uint32Array(nx * nz * 6);
62
+ for (let i = 0; i <= nx; i++) for (let j = 0; j <= nz; j++) {
63
+ const at = (i * (nz + 1) + j) * 3;
64
+ positions[at] = -box.hx + (2 * box.hx * i) / nx; positions[at + 2] = -box.hz + (2 * box.hz * j) / nz;
65
+ }
66
+ let k = 0;
67
+ for (let i = 0; i < nx; i++) for (let j = 0; j < nz; j++) {
68
+ const a = i * (nz + 1) + j, b = a + nz + 1; // a: (i, j), b: (i + 1, j); +1 steps j
69
+ indices.set([a, a + 1, b, b, a + 1, b + 1], k); k += 6; // wound to face up (+y)
70
+ }
71
+ return { positions, indices };
72
+ }
73
+
74
+ /** The rim: four walls on the rail's lines, as `ReadinessEdge`s are built (never opened: the void has no sim to wait for). */
75
+ export function rimWalls(pitch: number): readonly { readonly x: number; readonly z: number; readonly axis: 'x' | 'z'; readonly halfLength: number }[] {
76
+ const { minX, maxX, minZ, maxZ } = gridRail(pitch), cx = (minX + maxX) / 2, cz = (minZ + maxZ) / 2, hx = (maxX - minX) / 2, hz = (maxZ - minZ) / 2;
77
+ return [{ x: minX, z: cz, axis: 'x', halfLength: hz }, { x: maxX, z: cz, axis: 'x', halfLength: hz }, { x: cx, z: minZ, axis: 'z', halfLength: hx }, { x: cx, z: maxZ, axis: 'z', halfLength: hx }];
78
+ }
79
+
80
+ /** The rim's half height and half thickness (m): a wall nobody climbs or boosts over. */
81
+ const RIM_HALF_HEIGHT = 30, RIM_HALF_THICK = 0.25;
82
+
83
+ /**
84
+ * Install the void's floor (one tiled trimesh per box) and, with `rim`, its rim in a road world in the grid's frame (the page's highway keeps its
85
+ * rim as readiness walls instead). The caller's owner holds the colliders. Tagged as platform ground, so regional hashes
86
+ * leave them out. Answers the floor's colliders (not the rim's), so a road told of a new cell can lift them (SA34a).
87
+ */
88
+ export function installVoidFloor(physics: Pick<Physics, 'R' | 'world'>, cells: readonly { readonly cell: readonly [number, number] }[], pitch: number, rim = true): readonly Collider[] {
89
+ const { R, world } = physics, floor: Collider[] = [];
90
+ for (const box of voidFloorBoxes(cells, pitch)) {
91
+ const { positions, indices } = voidFloorMesh(box);
92
+ const collider = world.createCollider(R.ColliderDesc.trimesh(positions, indices, R.TriMeshFlags.FIX_INTERNAL_EDGES).setTranslation(box.x, 0, box.z).setCollisionGroups(groups('WORLD')));
93
+ tagCollider(collider, 'stone', PLATFORM_COLLIDER_OWNER); floor.push(collider);
94
+ }
95
+ if (rim) for (const wall of rimWalls(pitch)) {
96
+ const acrossX = wall.axis === 'x';
97
+ const collider = world.createCollider(R.ColliderDesc.cuboid(acrossX ? RIM_HALF_THICK : wall.halfLength, RIM_HALF_HEIGHT, acrossX ? wall.halfLength : RIM_HALF_THICK)
98
+ .setTranslation(wall.x, RIM_HALF_HEIGHT - VOID_FLOOR_DEPTH, wall.z).setCollisionGroups(groups('WORLD')));
99
+ tagCollider(collider, 'edge', PLATFORM_COLLIDER_OWNER);
100
+ }
101
+ return floor;
102
+ }
103
+
104
+ /**
105
+ * SA34a: the strips `grown` (a grid with newly placed cells) has at spots where `base` (the grid the build's pack was baked for) has none:
106
+ * the roads round the grown rectangle. The server reads no shard's edge rows, so they are generated at road level on every side, the
107
+ * page's own fallback (`platformInputs`' `flat`). A spot `base` has keeps the pack's strip, which has no copy for a cell the pack never
108
+ * saw: `seams` are those copies, for the new cells only, so a new cell's own world stands on the road past each of its edges.
109
+ * Every worker generates the same strips.
110
+ */
111
+ export function placedStrips(grown: GridAssembly, base: GridAssembly): { readonly strips: readonly CollisionStrip[]; readonly seams: CollisionStrip['duplicates'] } {
112
+ const key = (x: number, z: number): string => `${String(Math.round(x * 100))},${String(Math.round(z * 100))}`, had = new Set<string>();
113
+ const known = new Set(base.cells.map(cell => cell.instance)), added = grown.cells.filter(cell => !known.has(cell.instance));
114
+ if (added.length === 0) return { strips: [], seams: [] };
115
+ const beside = (x: number, z: number): boolean => added.some(cell => Math.abs(x - cell.origin.x) <= grown.pitch / 2 + 1 && Math.abs(z - cell.origin.z) <= grown.pitch / 2 + 1);
116
+ // `within` is asked for every spot before anything is generated, so a pass that answers no only lists the base grid's spots.
117
+ const { flat: before, empty } = platformInputs(base, undefined), { flat } = platformInputs(grown, undefined);
118
+ generatePlatform(before, empty, undefined, (x, z) => { had.add(key(x, z)); return false; });
119
+ const made = collisionStrips(generatePlatform(flat, empty, undefined, (x, z) => !had.has(key(x, z)) || beside(x, z)));
120
+ const fresh = new Set(added.map(cell => cell.instance)), kept = (strip: CollisionStrip): boolean => had.has(key(strip.mesh.origin.x, strip.mesh.origin.z));
121
+ return { strips: made.filter(strip => !kept(strip)), seams: made.filter(kept).flatMap(strip => strip.duplicates.filter(row => fresh.has(row.instance))) };
122
+ }
@@ -35,6 +35,15 @@ export const GAME_STRINGS = {
35
35
  hide: 'HIDE UNTIL NEXT BUILD',
36
36
  },
37
37
  },
38
+ /** SA36 (Jake, grill Q14-Q16): the `/slug/<slug>` page, one shard's card and hero and PLAY, a link an author shares */
39
+ slugPage: {
40
+ menu: 'MAIN MENU',
41
+ play: 'Play',
42
+ /** under PLAY: it enters Infinite Wildshard at the shard's cell, the way Shard select does */
43
+ placed: 'Spawns you on the grid',
44
+ /** Q16: a slug with no grid cell (not placed yet, `--no-place`, an off-grid shard) */
45
+ unplaced: 'Not on the grid yet',
46
+ },
38
47
  /** a shard card whose shardfile needs a newer client (G86, temporary): dimmed, a badge and the save promise */
39
48
  upgrade: {
40
49
  badge: 'NEEDS UPGRADE',
@@ -52,6 +61,12 @@ export const GAME_STRINGS = {
52
61
  safety: 'FAILED SAFETY CHECK',
53
62
  load: "COULDN'T LOAD",
54
63
  },
64
+ /** OFFLINE OF3 (J298): on a world build, a shard the world doesn't open (the grid doesn't place it, or the world's word leaves it out).
65
+ * Its Shard select card (dimmed, ENTER WORLD off) and the title's line after a `?chunk=` link to it */
66
+ notInWorld: {
67
+ badge: 'Not in this world yet',
68
+ line: (name: string): string => `${name}: Not in this world yet`,
69
+ },
55
70
  /** G168 (art/hud/round-22-script-error): a shard script switched off after its strikes. The player's toast, once; with
56
71
  * Developer on, the red strip names the module and its cause */
57
72
  script: {
@@ -1,5 +1,5 @@
1
1
  import type { NetCommand } from '@wildshard/wire/netCommand';
2
- import { STORY_ACT, UNSTUCK_ACT, type NetTickAct } from '@wildshard/engine/net/acts';
2
+ import { RESPAWN_NOW_ACT, STORY_ACT, UNSTUCK_ACT, type NetTickAct } from '@wildshard/engine/net/acts';
3
3
  import type { NetTickInput } from '@wildshard/engine/net/room';
4
4
  import { actRoutes, lockValue, type ActRoutes } from '@wildshard/engine/sim/actRoutes';
5
5
  import { NET_BUTTONS } from '@wildshard/engine/input/netButtons';
@@ -39,6 +39,7 @@ export function netInteractCommands(routes: ActRoutes, acts: readonly NetTickAct
39
39
  if (act.id.startsWith('seen:') && routes.seen !== null) { routes.seen(player, act.id); return []; }
40
40
  if (act.id.startsWith(STORY_ACT)) { routes.story?.(player, act.id.slice(STORY_ACT.length)); return []; }
41
41
  if (act.id === UNSTUCK_ACT) { if (routes.unstuck === null) routes.refused++; else routes.unstuck(player); return []; }
42
+ if (act.id === RESPAWN_NOW_ACT) { if (routes.respawnNow === undefined) routes.refused++; else routes.respawnNow(player); return []; }
42
43
  const claim = routes.claims.get(act.id);
43
44
  if (claim !== undefined) { claim(player); return []; }
44
45
  // A page names the person it talks to; a quest with one person calls that row `talk`.