v0.56.0 — idle fleet slows world clock to real-time instead of freezing (#128) #130

Merged
kamilkrzywda merged 1 commits from feat/idle-slowdown into master 2026-09-22 20:48:17 +02:00
Owner

Closes #128

A fully grounded fleet no longer freezes the sim clock: tickOnce advances by min(elapsed, MAX_TICK_ELAPSED_MS) × IDLE_WORLD_TIME_SCALE, where new constant IDLE_WORLD_TIME_SCALE = WORLD_TIME_SCALE / 24 (= exactly 1, real time) lives in lib/worldClock.ts. Packages keep spawning/expiring and the market stays fresh while idle; an active fleet keeps its full scale including any FLIGHT_TEST_HOOKS override (grounded + hook scale 1000 → ×1, not ×1000); lastRealTickMs still always tracks real time so resuming activity never fast-forwards the idle duration. The client mirror (advanceSimClock) extrapolates at the same idle rate instead of freezing.

Tests: unit — engine.test.ts pins clamped real-time advance, resume-without-catch-up, hook-scale-ignored-while-grounded and the constant itself; useSimClock.test.ts mirrors it. E2E — sim.spec.ts freeze test becomes bounded real-time delta; state.spec.ts restart test uses derived bounds (never backwards / ≤ one clamped downtime tick + live span); right-pane.spec.ts penalty preview allows the formula slope over one UI poll interval instead of racing a frozen clock. activateWorld/repair wrappers unchanged.

Closes #128 A fully grounded fleet no longer freezes the sim clock: `tickOnce` advances by `min(elapsed, MAX_TICK_ELAPSED_MS) × IDLE_WORLD_TIME_SCALE`, where new constant `IDLE_WORLD_TIME_SCALE = WORLD_TIME_SCALE / 24` (= exactly 1, real time) lives in `lib/worldClock.ts`. Packages keep spawning/expiring and the market stays fresh while idle; an active fleet keeps its full scale including any FLIGHT_TEST_HOOKS override (grounded + hook scale 1000 → ×1, not ×1000); `lastRealTickMs` still always tracks real time so resuming activity never fast-forwards the idle duration. The client mirror (`advanceSimClock`) extrapolates at the same idle rate instead of freezing. Tests: unit — engine.test.ts pins clamped real-time advance, resume-without-catch-up, hook-scale-ignored-while-grounded and the constant itself; useSimClock.test.ts mirrors it. E2E — sim.spec.ts freeze test becomes bounded real-time delta; state.spec.ts restart test uses derived bounds (never backwards / ≤ one clamped downtime tick + live span); right-pane.spec.ts penalty preview allows the formula slope over one UI poll interval instead of racing a frozen clock. activateWorld/repair wrappers unchanged.
kamilkrzywda added 1 commit 2026-09-22 20:37:47 +02:00
idle fleet slows world clock to real time instead of freezing (ISS-128)
CI / build + unit + e2e (pull_request) Successful in 10m32s
0a40143497
kamilkrzywda scheduled this pull request to auto merge when all checks succeed 2026-09-22 20:38:01 +02:00
kamilkrzywda merged commit 9b2938a5b0 into master 2026-09-22 20:48:17 +02:00
kamilkrzywda deleted branch feat/idle-slowdown 2026-09-22 20:48:18 +02:00
Sign in to join this conversation.