Version:FS20 Frequency:Consistently Severity:High Bug description:
Updates dont run at their selected frequency. The faster they run, the more error they run at.
This is a continuaton of this thread.
After 1 min the 10hz loop is 4% off.
The 100hz loop is almost 30% off!!!
Is it possible you should be coding to E:SIMULATION TIME for your flow calculations rather then calculating deltas from an independent free-running clock? I do have similar calculations but the basic formulae Iām using are keyed off the simulation time so auto-correct for tiny errors on each update rather than accumulating a bigger error.
I do agree the absolute synchronisation of all sim variables to the simulation āclockā is fundamental to a working simulation, and the MSFS franchise regularly loses sight of how important the time is, but what youāre describing sounds possibly related to the coding technique.
The problem is that some values are dampened. If the framerate gets to low then the dampening values become higher and the whole system breaks.
Some people play with 15fps + 4x frame gen. I would have to slow the whole plane down for things to work correctly for them.
My engine combustion simulations runs with the games frame rate using āa:animation delta timeā. We had problems with low framerates and I had to limit it below 30fps.
Small things like my airspeed and alitude needles and wingflex are alot lighter/faster, they breakdown below 60fps, which is why i put them on a 120hz loop.
Turns out it was only really running at 60hz but half speed. In FS24 they run correctly at 120hz, but thats 2x what i wantedā¦
BeamNG run their calculations at 2000hz, and its still janky sometimes.
Lol yup something is definitely going wrong there. Iād recommend using E:SIMULATION TIME rather than some delta value the sim might give you related to the graphics, i.e. for the wing flex you just want to know āthese input vars occurred at time tā.
If the ādampeningā code is yours, thereās a good answer on an exponential time series average with variable time steps here:
The core idea is the dampening period (e.g. a second for an ASI needle) is an absolute value independent of the simvar update periods.
If the dampening is in someone elseās code then youāre probably stuffed unless you can re-implement that.
Maybe a simpler alternative to the exponential moving average stuff could be to implement a separate āupdateā component with a slower update rate you could be confident of, and then you could do simpler but more reliable moving average. If your animation update is at a higher rate then you could interpolate the two most recent values.