feat(motion): raise the cruising speed, and make the show gates follow it

Pieces still read as slow. Cruising speed goes from 120ms per unit to 85: the
median departure across the shipped fifty drops 970ms → 763ms and a level's
whole animation budget 15.6s → 12.7s, about 18% off. The longest departures do
not move — the cap holds them at 3.46s — so if those still drag, the dial is the
cap, which was settled separately and is left alone.

The gates that guarantee a level opens with something worth watching are stated
in milliseconds, and they were picked while a piece crossed a unit in 120ms.
Held fixed while the speed changes, they stop meaning what they meant: this
change alone made 20 of the 50 shipped levels "fail" an opening gate every one
of them had passed, purely from the unscaled number. Scaled to the dial, none
fail — the set is unchanged, and the alarm was an artifact of the constant. So
the cruise threshold and the opening floor now derive from the speed, naming
the speed they were calibrated at.

exitTiming takes msPerUnit the way it already took knee and maxMs, and the
comparison lab gets a speed slider, reads the levels actually shipping rather
than the prototype sweep they were selected from, and totals every route in the
campaign instead of the four on screen — those four skew long, where the cap
flattens any speed change to 6%.

The test that pins constant cruising speed now reads the dial from the token
instead of hard-coding 120, so tuning motion no longer looks like a broken
guarantee.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
cabinw
2026-09-14 18:46:32 +08:00
co-authored by Claude Opus 5
parent 34e6e73016
commit 073b682234
9 changed files with 88 additions and 43 deletions
+14 -1
View File
@@ -1,5 +1,6 @@
import { Game, available, key, opposite, random, rotateBoard, solveRotations, trace, validateLevel } from './core.js';
import { exitTiming } from './exit-animation.js';
import { MOTION } from './design-tokens.js';
const positionKey = tile => `${tile.q},${tile.r}`;
const countBends = route => route.steps.filter(step => step.enter !== null && opposite(step.enter) !== step.exit).length;
@@ -262,6 +263,18 @@ export function legibility(level) {
// route and leaving. So the show is measurable: how long each departure plays,
// whether the level opens with one, and — the failure the design brief names
// outright — how many actions can pass with nothing happening at all.
// What counts as a cruise, and what counts as an opening worth watching, were
// both picked in milliseconds while a piece crossed one unit in 120ms. Speed is
// a tuning dial, so holding those milliseconds fixed while the dial moves does
// not hold the experience fixed — it silently demands longer routes. Raising
// the speed once made 20 of 50 shipped levels "fail" an opening gate they had
// passed, purely from the unscaled number. They scale with the dial instead.
const SHOW_CALIBRATED_AT = 120;
const showScale = () => MOTION.exitMsPerUnit / SHOW_CALIBRATED_AT;
export const CRUISE_MS_AT_120 = 900;
const CRUISE_MS = CRUISE_MS_AT_120 * showScale();
export const openingShowFloor = (msAt120 = 800) => msAt120 * showScale();
export function showStats(level) {
const solution = solveRotations(level);
if (!solution.solvable || !solution.actions) return null;
@@ -295,7 +308,7 @@ export function showStats(level) {
medianMs: Math.round(sorted[Math.floor(sorted.length / 2)]),
longestMs: Math.round(sorted[sorted.length - 1]),
// A cruise: long enough that watching it is the point, not a blink.
cruises: shows.filter(ms => ms >= 900).length,
cruises: shows.filter(ms => ms >= CRUISE_MS).length,
firstShowMs: firstShow ? Math.round(firstShow.ms) : null,
firstShowAfter: firstShow ? firstShow.afterActions : null,
maxDryActions: maxDry,