v0.51.0 — spec card shows guaranteed (worst-case headwind) max range (#99) #104

Merged
kamilkrzywda merged 1 commits from feat/fuel-range-consistency into master 2026-09-22 11:10:04 +02:00
Owner

Closes #99

User report: "I cant fly longer range even if plane spec is showing its possible because its limited by fuel amount."

Recon: the display already used the exact closed-form inverse of requiredFuelFor (since v0.28.0) — but it was a NO-WIND figure, while both dispatch guards (flyPlane in lib/game/actions.ts and engine auto-chain in lib/sim/engine.ts) use wind-adjusted burn (windBurnFactor ∈ [0.8, 1.2]). A leg inside the displayed range 409s "insufficient fuel" under headwind — exactly the complaint.

Fix: single source of truth for what's guaranteed flyable — new MAX_WIND_BURN_FACTOR (=1.2) + guaranteedRangeKm() in lib/sim/movement.ts; spec card (RightPane market tab) now shows the worst-case-headwind range, so spec-possible ⟹ always dispatchable. Guards unchanged (they were correct).

Displayed "Max range" before → after: atr72 4436→3696 km · crj900 4434→3695 · e175 5460→4550 · a320 6048→5040 · a330 9999→8332 · b777 13045→10871 (= the ÷1.2 value seed.ts already assumed for job generation).

Tests: +15 unit (per-type consistency for all six catalog types incl. worst-case bound requiredFuelFor(burn×1.2, guaranteedRange) ≤ maxFuel and 1.05× overshoot; factor pinned to windBurnFactor(30,90,90)); e2e/right-pane.spec.ts updated to import guaranteedRangeKm (local mirror deleted). Local: tsc clean, vitest 389/389, playwright --list 59 tests.

Closes #99 User report: "I cant fly longer range even if plane spec is showing its possible because its limited by fuel amount." Recon: the display already used the exact closed-form inverse of requiredFuelFor (since v0.28.0) — but it was a NO-WIND figure, while both dispatch guards (flyPlane in lib/game/actions.ts and engine auto-chain in lib/sim/engine.ts) use wind-adjusted burn (windBurnFactor ∈ [0.8, 1.2]). A leg inside the displayed range 409s "insufficient fuel" under headwind — exactly the complaint. Fix: single source of truth for what's guaranteed flyable — new MAX_WIND_BURN_FACTOR (=1.2) + guaranteedRangeKm() in lib/sim/movement.ts; spec card (RightPane market tab) now shows the worst-case-headwind range, so spec-possible ⟹ always dispatchable. Guards unchanged (they were correct). Displayed "Max range" before → after: atr72 4436→3696 km · crj900 4434→3695 · e175 5460→4550 · a320 6048→5040 · a330 9999→8332 · b777 13045→10871 (= the ÷1.2 value seed.ts already assumed for job generation). Tests: +15 unit (per-type consistency for all six catalog types incl. worst-case bound requiredFuelFor(burn×1.2, guaranteedRange) ≤ maxFuel and 1.05× overshoot; factor pinned to windBurnFactor(30,90,90)); e2e/right-pane.spec.ts updated to import guaranteedRangeKm (local mirror deleted). Local: tsc clean, vitest 389/389, playwright --list 59 tests.
kamilkrzywda added 1 commit 2026-09-22 10:57:43 +02:00
kamilkrzywda force-pushed feat/fuel-range-consistency from dc2f2b420b to 8319b2fa78 2026-09-22 10:57:43 +02:00 Compare
kamilkrzywda scheduled this pull request to auto merge when all checks succeed 2026-09-22 11:08:26 +02:00
kamilkrzywda merged commit d31bc5d60f into master 2026-09-22 11:10:04 +02:00
Sign in to join this conversation.