@wildshard/engine 0.1.20 → 0.1.21

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 (59) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/lint/engine-sides.json +1 -0
  3. package/package.json +2 -1
  4. package/scripts/chaos-proxy-core.mjs +14 -1
  5. package/scripts/chaos-proxy-proof.mjs +22 -0
  6. package/scripts/failmode-cases.d.mts +8 -0
  7. package/scripts/failmode-cases.mjs +97 -0
  8. package/scripts/failmode-proof.mjs +532 -0
  9. package/scripts/grid-crossing-nightly.mjs +5 -4
  10. package/scripts/grid-crossing-report.mjs +5 -2
  11. package/scripts/grid-crossing-tour.mjs +25 -8
  12. package/scripts/hover-speed-probe.mjs +136 -0
  13. package/scripts/net-lag-proof.mjs +3 -2
  14. package/scripts/online-rig.mjs +9 -7
  15. package/scripts/release-cook.mjs +109 -0
  16. package/scripts/vps/rebuild.sh +35 -9
  17. package/scripts/vps/wildshard-apply.mjs +5 -1
  18. package/scripts/vps/wildshard-config +117 -1
  19. package/src/client/engine/boot/contentRead.ts +54 -5
  20. package/src/client/engine/boot/gpuFiles.ts +3 -3
  21. package/src/client/engine/boot/leaveAfterPaint.ts +4 -1
  22. package/src/client/engine/core/shadowLayer.ts +18 -0
  23. package/src/client/engine/explore/pick.ts +13 -1
  24. package/src/client/engine/net/predictor.ts +12 -4
  25. package/src/client/engine/player/TouchControls.ts +3 -2
  26. package/src/client/engine/render/families/sceneSurface.ts +3 -1
  27. package/src/client/engine/telemetry/browserErrors.ts +3 -1
  28. package/src/client/engine/ui/ErrorModal.ts +1 -1
  29. package/src/client/engine/ui/Loading.ts +14 -2
  30. package/src/client/engine/ui/errorScreen.ts +51 -9
  31. package/src/client/engine/ui/hoverBoost.ts +31 -4
  32. package/src/client/engine/ui/styles/touch.css +6 -0
  33. package/src/client/game/boot/spawnDownload.ts +44 -6
  34. package/src/client/game/grid/live.ts +2 -2
  35. package/src/client/game/grid/liveSession.ts +2 -2
  36. package/src/client/game/grid/session.ts +2 -0
  37. package/src/client/game/grid/shardfileFar.ts +13 -2
  38. package/src/client/game/shardfile/clientSource.ts +7 -3
  39. package/src/client/game/shardfile/clientWorker.ts +4 -4
  40. package/src/client/game/shardfile/groundMerge.ts +5 -3
  41. package/src/client/host/online/linkScreens.ts +12 -6
  42. package/src/client/host/online/reconnectStrip.ts +3 -2
  43. package/src/client/host/online/release.ts +87 -16
  44. package/src/client/host/online/releaseScreens.ts +108 -0
  45. package/src/client/host/online/shell.ts +11 -1
  46. package/src/client/host/online/voice.ts +45 -1
  47. package/src/client/host/online/voiceUi.ts +24 -6
  48. package/src/server/engine/sim/playerSim.ts +1 -1
  49. package/src/server/game/grid/simulation.ts +12 -6
  50. package/src/server/host/dedicated/cellHost.ts +7 -0
  51. package/src/server/host/dedicated/cellWorker.ts +1 -1
  52. package/src/server/host/dedicated/dedicatedRoom.ts +14 -1
  53. package/src/server/host/dedicated/roadRoom.ts +3 -0
  54. package/src/server/host/standalone/gridServer.ts +1 -1
  55. package/src/shared/engine/boot/loadingWaits.ts +10 -2
  56. package/src/shared/engine/core/config.ts +3 -0
  57. package/src/shared/engine/player/hoverSpeed.ts +3 -3
  58. package/src/shared/engine/strings.ts +12 -1
  59. package/src/shared/game/grid/rules.ts +12 -0
@@ -0,0 +1,108 @@
1
+ // FM5 (meta docs/plans/MMO-FAILURE-MODES-PLAN.md): what a player sees while the page has no release file to dial from. Modes 1, 11, 12,
2
+ // 37, 38 and 39 are **pages** (the plan's first style): before the world, over the loading card, the whole screen, one button that does
3
+ // something, and they move on by themselves when the file answers. Mode 46 is the staging **mark**: a quiet line for the session.
4
+ // The waits are release.ts's policy (`releaseRetryMs`); this file only says so and counts down the real scheduled read.
5
+ import { Scope } from '@wildshard/engine/app/scope';
6
+ import { diagnosticNow } from '@wildshard/engine/core/clock';
7
+ import { captureBrowserError } from '@wildshard/engine/telemetry/browserErrors';
8
+ import { buttons, card, linkStyle, make, ring } from './linkScreens';
9
+ import { releaseScreen, type ReleaseFault, type ReleaseScreen, type ReleaseWait } from './release';
10
+
11
+ /** The words of each page: a tag, a headline and the key line. No status code, address or exception is primary copy (Details holds them). */
12
+ const WORDS: Readonly<Record<ReleaseScreen, { readonly tag: string; readonly title: string; readonly body: string; readonly tone: 'warn' | 'bad' | 'info' }>> = {
13
+ 'offline-launch': { tag: 'Offline', title: 'You\'re offline', body: 'We\'ll connect as soon as you\'re back.', tone: 'warn' },
14
+ 'release-5xx': { tag: 'Can\'t find the world', title: 'Can\'t find the world', body: 'The world\'s information didn\'t arrive. We\'ll try again by ourselves.', tone: 'warn' },
15
+ 'release-429': { tag: 'Busy', title: 'Lots of players joining', body: 'You don\'t need to do anything: we\'ll try again when the world says to.', tone: 'info' },
16
+ 'release-404': { tag: 'Not available', title: 'World information isn\'t available', body: 'Check your connection, or try again later. We\'ll look again every minute.', tone: 'warn' },
17
+ 'captive-portal': { tag: 'Network sign-in', title: 'This network may need sign-in', body: 'Something other than the world answered. If this network has a sign-in page, sign in, then try again.', tone: 'warn' },
18
+ 'release-unsigned': { tag: 'Not verified', title: 'Couldn\'t check the world', body: 'We won\'t connect to a world we can\'t verify.', tone: 'bad' },
19
+ };
20
+
21
+ /** Details: what was measured, never a guess (a browser can't tell DNS from TLS from a reset). */
22
+ function measured(fault: ReleaseFault): string {
23
+ if (fault.kind === 'offline') return 'The browser says this device is offline.';
24
+ if (fault.kind === 'network') return 'No HTTP response. Check the connection.';
25
+ if (fault.kind === 'timeout') return `No answer in ${String(Math.round(fault.ms / 1000))} s.`;
26
+ if (fault.kind === 'status') return `HTTP ${String(fault.status)}${fault.retryAfterMs === null ? '' : `, Retry-After ${String(Math.round(fault.retryAfterMs / 1000))} s`}.`;
27
+ if (fault.kind === 'unsigned') return 'The world\'s file failed its signature check.';
28
+ return fault.why === 'redirect' ? 'The read was sent to another address.' : fault.why === 'html' ? 'A web page answered instead of the world\'s file.' : 'The answer was not a signed world file.';
29
+ }
30
+
31
+ export interface ReleaseScreenHooks {
32
+ /** Open the Connection doctor (E7.5), naming the screen that asked. */
33
+ readonly doctor?: (from: string) => void;
34
+ /** Leave for the title screen. */
35
+ readonly title: () => void;
36
+ /** Where mode 39 reports (the browser error tracker; a test observes its own). */
37
+ readonly report?: typeof captureBrowserError;
38
+ }
39
+
40
+ /**
41
+ * FM5: the release pages, as release.ts's `ReleaseWait`. Each failed read shows its page and settles when the page should read again:
42
+ * the policy's scheduled time (counted down on the page), Try again, the network coming back, or (a portal) the page coming into view.
43
+ * Title screen rejects, so the load stops and the player leaves. `done` closes the page.
44
+ *
45
+ * await releaseToDial(url, key, { keep, wait: releaseScreens(scope, { doctor, title }) });
46
+ */
47
+ export function releaseScreens(scope: Scope, hooks: ReleaseScreenHooks, parent: HTMLElement = document.body): ReleaseWait {
48
+ const report = hooks.report ?? captureBrowserError;
49
+ let shown: Scope | null = null, reported = false;
50
+ const close = (): void => { shown?.dispose(); shown = null; };
51
+ scope.onDispose(close);
52
+ return {
53
+ done: close,
54
+ after: (fault, attempt, retryMs, detail) => new Promise<void>((resolve, reject) => {
55
+ close();
56
+ linkStyle();
57
+ const id = releaseScreen(fault), words = WORDS[id], page = new Scope(`online.release-${id}`, scope);
58
+ shown = page;
59
+ const { root, box } = card(page, id, words.tone, words.tag, words.title);
60
+ root.classList.add('ws-link-page');
61
+ box.append(make('p', 'ws-link-body', words.body));
62
+ let settled = false;
63
+ let trying = (): void => undefined;
64
+ const go = (): void => { if (settled) return; settled = true; trying(); resolve(); };
65
+ const leave = (): void => { if (settled) return; settled = true; reject(new Error('The player left the release wait for the title')); hooks.title(); };
66
+ page.onDispose(() => { if (!settled) { settled = true; resolve(); } });
67
+ // the next read, counted from what is actually scheduled: never a made-up clock
68
+ const status = make('p', 'ws-link-auto');
69
+ if (retryMs !== null) {
70
+ const due = diagnosticNow() + retryMs, line = make('span');
71
+ const tick = (): void => { const left = Math.max(0, Math.ceil((due - diagnosticNow()) / 1000)); line.textContent = `Next try in ${String(left)} s · ${attempt === 0 ? 'first try failed' : `${String(attempt + 1)} tries so far`}`; };
72
+ const counting = page.interval(500, tick);
73
+ trying = () => { page.cancelTimer(counting); line.textContent = 'Trying…'; };
74
+ tick(); page.timeout(retryMs, go);
75
+ status.append(ring(), line);
76
+ box.append(status);
77
+ } else if (id === 'offline-launch') {
78
+ status.append(ring(), make('span', '', 'Waiting for the network'));
79
+ box.append(status);
80
+ }
81
+ // the network back, or a portal's page back in view after a sign-in elsewhere: read again now
82
+ page.listen(window, 'online', go);
83
+ if (id === 'captive-portal') page.listen(document, 'visibilitychange', () => { if (document.visibilityState === 'visible') go(); });
84
+ const actions: { label: string; primary?: true; busy?: string; act: () => void }[] = [];
85
+ // mode 12 waits what the world asked; a tap doesn't jump that queue
86
+ if (id !== 'release-429') actions.push({ label: retryMs === null ? 'Try again' : 'Try now', primary: true, busy: 'Trying…', act: go });
87
+ if (hooks.doctor !== undefined && id !== 'offline-launch') { const { doctor } = hooks; actions.push({ label: 'Check connection', act: () => { doctor(id); } }); }
88
+ actions.push({ label: 'Title screen', act: leave });
89
+ box.append(buttons(page, actions));
90
+ const details = make('details'), summary = make('summary', '', 'Details');
91
+ details.append(summary, make('p', '', `${measured(fault)} ${detail}`));
92
+ box.append(details);
93
+ parent.append(root);
94
+ root.querySelector<HTMLButtonElement>('button')?.focus(); // the first action takes focus; card() keeps Tab inside
95
+ // mode 39 goes to the error report queue, once a page
96
+ if (id === 'release-unsigned' && !reported) { reported = true; try { report(new Error(`Release file failed its signature: ${detail}`), { system: 'link', build: '', shard: '', bootStage: 'loading', fatal: false, screen: 'release-unsigned', diagnostic: { detail } }); } catch { /* telemetry never stops the page */ } }
97
+ }),
98
+ };
99
+ }
100
+
101
+ /** FM5 mode 46: a page on the staging world says so, for the whole session. Returns its node (owned by `scope`). */
102
+ export function stagingMark(scope: Scope, parent: HTMLElement = document.body): HTMLElement {
103
+ linkStyle();
104
+ const mark = scope.ownNode(make('div', 'ws-link ws-link-mark', 'Staging · not the live world'));
105
+ mark.dataset['failmode'] = 'staging'; mark.dataset['tone'] = 'warn'; mark.setAttribute('role', 'status');
106
+ parent.append(mark);
107
+ return mark;
108
+ }
@@ -18,6 +18,7 @@ import { chatLines } from './chatLines';
18
18
  import { VoiceChat, type VoiceHeard, type VoiceLink } from './voice';
19
19
  import { voiceUi } from './voiceUi';
20
20
  import { fetchSignedRelease, releaseToDial, type ReleaseKeep } from './release';
21
+ import { releaseScreens, stagingMark } from './releaseScreens';
21
22
  import { newBuildPanel } from './reconnectStrip';
22
23
  import { linkScreens } from './linkScreens';
23
24
  import { diagnosticNow } from '@wildshard/engine/core/clock';
@@ -293,7 +294,14 @@ async function askWorld(config: { readonly release: string; readonly key: string
293
294
  /** Enter the one world this build names. A stale tab reloads into the server's build once, and only then gives up. */
294
295
  export async function startOnline(config: StartOnline): Promise<OnlineShell> {
295
296
  // OF4: a verified kept release file dials at once (offline too), and the fresh read follows; with none, the page waits for the read
296
- const { release: at, key, keep, identity, recordTag, grid, ...link } = config, { file: release, fresh } = await releaseToDial(at, key, { keep: keep ?? NO_KEEP }), { socket } = release;
297
+ const { release: at, key, keep, identity, recordTag, grid, ...link } = config;
298
+ // FM5: with no kept copy and no file, the page says why (offline, the file's server down or busy, a portal, a bad signature) and
299
+ // reads again by release.ts's policy until a verified file answers; Title screen stops the load
300
+ const waiting = new Scope('online.release-wait');
301
+ const toTitle = (): void => { markUnload('release page: title screen'); location.replace(new URL('/', location.origin).toString()); };
302
+ let dial: Awaited<ReturnType<typeof releaseToDial>>;
303
+ try { dial = await releaseToDial(at, key, { keep: keep ?? NO_KEEP, wait: releaseScreens(waiting, { doctor, title: toTitle }) }); } finally { waiting.dispose(); }
304
+ const { file: release, fresh } = dial, { socket } = release;
297
305
  // QA row 16: a level page enters only from a tap. A reload this page makes itself carries the tap that brought it here.
298
306
  const entering = (slug: string): void => { setTitleArrival({ slug, mode: 'enter' }, { tab: true }); };
299
307
  const stale = async (): Promise<boolean> => { entering(link.loaded); const going = await reloadStale(); if (!going) dropTabArrival(); return going; };
@@ -301,6 +309,8 @@ export async function startOnline(config: StartOnline): Promise<OnlineShell> {
301
309
  if (fresh === null && release.engineBuild !== link.build) await stale();
302
310
  if (socket === undefined) throw new Error('The release file names no address');
303
311
  const scope = new Scope('online.page');
312
+ // FM5 mode 46: the staging world says so for the session (the release file's own verified channel)
313
+ if (release.channel === 'staging') stagingMark(scope);
304
314
  const goto = grid?.goto === true ? grid.cell : undefined;
305
315
  let dialing = socket;
306
316
  // MP2.4: the page asked for the Name before it got here (namePrompt.ts, once per device); Skip keeps the device's own (Guest)
@@ -30,12 +30,17 @@ export interface VoiceLink {
30
30
  /** Where voice stands for this player. */
31
31
  export type VoiceState = 'off' | 'asking' | 'joining' | 'on' | 'denied' | 'unsupported' | 'full' | 'failed';
32
32
  /** One other player on voice; `body` is their player row's id (V7, V8), and `far` is out of earshot: 40 m or more away or out of sight. */
33
- export interface VoicePeer { readonly id: string; readonly name: string; body?: string | null; speaking: boolean; muted: boolean; linked: boolean; far: boolean }
33
+ export interface VoicePeer { readonly id: string; readonly name: string; body?: string | null; speaking: boolean; muted: boolean; linked: boolean; far: boolean;
34
+ /** FM8 mode 32: on voice, still not linked after every offer retry had its time (`VOICE_GIVE_UP_MS`). */
35
+ unreachable?: boolean }
34
36
 
35
37
  /** A remote level past this is talking; held this long after it drops, so a word's gaps don't flicker. */
36
38
  const SPEAKING_LEVEL = 0.03, SPEAKING_HOLD_MS = 450, LEVEL_POLL_MS = 150;
37
39
  /** An offerer retries a failed or silent link this many times, the silent one after this long. */
38
40
  const RETRIES = 3, UNANSWERED_MS = 15_000;
41
+ /** FM8 mode 32: a peer on voice still unlinked this long has had every retry (four offers, 15 s each) and some slack: voice can't
42
+ * reach it on this network. No peers, an empty room or a TURN list that didn't arrive is never this on its own. */
43
+ export const VOICE_GIVE_UP_MS: number = (RETRIES + 1) * UNANSWERED_MS + 10_000;
39
44
  /** Signalling in pieces: a half-heard message is dropped after this long, and no peer holds more than a few at once. */
40
45
  const PIECES_MS = 10_000, PIECES_PER_PEER = 4, MAX_PIECES = 64;
41
46
  /** Pieces sent per 50 ms: signalling shares the game socket's message budget, so a burst is spread out. */
@@ -109,6 +114,8 @@ export class VoiceChat {
109
114
  /** Bumped on every new seat, stop and disposal: an await that comes back to an older one does nothing. */
110
115
  private session = 0;
111
116
  private readonly muted = new Set<string>();
117
+ /** FM8 mode 32: since when each peer on voice has been unlinked */
118
+ private readonly waiting = new Map<string, number>();
112
119
  private readonly changes = new Set<() => void>();
113
120
  private me: string | null = null;
114
121
  private mic: MediaStream | null = null;
@@ -308,6 +315,9 @@ export class VoiceChat {
308
315
  return;
309
316
  }
310
317
  if (signal.sdp.type === 'offer') {
318
+ // Two offers crossed (both sides pressed FM8's Try again): the lower id keeps its own and the other side answers it.
319
+ const held = this.links.get(from);
320
+ if (held?.offerer === true && held.pc.signalingState === 'have-local-offer' && this.me !== null && this.me < from) return;
311
321
  // A fresh offer replaces whatever link there was: the offerer started again.
312
322
  this.drop(from);
313
323
  const link = this.open(from, false);
@@ -447,9 +457,43 @@ export class VoiceChat {
447
457
  if (speaking !== peer.speaking) { peer.speaking = speaking; moved = true; }
448
458
  }
449
459
  for (const peer of this.roster.values()) if (!this.links.has(peer.id)) { const far = voiceNear.gain(talker(peer)) === 0; if (far !== peer.far) { peer.far = far; moved = true; } }
460
+ if (this.reach(now)) moved = true;
450
461
  this.tellTalking();
451
462
  if (moved) this.changed();
452
463
  }
464
+ /** FM8 mode 32: mark the peers voice can't reach. True when any mark changed. */
465
+ private reach(now: number): boolean {
466
+ let moved = false;
467
+ for (const id of this.waiting.keys()) if (!this.roster.has(id)) this.waiting.delete(id);
468
+ for (const peer of this.roster.values()) {
469
+ if (this.state !== 'on' || peer.linked) this.waiting.delete(peer.id);
470
+ else if (!this.waiting.has(peer.id)) this.waiting.set(peer.id, now);
471
+ const since = this.waiting.get(peer.id), unreachable = since !== undefined && now - since >= VOICE_GIVE_UP_MS;
472
+ if (unreachable !== (peer.unreachable === true)) { peer.unreachable = unreachable; moved = true; }
473
+ }
474
+ return moved;
475
+ }
476
+ /** FM8 mode 32: the peers on voice it couldn't reach on this network. */
477
+ get unreachable(): readonly VoicePeer[] { return [...this.roster.values()].filter(peer => peer.unreachable === true); }
478
+ /** FM8 mode 32's Try again: ask for the TURN list afresh, then offer again to each peer it couldn't reach
479
+ * (a fresh offer replaces whatever link the other side held, so this side may start it). Text chat never waited on any of it. */
480
+ async retryUnreachable(): Promise<void> {
481
+ const stuck = this.unreachable;
482
+ if (stuck.length === 0 || this.state !== 'on') return;
483
+ const session = this.session, me = this.me;
484
+ this.turn = null;
485
+ const fresh = await this.ask();
486
+ // voice off, or a new seat, while the list loaded: nothing of this attempt is anyone's any more
487
+ if (session !== this.session || me !== this.me || this.state !== 'on') return;
488
+ if (fresh !== null && fresh.length > 0) { this.turned = fresh; this.ice = fresh; }
489
+ const now = diagnosticNow();
490
+ for (const peer of stuck) {
491
+ if (this.roster.get(peer.id) !== peer) continue;
492
+ this.waiting.set(peer.id, now); peer.unreachable = false;
493
+ void this.offer(peer.id);
494
+ }
495
+ this.changed();
496
+ }
453
497
  private set(state: VoiceState): void { this.state = state; this.changed(); }
454
498
  private changed(): void { for (const listener of this.changes) listener(); }
455
499
  }
@@ -1,4 +1,4 @@
1
- import type { Scope } from '@wildshard/engine/app/scope';
1
+ import { Scope } from '@wildshard/engine/app/scope';
2
2
  import { diagnosticNow } from '@wildshard/engine/core/clock';
3
3
  import { listenPage } from '@wildshard/engine/input/dom';
4
4
  import type { ChatBox } from './chatLines';
@@ -22,7 +22,7 @@ import { voiceTalkKey, voiceTalkKeys } from '@wildshard/engine/ui/voiceSettings'
22
22
 
23
23
  const CYAN = '#8fe3ff', NAVY = 'rgba(9,22,36,.86)', RED = '#ff7a7a', AMBER = '#ffc56b';
24
24
  /** The first-time tip, the "you're on, alone" tip and the "voice off" tip go after this long. */
25
- const FIRST_TIP_MS = 15_000, ALONE_TIP_MS = 5000, OFF_TIP_MS = 3000;
25
+ const FIRST_TIP_MS = 15_000, ALONE_TIP_MS = 5000, OFF_TIP_MS = 3000, BLOCKED_TIP_MS = 6000;
26
26
  const CSS = `
27
27
  #ws-voice{flex:none;position:relative;width:38px;height:38px;border-radius:50%;border:1.5px solid rgba(143,227,255,.5);background:${NAVY};color:#9fb3c8;display:grid;place-items:center;padding:0;pointer-events:auto;cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation;transition:box-shadow .12s,background .2s,border-color .2s}
28
28
  #ws-voice svg{width:20px;height:20px}
@@ -98,13 +98,19 @@ export function voiceUi(scope: Scope, voice: VoiceChat, chat: ChatBox): void {
98
98
  chat.form.append(button); chat.box.append(tip, peers);
99
99
  const touch = touchFirst(), act = (): string => touch ? 'Tap the mic' : `${voice.mode === 'hold' ? 'Hold' : 'Press'} ${voiceTalkKey()}`;
100
100
  // the first-time tip's clock starts when the corner first shows (NaN: not yet)
101
- let dismissed = '', firstUntil = voicePrefs.read().seen ? 0 : Number.NaN, aloneUntil = 0, offUntil = 0, was: VoiceState = voice.state;
101
+ let blockedUntil = 0, dismissed = '', firstUntil = voicePrefs.read().seen ? 0 : Number.NaN, aloneUntil = 0, offUntil = 0, was: VoiceState = voice.state;
102
102
  const seen = (): void => { voicePrefs.write({ seen: true }); firstUntil = 0; };
103
103
  // A press is a fresh question: whatever it leads to shows, even a tip the player closed before (a second "blocked").
104
104
  const pressed = (): void => { seen(); dismissed = ''; voice.toggle(); };
105
105
  scope.listen(button, 'click', event => { event.preventDefault(); pressed(); button.blur(); });
106
106
  // V11: the key presses (toggle mode: on or off; hold mode: open while held), and its release closes a held mic wherever focus is
107
- const press = (): void => { seen(); dismissed = ''; voice.press(); };
107
+ // FM8 32b: holding talk while voice reaches no one on voice says so (the voice-failed-blocked card); the mic still opens, so
108
+ // a link that comes up mid-hold carries the voice. Toggle mode's press turns voice off, which is 32's own recovery.
109
+ const press = (): void => {
110
+ seen(); dismissed = '';
111
+ if (voice.mode === 'hold' && voice.state === 'on' && voice.roster.size > 0 && voice.unreachable.length === voice.roster.size) blockedUntil = diagnosticNow() + BLOCKED_TIP_MS;
112
+ voice.press();
113
+ };
108
114
  listenPage(scope, 'keydown', event => { if (voiceKey(event)) press(); }, { capture: true });
109
115
  listenPage(scope, 'keyup', event => { if (isTalkKey(event.code)) voice.release(); }, { capture: true });
110
116
  listenPage(scope, 'pointerdown', event => { if (event instanceof PointerEvent && event.pointerType === 'mouse' && isTalkKey(`Mouse${String(event.button)}`) && cornerShown(document.documentElement.dataset)) press(); }, { capture: true });
@@ -121,6 +127,10 @@ export function voiceUi(scope: Scope, voice: VoiceChat, chat: ChatBox): void {
121
127
  if (state === 'denied') return { key: 'denied', text: deniedHelp(), tone: 'bad' };
122
128
  if (state === 'failed') return { key: 'failed', text: 'No microphone was found. Check it is plugged in and allowed.', tone: 'bad' };
123
129
  if (state === 'full') return { key: 'full', text: 'Voice is full here: 8 players are on it already.', tone: 'bad' };
130
+ // FM8 mode 32: a peer voice couldn't reach after every retry; text chat goes on, and Try again asks afresh
131
+ const stuck = voice.unreachable;
132
+ if (state === 'on' && stuck.length > 0 && now < blockedUntil) return { key: 'voice-failed-blocked', text: 'Voice can\'t connect here, so no one hears you. Text chat still works.', tone: 'bad' };
133
+ if (state === 'on' && stuck.length > 0) return { key: `voice-failed:${stuck.map(peer => peer.id).join(',')}`, text: `Voice couldn't connect${stuck.length === 1 ? ` to ${stuck[0]?.name ?? 'a player'}` : ` to ${String(stuck.length)} players`} on this network. Text chat still works.`, tone: 'bad' };
124
134
  if (state === 'on') return others.length === 0 && now < aloneUntil ? { key: 'alone', text: voice.mode === 'hold' && !touch ? `You're on voice. Hold ${voiceTalkKey()} to talk.` : 'You\'re on voice. Players here hear you once they join.', tone: 'ok' } : null;
125
135
  if (state !== 'off') return null;
126
136
  if (now < offUntil) return { key: 'off', text: `Voice off. ${act()} to talk again.`, tone: 'ok' };
@@ -128,7 +138,7 @@ export function voiceUi(scope: Scope, voice: VoiceChat, chat: ChatBox): void {
128
138
  if (now < firstUntil) return { key: 'first', text: touch ? 'Tap the mic to talk with players here.' : `${act()} (or click the mic) to talk with players here.`, tone: 'ok' };
129
139
  return null;
130
140
  };
131
- let drawnOff: string | null = null, drawnTip: string | null = null;
141
+ let drawnOff: string | null = null, drawnTip: string | null = null, tipScope: Scope | null = null;
132
142
  const chips = new Map<string, { readonly chip: HTMLButtonElement; readonly label: HTMLSpanElement; readonly action: HTMLElement }>();
133
143
  const chipFor = (peer: VoicePeer): HTMLButtonElement => {
134
144
  let held = chips.get(peer.id);
@@ -171,9 +181,17 @@ export function voiceUi(scope: Scope, voice: VoiceChat, chat: ChatBox): void {
171
181
  tip.dataset['tone'] = shown.tone; tip.dataset['key'] = shown.key.split(':')[0] ?? shown.key;
172
182
  const text = document.createElement('span'), close = document.createElement('button');
173
183
  text.textContent = shown.text; close.type = 'button'; close.textContent = '×'; close.setAttribute('aria-label', 'Dismiss');
174
- scope.listen(close, 'click', () => { dismissed = shown.key; if (shown.key === 'first') seen(); render(); });
184
+ tipScope?.dispose(); tipScope = new Scope('voice-tip', scope);
185
+ tipScope.listen(close, 'click', () => { dismissed = shown.key; if (shown.key === 'first') seen(); render(); });
175
186
  tip.replaceChildren(text, close);
187
+ if (tip.dataset['key'] === 'voice-failed' || tip.dataset['key'] === 'voice-failed-blocked') {
188
+ const again = document.createElement('button'); again.type = 'button'; again.textContent = 'Try again'; again.dataset['action'] = 'retry';
189
+ tipScope.listen(again, 'click', () => { again.disabled = true; again.textContent = 'Trying…'; void voice.retryUnreachable(); });
190
+ close.before(again);
191
+ }
176
192
  }
193
+ const failmode = shown?.key.split(':')[0];
194
+ if (failmode === 'voice-failed' || failmode === 'voice-failed-blocked') tip.dataset['failmode'] = failmode; else delete tip.dataset['failmode'];
177
195
  }
178
196
  for (const id of chips.keys()) if (!voice.roster.has(id)) { chips.get(id)?.chip.remove(); chips.delete(id); }
179
197
  peers.hidden = voice.state !== 'on' || voice.roster.size === 0;
@@ -25,7 +25,7 @@ import type { SimCommand, SimExternalPlayer, SimHost, SimPlayerBody, SimPlayerDr
25
25
  /** The world-space command a tick's input means. */
26
26
  /** Developer boost is a Developer page's, on its own server: a standalone worker says so at boot, and any other host ignores the button. */
27
27
  let developerBoost = false;
28
- export function allowDeveloperBoost(): void { developerBoost = true; }
28
+ export function allowDeveloperBoost(on = true): void { developerBoost = on; }
29
29
  export function simCommandOf(input: SimTickCommand): SimCommand { return 'seq' in input ? netSimCommand(input) : input; }
30
30
  /** A board whose "riding near the ride height" is the fall's ground. */
31
31
  function boardOn(fall: { grounded: boolean }): BoardState & { on: boolean } {
@@ -9,7 +9,7 @@ import { mountedPlayerOf } from '@wildshard/engine/game/riding/native';
9
9
  import type { GridAssembly, GridCell, GridPoint } from '../../../shared/game/grid/assembly';
10
10
  import type { ResidencyAllocator } from '../../../shared/game/grid/allocator';
11
11
  import { GridContinuationCache, GRID_CONTINUATION_CACHE_BYTES } from '../../../shared/game/grid/continuations';
12
- import { gridBoardLimit } from '../../../shared/game/grid/rules';
12
+ import { gridBoardLimitAt } from '../../../shared/game/grid/rules';
13
13
  import { leadPlayer } from '@wildshard/engine/sim/leadPlayer';
14
14
 
15
15
  /** Admission returns one owned, renderer-free regional host; its world is always in authored local coordinates. */
@@ -327,10 +327,7 @@ export class GridSimulation {
327
327
  /** A seat's board cap, read in world space from wherever it stands: a resident host's feet are its cell's (P1-E5.3-A10). */
328
328
  private boardLimit(player: string): number {
329
329
  const site = this.current(player), seat = this.seat(this.hostAt(site), player), { assembly } = this;
330
- const feet = site === null ? seat.position : assembly.world(seat.position, assembly.cell(site));
331
- const p = assembly.pitch, cx = Math.round(feet.x / p), cz = Math.round(feet.z / p), cell = assembly.cells.find(row => row.cell[0] === cx && row.cell[1] === cz);
332
- return gridBoardLimit({ local: { x: feet.x - cx * p, y: feet.y, z: feet.z - cz * p }, shardCap: 14, onHighwayDeck: feet.y < 4,
333
- speedClass: cell?.speedClass ?? 'shard' });
330
+ return gridBoardLimitAt(assembly, site === null ? seat.position : assembly.world(seat.position, assembly.cell(site)));
334
331
  }
335
332
  /** The empty seat a player takes on arrival. The lead's is always there; anyone else's is made for them. */
336
333
  private arrivalSeat(host: SimHost, player: string, traveller: PlayerSim): PlayerSim {
@@ -345,7 +342,7 @@ export class GridSimulation {
345
342
  /** One tick for every world with a player in it: each player's command goes to the host it stands in. */
346
343
  stepAll(commands?: ReadonlyMap<string, SimTickCommand>): void {
347
344
  if (this.disposed) throw new Error('Grid simulation is disposed');
348
- for (const [player, site] of this.sites) this.seat(this.hostAt(site), player).hoverSpeedLimit ??= () => this.boardLimit(player);
345
+ this.capBoards();
349
346
  const sites = new Set(this.sites.values());
350
347
  for (const site of sites) {
351
348
  const host = this.hostAt(site); this.ports.beforeMove?.(site, host);
@@ -358,8 +355,17 @@ export class GridSimulation {
358
355
  /** One tick of one world, for a room stepping its own (`stepAll` does every world). */
359
356
  stepSite(site: string | null, commands: ReadonlyMap<string, SimTickCommand>): void {
360
357
  if (this.disposed) throw new Error('Grid simulation is disposed');
358
+ this.capBoards(site);
361
359
  const host = this.hostAt(site); this.ports.beforeMove?.(site, host); host.step(commands);
362
360
  }
361
+ /**
362
+ * Every seat's board takes the page's grid cap (`boardLimit`) before its world steps, by whichever path steps it. QA 11-15 row 8:
363
+ * only `stepAll` installed it, so the in-page server's rooms (`stepSite`, and a cell world stepping itself) ran 14 m/s on the road
364
+ * and 56 boosted against the page's 30 and 60 (now 120). `site` limits it to that world's seats.
365
+ */
366
+ capBoards(site?: string | null): void {
367
+ for (const [player, at] of this.sites) if (site === undefined || at === site) this.seat(this.hostAt(at), player).hoverSpeedLimit ??= () => this.boardLimit(player);
368
+ }
363
369
  /** Every world with a player in it. */
364
370
  occupiedSites(): ReadonlySet<string | null> { return new Set(this.sites.values()); }
365
371
  /** Global render pose is derived from local feet and the current frame, never saved into an authored host. */
@@ -17,6 +17,7 @@ import { openRoad } from '../standalone/roadWorld';
17
17
  import type { HeadlessRuntimeInput } from '../headlessRuntime';
18
18
  import type { CellOrder, WorkerNews, WorkerReading, WorkerResident } from './cellProtocol';
19
19
  import { SeatTransport } from './socketPump';
20
+ import { allowDeveloperBoost } from '@wildshard/engine/sim/playerSim';
20
21
 
21
22
  /** How often a worker reads itself (E7.8). */
22
23
  export const READING_MS = 10_000;
@@ -62,6 +63,8 @@ export interface CellHostOptions {
62
63
  readonly booted?: (slug: string, room: DedicatedRoom) => void;
63
64
  readonly roaded?: (road: RoadRoom) => void;
64
65
  readonly playtest?:boolean;
66
+ /** QA 11-15 row 8 (G540): honour a Developer page's boost bit (on unless `WORLD_BOOST=off`, `cellWorker.ts`). */
67
+ readonly developerBoost?: boolean;
65
68
  /**
66
69
  * GC15 (`WORLD_CROSSING=worker`): the grid pack's road strips. Given, this worker hosts the road between its cells, each of its grid
67
70
  * cells opens onto it instead of standing in lone walls, and a seat walks cell, road, cell on one socket. Left out, or no strips, every cell is lone.
@@ -82,6 +85,10 @@ function installCellIdentity(): void {
82
85
 
83
86
  /** Run one worker's cells until it is told to close. Anything that ends it says `failed`, and the process ends (Q77). */
84
87
  export function runCells(port: CellPort, options: CellHostOptions): { dispose: () => void } {
88
+ // QA 11-15 row 8 (G540: Developer boost "everywhere"): a Developer page's boost bit moves its board here too, to the shared speed
89
+ // law's 56 m/s in a shard and 120 on the road (4x, Jake 11-15), so the page's prediction and this authority agree. Replaces E7.7's "never installed";
90
+ // `WORLD_BOOST=off` on a box turns it back off. The server can't tell a Developer page from another, so this trusts the bit.
91
+ allowDeveloperBoost(options.developerBoost !== false);
85
92
  const scope = new Scope('dedicated.worker'), started = diagnosticNow(), cells = new Map<string, Cell>();
86
93
  let clock: ServerClock | undefined, disposed = false, ready = false, ticks: number[] = [], ticked = 0, readAt = started, dropsAt = 0;
87
94
  /** SC8: each awake cell's own tick time since the last reading (ms summed, ticks counted), so a bench can weigh cells by awake cost. */
@@ -29,7 +29,7 @@ if (port === null) throw new Error('A cell runs in a worker');
29
29
  for (const row of placed ?? []) placeCell(row);
30
30
  const reads: PackReads = { fetched: 0, fetchedBytes: 0, cached: 0, refused: 0 };
31
31
  const rapier = await loadRapier(await readFile(new URL('rapier.wasm', import.meta.url)));
32
- runCells(port as unknown as CellPort, { slugs, build, bootId: () => randomBytes(4).toString('hex'), memory: () => process.memoryUsage(), ...(metrics === true ? { lag: loopLag() } : {}), closed: () => { process.exit(0); }, ...(holdMs === undefined ? {} : { holdMs }), ...(emptyMs === undefined ? {} : { emptyMs }),...(playtest===undefined?{}:{playtest}),...(crossing === true ? { road: async () => {
32
+ runCells(port as unknown as CellPort, { slugs, build, developerBoost: process.env['WORLD_BOOST'] !== 'off', bootId: () => randomBytes(4).toString('hex'), memory: () => process.memoryUsage(), ...(metrics === true ? { lag: loopLag() } : {}), closed: () => { process.exit(0); }, ...(holdMs === undefined ? {} : { holdMs }), ...(emptyMs === undefined ? {} : { emptyMs }),...(playtest===undefined?{}:{playtest}),...(crossing === true ? { road: async () => {
33
33
  // A build whose server book has no grid pack gives a road with no strips: this line says so before anyone falls through it.
34
34
  const strips = await readPackGrid(build, { origin, cache }, reads);
35
35
  console.info(JSON.stringify({ at: 'road.pack', strips: strips.length, ...reads }));
@@ -25,7 +25,8 @@ import { ShopGate } from './shopGate';
25
25
  import { HOLD_MS, type ResumeAt, type RoomNews, type SeatEntry } from './cellProtocol';
26
26
  import { LEFT } from './socketPump';
27
27
  import type {PlaytestHit} from './playtest';
28
- import { cellFrame, cellName } from './gridCells';
28
+ import { cellFrame, cellName, gridAssembly } from './gridCells';
29
+ import { gridBoardLimitAt } from '@wildshard/engine/game/grid/rules';
29
30
  import {hitHistoryOf} from '@wildshard/engine/combat/rewind';
30
31
  import { entrywaysStand, floorBelow } from '@wildshard/engine/physics/query';
31
32
  import type { GridAssembly } from '@wildshard/engine/game/grid/assembly';
@@ -228,6 +229,7 @@ export class DedicatedRoom implements CrossTarget {
228
229
  const aside = SPAWN_ASIDE[(this.joined++) % SPAWN_ASIDE.length] ?? 0, stand = { ...spawn, x: spawn.x + aside };
229
230
  const player = lead ? this.lead : host.addPlayer(body, at ?? doc?.at ?? stand, at?.yaw ?? doc?.at.yaw ?? spawn.yaw);
230
231
  player.netName = entry.name;
232
+ this.capBoard(player);
231
233
  if (lead) player.resetPose(stand, spawn.yaw);
232
234
  book.seat(body, doc?.ledger ?? { serial: 0, rows: [] });
233
235
  // Bind owned modifiers to the fresh body baseline before restoring its already modified health.
@@ -241,6 +243,17 @@ export class DedicatedRoom implements CrossTarget {
241
243
  }
242
244
  return seat;
243
245
  }
246
+ /**
247
+ * QA 11-15 row 8: a grid cell's board cap is the page's (`installGridHoverSpeed`): 14 m/s inside (G39), easing to the road's 30 over
248
+ * the strip (G60), 30 throughout a road-class padding cell (G540). Read from world feet: this cell's x and z moved by its placement.
249
+ * A cell the grid doesn't place keeps the standalone 14.
250
+ */
251
+ private capBoard(player: PlayerSim): void {
252
+ player.hoverSpeedLimit = () => {
253
+ const assembly = this.options.road?.assembly ?? gridAssembly(), cell = assembly.cells.find(row => row.instance === this.name);
254
+ return cell === undefined ? 14 : gridBoardLimitAt(assembly, assembly.world(player.position, cell));
255
+ };
256
+ }
244
257
  /** GC30: whether a walker off the road stands at this cell's entryways (`entrywaysStand`); else its worker's road walls it. */
245
258
  entrywaysStand(): boolean { return entrywaysStand(this.host.physics, ARRIVAL_LIFT); }
246
259
  /** GC15: this seat's feet left for cell `to`, standing at `at` in that cell's own frame. The door reads their save there and orders `handOver`. */
@@ -8,6 +8,7 @@ import type { Transport } from '@wildshard/engine/net/transport';
8
8
  import type { SimHost } from '@wildshard/engine/sim';
9
9
  import type { PlayerSim } from '@wildshard/engine/sim/playerSim';
10
10
  import { carryMotion, motionOf } from '@wildshard/engine/game/grid/simulation';
11
+ import { gridBoardLimitAt } from '@wildshard/engine/game/grid/rules';
11
12
  import type { GridAssembly, GridCell } from '@wildshard/engine/game/grid/assembly';
12
13
  import type { GridCollisionStrip } from '@wildshard/engine/game/grid/gridCollision';
13
14
  import { mountedPlayerOf } from '@wildshard/engine/game/riding/native';
@@ -87,6 +88,8 @@ export class RoadRoom implements CrossTarget {
87
88
  if (this.seats.has(entry.device)) return 'held';
88
89
  const player = this.host.addPlayer(entry.body, at, at.yaw);
89
90
  player.netName = entry.name;
91
+ // QA 11-15 row 8: the road's board cap is the page's (G60: 30 m/s on the deck, easing to 14 over a cell's strip); its frame is the world's
92
+ player.hoverSpeedLimit = () => gridBoardLimitAt(this.assembly, player.position);
90
93
  player.resetPose(at, at.yaw);
91
94
  if (motion !== undefined) carryMotion(motion, player);
92
95
  const seat: RoadSeat = { device: entry.device, name: entry.name, body: entry.body, transport, client: null, closeOff: null, holdEnds: null, asked: null, askedAt: 0, fall: new FallFloor(ROAD_FLOOR, true, at) };
@@ -218,7 +218,7 @@ export class StandaloneGrid {
218
218
  netWorldInput(routes, inputs); netBuys(routes, inputs);
219
219
  const stepping = sessionPlayer(this.grid.hostOf(site));
220
220
  this.grid.hostOf(site).physics.near?.update(stepping.position.x, stepping.position.z);
221
- if (world === undefined) this.grid.stepSite(site, commandsOf(inputs)); else world.step(inputs);
221
+ if (world === undefined) this.grid.stepSite(site, commandsOf(inputs)); else { this.grid.capBoards(site); world.step(inputs); }
222
222
  const host = this.grid.hostOf(site), player = sessionPlayer(host);
223
223
  // The page used to catch a fall, on its own body. The server's world has nothing below it, so it would fall for ever.
224
224
  world?.fall.step(player, () => { host.combat.fall(player.health, player.position, { kind: 'out-of-world', label: '' }); });
@@ -16,6 +16,12 @@ export interface LoadingWaitEntry {
16
16
  retryNavigation?: boolean;
17
17
  /** Exact transport identity for diagnostics; never the human work caption. */
18
18
  resource?: string;
19
+ /** FM6 (meta MMO-FAILURE-MODES-PLAN modes 33 to 35, 43, 44): the failure catalogue's ids for this wait (`packs-5xx`, `packs-429`,
20
+ * `book-5xx`, `storage-full`, `packs-5xx pack-broken`) and the line a player reads for it, with no address or raw error. */
21
+ failmode?: string;
22
+ line?: string;
23
+ /** A retry actually scheduled for this time (`diagnosticNow`): the card counts down to it. None scheduled, no countdown. */
24
+ dueAt?: number;
19
25
  }
20
26
  export interface LoadingWaitState { version: 1; sequence: number; pending: Map<number, LoadingWaitEntry> }
21
27
  const loadingWaitKey = Symbol.for('engine.loading.waits.v1');
@@ -40,7 +46,7 @@ export function loadingWaitState(target: object = waitCarrier()): LoadingWaitSta
40
46
  const state: LoadingWaitState = { version: 1, sequence: 0, pending: new Map() };
41
47
  Reflect.set(target, loadingWaitKey, state); return state;
42
48
  }
43
- export type LoadingWaitOptions = Partial<Pick<LoadingWaitEntry, 'kind' | 'step' | 'owner' | 'startedAt' | 'progressAt' | 'loadedBytes' | 'totalBytes' | 'retry' | 'inline' | 'resource' | 'retryNavigation'>>;
49
+ export type LoadingWaitOptions = Partial<Pick<LoadingWaitEntry, 'kind' | 'step' | 'owner' | 'startedAt' | 'progressAt' | 'loadedBytes' | 'totalBytes' | 'retry' | 'inline' | 'resource' | 'retryNavigation' | 'failmode' | 'line' | 'dueAt'>>;
44
50
  /** Register work without changing its lifetime or concurrency. Only an explicit
45
51
  * failed-operation callback offers RETRY; pending work never implies reload. */
46
52
  export function beginLoadingWait(label: string, options: LoadingWaitOptions = {}): number {
@@ -49,7 +55,9 @@ export function beginLoadingWait(label: string, options: LoadingWaitOptions = {}
49
55
  startedAt: options.startedAt ?? now, progressAt: options.progressAt ?? now, loadedBytes: options.loadedBytes ?? 0,
50
56
  totalBytes: options.totalBytes ?? null, retry: options.retry ?? null,
51
57
  progress: '', inline: options.inline ?? false, ...(options.resource === undefined ? {} : {resource: options.resource}),
52
- ...(options.retryNavigation === undefined ? {} : {retryNavigation: options.retryNavigation}) });
58
+ ...(options.retryNavigation === undefined ? {} : {retryNavigation: options.retryNavigation}),
59
+ ...(options.failmode === undefined ? {} : {failmode: options.failmode}), ...(options.line === undefined ? {} : {line: options.line}),
60
+ ...(options.dueAt === undefined ? {} : {dueAt: options.dueAt}) });
53
61
  return id;
54
62
  }
55
63
  /** Only real byte growth or a semantic progress-key change changes the reported progress age. */
@@ -22,6 +22,9 @@ export const CELL_ABOVE: number = contentBounds.CELL_ABOVE;
22
22
  export const CONTENT_MB: 1000000 = contentBounds.CONTENT_MB;
23
23
  /** Provisional phone caps v1 (SF22a); shadow draws count in each draw cap. */
24
24
  export const CONTENT_CAPS: { readonly l0: { readonly size: 62.5; readonly resident: number; readonly compressed: number; readonly triangles: 40000; readonly draws: 8; }; readonly l1: { readonly size: 125; readonly resident: number; readonly compressed: number; readonly triangles: 10000; readonly draws: 2; }; readonly far: { readonly resident: number; readonly compressed: 1000000; readonly triangles: 8000; readonly draws: 1; }; readonly library: { readonly resident: number; readonly compressed: number; }; readonly sim: { readonly resident: number; readonly compressed: number; }; readonly engineBase: number; readonly playing: number; readonly loading: number; readonly l0Count: 40; readonly l1Count: 32; readonly farCount: 9; readonly simCount: 4; readonly libraryCount: 4; readonly overlap: number; readonly residentFactor: 1.11; readonly nearRadius: 150; readonly shadowRadius: 80; readonly pitch: 562.5; } = contentBounds.CONTENT_CAPS;
25
+ /** GC13: the phone tier's playing envelope, G65's 1.0 GB (the shared caps' Explorer figure is 1.2 GB until SHARD-PLATFORM
26
+ * closes): a phone page admits, retains and evicts against this, so a straight walk stays under it. */
27
+ export const PHONE_PLAYING_BYTES: number = 1000 * contentBounds.CONTENT_MB;
25
28
 
26
29
  export const TERRAIN_RES = 256; // vertices per side
27
30
 
@@ -1,9 +1,9 @@
1
- /** Base cruise is 14 m/s standalone or a grid cap ≤ 30. Developer boost gives 4× interiors and 2× roads, easing over strips. */
1
+ /** Base cruise is 14 m/s standalone or a grid cap ≤ 30. Developer boost is 4× everywhere: 56 in a shard, 120 on the road (J-road-4x). */
2
2
  export function hoverSpeed(limit?: number, boost = false): number {
3
3
  const base = limit ?? 14;
4
4
  if (!Number.isFinite(base) || base <= 0 || base > 30) throw new RangeError('Invalid hover speed cap');
5
- // Keep the strip smooth between 4× interior (56) and 2× road (60).
6
- return boost ? base <= 14 ? base * 4 : 56 + (base - 14) / 4 : base;
5
+ // Jake 11-15 12:10: "Road push should be a 4x as well. So this should go to 120". 4× of the cap stays smooth over the strip.
6
+ return boost ? base * 4 : base;
7
7
  }
8
8
 
9
9
  /** m/s² the board loses gliding with no input, at or below the 14 m/s standalone cruise (25 % of its acceleration). */
@@ -431,6 +431,16 @@ export const ENGINE_STRINGS = {
431
431
  "s_doctor_note": "Check every link the online world needs: this page, the signed release, the packs, the server and this browser.",
432
432
  "s_doctor_open": "Check connection",
433
433
  "s_doctor_failed": "Connection doctor",
434
+ "s_doctor_http_title": "The check didn't open",
435
+ "s_doctor_http_body": "The Connection check couldn't load just now. You're still here: try again, or go back to the game.",
436
+ "s_doctor_http_retry": "Try again",
437
+ "s_doctor_http_checking": "Checking…",
438
+ "s_doctor_http_back": "Back to the game",
439
+ "s_doctor_http_details": "Details",
440
+ "s_doctor_http_fact": "⟦0⟧. A check that opens says only that its page answered.",
441
+ "s_doctor_http_status": "HTTP ⟦0⟧",
442
+ "s_doctor_http_none": "No HTTP response",
443
+ "s_doctor_http_slow": "No answer in ⟦0⟧ s",
434
444
  "s_build_title": "Build",
435
445
  "s_build_running": "Running now",
436
446
  "s_build_check": "Check",
@@ -738,7 +748,8 @@ export const ENGINE_STRINGS = {
738
748
  "s_e94f3b418bf5": "Deletes the downloaded game files (every cache and the service worker) so the next load is a first visit. Keeps saves, settings and the review login.",
739
749
  "s_9c6373f9a730": "Sound effects: MOSS-SoundEffect v2 · Stable Audio 3 Medium — Powered by Stability AI",
740
750
  "s_ef691a454428": "Powered by Stability AI",
741
- "s_7fc7e56bbd7f": "Music: MiniMax-Music3"
751
+ "s_7fc7e56bbd7f": "Music: MiniMax-Music3",
752
+ "s_hover_boost": "Boost"
742
753
  } as const;
743
754
  export type EngineStringKey = keyof typeof ENGINE_STRINGS;
744
755
  const overrides: Partial<Record<EngineStringKey, string>> = {};
@@ -25,6 +25,18 @@ export function gridBoardLimit(state: GridHoverState): number {
25
25
  const cap = gridHoverSpeed(state.local, state.shardCap, state.speedClass);
26
26
  return gridZone(state.local) === 'highway' && !state.onHighwayDeck ? state.shardCap : cap;
27
27
  }
28
+ /** What `gridBoardLimitAt` reads of a grid: its pitch and each placed cell's spot and speed class (`GridAssembly`). */
29
+ export interface GridHoverCells { readonly pitch: number; readonly cells: readonly { readonly cell: readonly [number, number]; readonly speedClass?: 'road' }[] }
30
+ /**
31
+ * The board's cap at world-frame feet on this grid: the in-page server's and a dedicated worker's road and cell rooms' one read of
32
+ * it, the same `gridBoardLimit` the page's `installGridHoverSpeed` reads, so prediction and authority agree (QA 11-15 row 8: G60's
33
+ * 30 m/s road, G39's 14 m/s shard, G540's road class).
34
+ */
35
+ export function gridBoardLimitAt(grid: GridHoverCells, feet: Readonly<GridPoint>, shardCap = 14): number {
36
+ finite(feet);
37
+ const p = grid.pitch, cx = Math.round(feet.x / p), cz = Math.round(feet.z / p), cell = grid.cells.find(row => row.cell[0] === cx && row.cell[1] === cz);
38
+ return gridBoardLimit({ local: { x: feet.x - cx * p, y: feet.y, z: feet.z - cz * p }, shardCap, onHighwayDeck: feet.y < 4, speedClass: cell?.speedClass ?? 'shard' });
39
+ }
28
40
  /** Minimal board port for standalone and residency policy; no Player or browser dependency enters here. */
29
41
  export interface GridHoverPort { hoverSpeedLimit: (() => number) | null }
30
42
  /** A directly opened padding shard uses its same authored road class; ordinary shards retain their existing port. */