Version: MSFS 2024 1.9.13.0 (Steam, PC) · SDK 1.8.1 · repro built on the SDK’s WasmAircraft sample (Gauge Aircraft preset)
While adopting the gauge variants of the update callbacks (XXX_gauge_pre_sim_physics_update … XXX_gauge_late_update), we found three issues. A minimal repro based on your WasmAircraft sample was sent to PrivateContent. It adds three probe gauges to GaugeModule that count every callback per frame, show the counts live on the cockpit screens, and log them to CSV.
1. XXX_gauge_pre_sim_systems_update is called twice per frame
Every other update callback is called exactly once per frame, but pre_sim_systems_update is called twice, back to back. In a 20,000-frame flight this happened in every frame, on both gauges that export it. Earlier flights showed a single call in only about 1 frame in 1,000–2,000. Any per-frame work done there (integrators, counters, state machines) runs twice.
2. With the documented signature, dTime is not reliable
The documentation gives the callbacks as void function_name(float dTime). Declared that way, dTime reads 0 for as long as Display debug wasm window is open, and the frame time otherwise. Over 20,000 frames with the window open, it read 0 in every frame.
The same probe declared like XXX_gauge_update, as (FsContext ctx, float dTime), gets the correct dTime in every frame, window open or not. In every call it also receives the same FsContext its gauge_init was given. So the gauge variants appear to be called as (FsContext, float).
Could you confirm the supported signature for the XXX_gauge_* and XXX_system_* variants, and correct the documentation?
3. Exporting the update callbacks silently disables XXX_gauge_update
Once a gauge exports the update callbacks, its XXX_gauge_update is never called again, and late_update takes its place in the frame. In the same flight, a gauge that doesn’t export them gets gauge_update every frame. The documentation only implies this through the frame diagram, which has no “WASM Update” step in 2024. An existing gauge that adds, say, pre_sim_physics_update loses its gauge_update without warning.
Please document this, including whether exporting any one of the callbacks is enough to trigger it.