Pause on arival #11

Closed
opened 2026-09-19 09:31:04 +02:00 by kamilkrzywda · 1 comment
Owner

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

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

Fixed in v0.19.0 (PR #24, merge commit 6e143939), deploying to https://flight.dev.kkhost.pl now.

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 in flight (and the sim isn't paused), the stored time scale is set to 1× — the slider reflects it on the next snapshot. No auto-restore by design: you speed up manually again when you dispatch the next flight. Arrival-triggered rather than continuous idle-enforcement, so manual scale control is untouched whenever no flight has happened.

Tests: 4 new unit tests (last plane lands → 1×; landing while another still flying → unchanged; already at 1×; paused) + new e2e/auto-slow.spec.ts (fly a short leg at 1000×, assert server timeScale === 1 after landing, then manual speed-up back to 1000× works). Existing out-and-back e2e legs re-set the scale before return flights since landings now slow the sim.

Fixed in **v0.19.0** (PR #24, merge commit `6e143939`), deploying to https://flight.dev.kkhost.pl now. 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 in flight (and the sim isn't paused), the stored time scale is set to **1×** — the slider reflects it on the next snapshot. No auto-restore by design: you speed up manually again when you dispatch the next flight. Arrival-triggered rather than continuous idle-enforcement, so manual scale control is untouched whenever no flight has happened. Tests: 4 new unit tests (last plane lands → 1×; landing while another still flying → unchanged; already at 1×; paused) + new `e2e/auto-slow.spec.ts` (fly a short leg at 1000×, assert server timeScale === 1 after landing, then manual speed-up back to 1000× works). Existing out-and-back e2e legs re-set the scale before return flights since landings now slow the sim.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: OpenCode/Flight-Ops#11