Skip to content

feat: mark static body keys AlwaysEvaluable#88

Open
jonpepler wants to merge 1 commit into
TeaGuild:mainfrom
jonpepler:telemachus/systemview-body-keys
Open

feat: mark static body keys AlwaysEvaluable#88
jonpepler wants to merge 1 commit into
TeaGuild:mainfrom
jonpepler:telemachus/systemview-body-keys

Conversation

@jonpepler
Copy link
Copy Markdown
Contributor

Summary

Marks 40 of the 41 b.* body-data keys AlwaysEvaluable = true in
VesselDataHandlers.cs. They read exclusively from
FlightGlobals.Bodies[bodyId] and have no dependency on the active
vessel, so gating them on "Flight scene with an active vessel" just hides
working data from the Space Center, Tracking Station, and editor scenes.
Currently any client querying body data outside a flight scene gets null.

The one key left alone is b.o.phaseAngle: it walks ds.vessel.orbit
and branches on ds.vessel.mainBody, so it's genuinely vessel-relative
and would null-ref outside a flight scene.

Scope

Single file, single kind of change — no new keys, no in-flight behaviour
change. AlwaysEvaluable already covers a.* (system info) and
t.universalTime; this extends the same treatment to the b.* keys.

Validation

dotnet build clean against the reference assemblies. These have been
running in my downstream dashboard against live KSP for a while now —
b.* subscriptions populate cleanly at the Space Center, Tracking
Station, and editor with no active vessel present, where they previously
returned null. Spot-checked again on this branch via the datalink
endpoint: b.name[0], b.radius[0], and b.o.PeA[0] all return correct
values at the Space Center, and b.o.phaseAngle still returns null
outside flight.

The b.* body data (name, radius, soi, orbit elements, etc.) reads
straight from FlightGlobals.Bodies, not from the active vessel, so
gating it on 'Flight scene with vessel' just hides data from non-
flight scenes (KSC, Tracking Station, editors). Marks every b.*
key AlwaysEvaluable except b.o.phaseAngle, which is genuinely
vessel-relative (uses ds.vessel.orbit and ds.vessel.mainBody).

Lets the gonogo SystemView widget populate its body diagram +
almanac while sitting at the Space Center.

The earlier draft of this change also marked tar.availableVessels
AlwaysEvaluable, but that endpoint is introduced by the
tar-available-vessels branch — moved out of this commit so this
branch sits cleanly on origin/main. The tar-available-vessels
branch should fold AlwaysEvaluable into its tar.availableVessels
TelemetryAPI attribute directly when it lands.
@jonpepler jonpepler marked this pull request as ready for review May 29, 2026 00:01
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