v0.19.0 — ISS-011 auto-slow to 1× when all planes have landed #24

Merged
kamilkrzywda merged 1 commits from feat/auto-slow-on-idle into master 2026-09-19 20:27:01 +02:00
Owner

What (issue #11)

Game should slow down to 1x when all planes arrived on their destination (when not one of our plane is in flight).

Arrival-triggered auto-slow, server-side authoritative (lib/sim/engine.ts tickOnce): after a tick's landings are processed, if ≥1 plane landed this tick AND no plane remains 'flying' AND the sim isn't paused → stored timeScale is set to 1 in the same sim_state write as the clock. The UI slider reflects it on the next snapshot.

  • No auto-restore of the previous scale — the user manually speeds up again (minimal scope, by design)
  • Arrival-triggered rather than continuous idle-enforcement: matches "when all planes ARRIVED" and leaves manual scale control untouched when no flight has happened
  • clampTimeScale/validation semantics unchanged; paused state untouched; no API/OpenAPI changes

Tests

  • Unit (engine.test.ts, 4 new): last plane lands → timeScale 1; landing while another plane still flying → no change; already at 1× → stays; paused with all landed → no change
  • E2E (new e2e/auto-slow.spec.ts): set 1000×, fly the starter on a short leg, wait for landing, assert server timeScale === 1, then manual speed-up back to 1000× is confirmed

Existing-suite adjustment: out-and-back e2e legs assumed 1000× persists across a landing — with auto-slow the return leg would run at 1× (real-time hours vs ~2 s poll timeouts). flyHomeViaApi and affected restore legs now re-set SCALE before each return flight (4 spec files, test-mechanics only; documented in changelog).

Version

  • package.json → 0.19.0; CHANGELOG.md entry at top

Checks (local)

  • tsc --noEmit clean; unit 283/283 green (was 279); playwright test --list = 39 tests in 12 files
  • e2e not run locally by design — CI verifies against the isolated stack
## What (issue #11) *Game should slow down to 1x when all planes arrived on their destination (when not one of our plane is in flight).* **Arrival-triggered auto-slow, server-side authoritative** (`lib/sim/engine.ts` `tickOnce`): after a tick's landings are processed, if ≥1 plane landed this tick AND no plane remains `'flying'` AND the sim isn't paused → stored `timeScale` is set to 1 in the same `sim_state` write as the clock. The UI slider reflects it on the next snapshot. - **No auto-restore** of the previous scale — the user manually speeds up again (minimal scope, by design) - Arrival-triggered rather than continuous idle-enforcement: matches "when all planes ARRIVED" and leaves manual scale control untouched when no flight has happened - `clampTimeScale`/validation semantics unchanged; paused state untouched; **no API/OpenAPI changes** ## Tests - Unit (`engine.test.ts`, 4 new): last plane lands → timeScale 1; landing while another plane still flying → no change; already at 1× → stays; paused with all landed → no change - E2E (new `e2e/auto-slow.spec.ts`): set 1000×, fly the starter on a short leg, wait for landing, assert server timeScale === 1, then manual speed-up back to 1000× is confirmed **Existing-suite adjustment**: out-and-back e2e legs assumed 1000× persists across a landing — with auto-slow the return leg would run at 1× (real-time hours vs ~2 s poll timeouts). `flyHomeViaApi` and affected restore legs now re-set SCALE before each return flight (4 spec files, test-mechanics only; documented in changelog). ## Version - `package.json` → **0.19.0**; `CHANGELOG.md` entry at top ## Checks (local) - `tsc --noEmit` clean; unit 283/283 green (was 279); `playwright test --list` = 39 tests in 12 files - e2e not run locally by design — CI verifies against the isolated stack
kamilkrzywda added 1 commit 2026-09-19 20:15:12 +02:00
feat: v0.19.0 — ISS-011 auto-slow to 1x when all planes have landed
CI / build + unit + e2e (pull_request) Successful in 6m14s
86379fc9c6
kamilkrzywda merged commit 6e1439391a into master 2026-09-19 20:27:01 +02:00
kamilkrzywda deleted branch feat/auto-slow-on-idle 2026-09-19 20:27:01 +02:00
Sign in to join this conversation.