• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FS2004 18Hz gauge refresh

Messages
206
Country
unitedkingdom
I've read many times that there is this 18Hz default panel refresh rate, and now I seem to have found a specific probelm where it is relavent. I guess it's hard coded into the simulator somewhere... but if not, can it be changed? Or else does anyone know where it is defined so I can have a look if it can be tweaked?

Here's why I might be interested in doing such a thing:

I have made an interesting observation with regard to flickering / tearing of 2D panel XML gauges: They never flicker when the framerate is locked to 18 FPS.

What seems to be happening in the 'flickers' is that the gauge is not being given enough time to finish drawing before the next frame is called. In gauges where there are many elements this can lead so stuff only being half-drawn in some frames. That means that complex gauges like EICAS, EHSI, PFD etc show flickering. However, with the graphics drivers that cause flickering (almost all the recent ones), the FPS achieved by the sim is very 'good' and outside scenery rendering is smooth and fluid. The flickering is much worse at high FPS (bad at 30 and unbearable at 60FPS, a rate that I could not easily achieve in the other drivers).

With drivers where the flickering does not occur, the simulation is not smooth when gauges are displayed - so this supports my guess is that the rendering engine is now somehow 'waiting' for the gauges to finish displaying before starting the next drawing operation.

This is going to require some more testing, but it looks like the flickers do not occur if the FPS is locked to 18. I am testing at 24FPS but I am worried that there will be flickering - I can lock to 30 FPS easily in most situations but then get the flickers...

Note: This is mostly with my AMD Radeon 7970 setup with dual-screen EyeFinity. I see flickering with all 13.x CCC drivers and all 12.x drivers later than 12.11.beta6. However, this flickering was also present with my nVidia setup (with a triplehead2go for the multi-screens) and was one of my reasons to try an AMD card! It was, however, never observed on Windows XP x64 and only started happening when I migrated my FS9 setup to Windows 7 x64. The anatomy of the XML gauges in question have changed little during that change.

PS. I would welcome any comments about this, but even if not, my primary reason for posting this is to make the information available in case others have the same problems...

Geoff
 
There is no way to change the 18.2hz update cycle... however, that's not the render cycle. The render cycle is based off of the speed of your system, thus if the frame rates are 30fps... then the render cycle is calling a guage render routine 30 times per second.

However, a great deal of gauge updating happens in the update cycle, not the render cycle and that can indeed cause issues if your update cycle takes longer than 0.054 milliseconds.
 
There is no way to change the 18.2hz update cycle... however, that's not the render cycle. The render cycle is based off of the speed of your system, thus if the frame rates are 30fps... then the render cycle is calling a guage render routine 30 times per second.

However, a great deal of gauge updating happens in the update cycle, not the render cycle and that can indeed cause issues if your update cycle takes longer than 0.054 milliseconds.

Ok, that's interesting... So if I understand correctly, the panel and gauges will attempt to update their data at 18.2Hz and the rendering engine will then attempt to output an image (including that data) at whatever framerate is given. If the gauges cannot finish their update in time then there may be issues?

I wonder whether there is a way to 'time' the update speed of a gauge and see if it is taking more than 1/18.2 sec? I would guess that something clunky like looking at a timestamp at the beginning and end of the script would not work as they would both just give the time when the whole lot was parsed with no difference between the two..? I'd be interested to know what I have managed to code into them that takes that long to process? I guess probably formatted text lists are a candidate...

I also wonder if setting the 'problem' gauges that flicker to a lower refresh rate would have any impact (ie setting an update section)? I would guess not though as those gauges would still be 'looked at' at 18Hz but just change at the specified rate?

More testing tonight I guess...

The thing that I find really strange is that surely the whole setup should be coded so that it runs at the slowest fully refreshable rate - ie the FPS could not exceed the 'real' refreshing speed of the slowest gauge in view..?

Geoff
 
I wonder whether there is a way to 'time' the update speed of a gauge and see if it is taking more than 1/18.2 sec? I would guess that something clunky like looking at a timestamp at the beginning and end of the script would not work as they would both just give the time when the whole lot was parsed with no difference between the two..? I'd be interested to know what I have managed to code into them that takes that long to process? I guess probably formatted text lists are a candidate...
What you want to time is the difference between the start of the current cycle and the start of the precious cycle.
<!-- begin of gauge -->
(L:TimeCur, seconds) (&gt;L:TimePrev, seconds)
(P:ABSOLUTE TIME, seconds) (&gt;L:TimeCur, seconds)
(L:TimeCur, seconds) (L:TimePrev, seconds) - (&gt;L:TimeDiff, seonds)
<!-- rest of gauge -->
 
What you want to time is the difference between the start of the current cycle and the start of the precious cycle.

But I think that will just confirm the hard wired 55 ms gauge update cycle time, not how many ms within a cycle it takes to execute the gauge's code. Perhaps it is not possible to measure the latter, what do you think?

In the FS forums, I have not read about many, if any, gauges exceeding the 55 ms time out limit, and I think it could sometimes be difficult to notice such an issue in the first place. I suppose there are examples out there, just not much written about it.

We tested for cycle time out issues when documenting LOGGER XML-to-HDD file write performance, and I remember being impressed with how complex and lengthy the script had to be before the 55 ms time out limited complete execution of the gauge (evidenced by not all records successfully being written to HDD each update cycle). Certainly, no gauge that I had ever created before flirted with the 55 ms limit. But, that's not saying much.

I'll bet to most FS amateurs like me, how the Update rate functions, what really happens, and doesn't happen, when you change the Update frequency, etc., is not completely understood. Same thing, even more so, when it comes to graphics and FPS.

I would welcome a short discussion on the topic.

Bob
 
Last edited:
What you want to time is the difference between the start of the current cycle and the start of the precious cycle.
<!-- begin of gauge -->
(L:TimeCur, seconds) (&gt;L:TimePrev, seconds)
(P:ABSOLUTE TIME, seconds) (&gt;L:TimeCur, seconds)
(L:TimeCur, seconds) (L:TimePrev, seconds) - (&gt;L:TimeDiff, seonds)
<!-- rest of gauge -->

Yes, that works well and I have been using a slightly different version for testing - it does indeed come up with 18.4Hz regardless of the FPS.
However, it is not quite what I was asking above - I was wondering whether I could time the operating time of a block of code /in/ a gauge. ie:

<gauge>
Take timestamp
Do stuff
.
.
.
.
etc...
Take another timestamp and compare
</gauge>

... and as I expected, it does not work (returns zero). However, what I think I will do next (tonight if time allows) is look to see if all gauges get the same 18.4Hz rate, even the 'problem' ones...

PS. This is definately also VSync related - trying dynamic vsync or 1/2 vsync both increase the flickering FPS threshold but then the whole sim is very stuttery! So far the 'workable', but by no means 'sweet', spot is 24FPS where the sim will look smooth at zoom 0.5x and the gauges will only flicker occasionally in very heavy traffic / cloud...

Geoff
 
However, it is not quite what I was asking above - I was wondering whether I could time the operating time of a block of code /in/ a gauge. ie:

<gauge>
Take timestamp
Do stuff
.
.
.
.
etc...
Take another timestamp and compare
</gauge>

... and as I expected, it does not work (returns zero). However, what I think I will do next (tonight if time allows) is look to see if all gauges get the same 18.4Hz rate, even the 'problem' ones...

This is an interesting topic that doesn't get that much press. Thanks for bringing it up.

Your observation makes sense if within an individual update cycle, all instances of a timer such as P:ABSOLUTE TIME have the identical value. If so, a subtraction always yields zero.

From what Ed mentioned earlier, I believe FS starts a new cycle every 55 ms regardless of whether or not a gauge has completed execution of the entire script...

It will be very interesting to see if you have any gauge that runs "long".
 
You should also consider this:

Your update cycle may easily fall within the 18hz cycle limit... but the resulting image may not. If your final gauge image is very complex, then that too can be a source of issues as the rendering is still happening when the next update gets called.

It's hard to remember that everything going on in FS is not 100% synchronous.
 
I guess this has to be a driver glitch rather than my codeing now. I have been testing a little more and found some situations where the flickering will occur even at 18FPS locked - heavy snow, facing to the east at dawn at an airport with plenty of AI...
Also, at higher FPS in that situation there seems to be flickering on gauges that contain only a few (less than 10) elements and only one or two text or image parts! I have streamlined my code a lot in this little quest and I think I could only do so more if I was prepared to start losing functionality!
Hey-ho! Back to my trusty flicker free (yet stuttery) 12.11.beta6 drivers!!!

Geoff
 
Last edited:
It would be rational for FS to set all variables only at the start of the cycle. Otherwise reading the same variable more than once in a cycle could return different values. That could make a nonsense of comparisons!
 
<gauge>
Take timestamp
Do stuff
.
.
.
.
etc...
Take another timestamp and compare
</gauge>

... and as I expected, it does not work (returns zero). However, what I think I will do next (tonight if time allows) is look to see if all gauges get the same 18.4Hz rate, even the 'problem' ones...

Actually gauges can contain code to be rendered -<Elements>-, pure script -<Update>, and handlers -<Mouse> and <Keys>- which in time are executed different. <Update> scripts are executed always at 18 hz rate, witihin the entire panelset, no matter how much FPS are shown on the screen. <Element> scripts are by default executed at 18 hz but can be slowed down with a Frequency=n command. <Keys> handlers are executed on demand, and won't stop until the last one is processed. <Mouse> handlers are executed on demand as well. Frame rates depend, IMHO, only on the complexity of the graphichs and mesh (terrain,aircraft,objects) that need to be displayed.

Tom
 
My understanding is that gauges are updated at 18.2Hz, which is every 55 millisec. According to Zyskowski the main simulation loop is updated at a variable time interval ∆T based on the current frame rate the program is achieving.

Does anyone know how are these different rates are reconciled in FS?
 
Back
Top