Skip to content

Fix jump range model: drop stray x1000 (Route card hint was ~17x too high) - #223

Merged
demortes merged 1 commit into
mainfrom
fix/jump-range-formula
Oct 22, 2026
Merged

demortes merged 1 commit into
mainfrom
fix/jump-range-formula

Conversation

@demortes

Copy link
Copy Markdown
Contributor

Problem

The Route card's No boost hint ("plain jumps at your ship's ~N ly range") showed a range roughly 17× too high.

Cause

ShipFsdProfile.JumpRangeAt computed (1000 * fuel / fuelMultiplier)^(1/power). The standard FSD formula has no 1000. The pinned unit test repeated the same mistake, and comments in StreamCardMapper / its test explained the discrepancy away as "solving a different problem" rather than questioning it.

How I checked

For every Loadout in the commander's last 25 journals (19 distinct builds, incl. the new Anaconda Mk II, Panther Mk II, Explorer NX, Small Combat NX, Mandalay, Lakon Miner), compared the model to the game's own MaxJumpRange:

Model Result
Old (×1000) 10–20× too high on every ship
Standard formula, full tank mass −1.4 % to −8 % (the game's headline figure carries only one jump's fuel)
Standard formula, unladen + one jump's fuel 0.00 % on all 16 non-booster builds

The 2 Type-9 builds with a Guardian FSD booster are off by design (the model excludes the booster, as documented).

Side result for the "game update" question: no FSD in those loadouts is missing from FsdCatalog, and the constants are exact for the SCO / Mk II-era drives, so the catalog itself needs no change.

Change

  • JumpRangeAt: remove the 1000 *; doc comment says what it matches and when.
  • RouteCardViewModel.ShipRange: prefer the Loadout's MaxJumpRange (includes a booster), fall back to the model.
  • Tests: formula pinned correctly + a sanity bound ("tens of ly, not hundreds"), plus a regression test using a real engineered Anaconda Mk II loadout that must reproduce the game's 34.576 ly. Stale comments in the mapper and its test corrected.

Verified

dotnet build 0 warnings; all suites green (24 + 214 + 28 + 421 + 1127).

🤖 Generated with Claude Code

…rd hint ~17x

ShipFsdProfile.JumpRangeAt multiplied the fuel by 1000 before applying the
fuel-power term, so it answered in the hundreds of ly. The Route card's
"No boost" hint ("plain jumps at your ship's ~N ly range") showed that figure.
The pinned test copied the same mistake, and the Twitch mapper's comments
explained the gap away as "solving a different problem".

Against 19 recent real Loadouts (Anaconda Mk II, Panther Mk II, Explorer NX,
Mandalay, Lakon Miner, ...), the standard formula at unladen mass + one jump's
fuel matches the game's MaxJumpRange to 0.00% for every build without a
Guardian booster. So the FsdCatalog constants are current; only the formula
was wrong.

The Route card now prefers the Loadout's own MaxJumpRange (which includes a
booster) and falls back to the model.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 53 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c12f4839-0c8d-448d-8630-8beab52cc074
📥 Commits

Reviewing files that changed from the base of the PR and between 5436a79 and b98b486.

📒 Files selected for processing: 5
  • src/EDNexus.App/ViewModels/Cards/RouteCardViewModel.cs
  • src/EDNexus.Core/Ship/ShipFsdProfile.cs
  • src/EDNexus.Core/Twitch/StreamCardMapper.cs
  • tests/EDNexus.Tests/Ship/ShipFsdProfileTests.cs
  • tests/EDNexus.Tests/Twitch/StreamCardMapperTests.cs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@demortes
demortes merged commit 6b430f5 into main Oct 22, 2026
2 checks passed
@demortes
demortes deleted the fix/jump-range-formula branch October 22, 2026 04:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant