Steve Lacey. Get yours at flagrantdisregard.com/flickr

The Stutters

| | Comments (20) | TrackBacks (0)

In a similar vein to The Blurries, stuttering, or hitching (as it is commonly known in the first person shooter communities) is another topic of interest and frustration amongst Flight Simulator users.

Stuttering is similar to the blurries, in that the blurries are commonly caused by a lack of time during the frame to get some other work done, but with stutters the problem is that the work has to be
performed in the particular frame (or series of frames), so the frame rate drops and the visual aspects of the simulation “stutter”.

So what’s going on?

I’ll assume for the purposes of this post that the computer is up to the job with reasonable performance and that you’re not running an Instant Messenger client, email, web browser or any other application
on the system that periodically may hit the network, perform some CPU intensive task or just lock the machine for a while.

I’ll also assume the machine is free of spyware and viruses and that it is setup optimally. Personally I recommend taking a look at Autoruns from Sysinternals to make sure the machine isn’t also running a bunch of stuff “helpfully” installed by other applications.

OK, so we’ve got a clean, fast machine and we’re still getting stutters. What’s causing them?

Flight Simulator does as much as possible to make sure that stutters do not occur, or that the impact is as small as possible. Our performance test suite of machine runs multiple flights and
scenarios on a wide variety of machines, tracking frame rate and variation in that frame rate. Stutters get caught by this and we aim to mitigate them.

A lot of work that can cause stutters, such as all loading of data from disk, are moved to a separate thread where they happen asynchronously. We perform tasks on fibers (as described in The Blurries), balance texture loading to the hardware, and generally try to do the right thing.

But, we’re human, and the application is dynamic (especially with users adding in add-ons), so we miss some stuff.

Some things that can be happening:

  • Fiber jobs running too long and busting through their allocated time slice. Remember, this is cooperative multitasking - they have to play nice.
  • We upload textures to the hardware once per frame and limit the amount of data we’ll transfer based on the performance characteristics of the machine. The limit may be wrong, or boosted too high by users aiming to mitigate The Blurries.
  • Something just took too long to run… This is the problem one and difficult to nail down.

And time for a mea culpa of behalf of the team. Remember that I said that all disk access was performed asynchronously? Well, that is true except for one case in FS9 - audio.

When we need to play a sound, that sound is loaded there and then. If it’s huge, then it could cause a stutter - such as when your wheels hit the runway upon landing and we want to play the wheel noise audio… Ooops. Sorry.

What can you do about it? Well, the short answer is “ask Flight Simulator to do less”. I know that might sound flippant, but things like rapidly changing views, pushing too many textures on a machine with low bus speed and/or restricted video memory, and generally overloading the application will cause issues.

As for the audio issue? Well, you might delete the touchdown sound from the aircraft’s sound config file (I can hear screams from the aircraft designers now…) or reduce it’s size.

With that out of the way, and in conclusion, it’s important to recognize that we hate the problem as much as you do.

But it’s also important to realize that we model the entire planet. It’s just not possible for us to load up an entire “level” and have it sit resident in system memory. It’s also not possible for us to preload all needed textures into video memory.

Even when a lot of games perform this shortcut, you’ll still see them stutter with lots of explosions and other stuff going on. It’s a hard problem.

Having said that, even though the problem is, by definition, practically impossible to solve with finite resources, we do treat it seriously and work hard to mitigate it.

Reducing stutters is as important to us as having a high frame rate.

Perhaps more so.

0 TrackBacks

Listed below are links to blogs that reference this entry: The Stutters.

TrackBack URL for this entry: http://www.steve-lacey.com/cgi-bin/mt/mt-bar.cgi/645

20 Comments

GZR_Frenchy said:

These are your best posts -- for me anyway. The digital camera post will be interesting.

Flying Golden Silver by Madam and Mr.Lyons as I type.

Early conclusion: Not too shabby. Really, not too shabby. Translation: Good stuff.

Ric.

Emerson de Oliveira said:

Steve,

You said: "We upload textures to the hardware once per frame and limit the amount of data we’ll transfer based on the performance characteristics of the machine."

By the way, one big concern is the 3D clouds, which stress a lot the video hardware probably becase the big amount of texture processing they demand. I reduced their size to 256x256 and converted them to DXT3. This gave me a 30% increase in performance on my Radeon X800XT-PE, in cloudy weather (several layers). The next step will be upgrade to a 512MB video card in order to get more FPS in cloudy weather ("3D clouds" only).

If I upgrade my CPU to a faster one, and upgrade my video card from 256MB to a 512MB model, will FS take advantage of the extra video memory, or there is a limit, hard-coded into the software (FS2004), regarding texture loading to video memory?

-Emerson

Rune Skjoelingstad said:

Hi there Aces-team,
I have an idea, what if you use multple computers, to run flightsim, I mean if you are feeling, that your computer is strugling, you can add another computer to share the work, say off- load the weather to next computer, and then if its still not fast enough you can add another one for example to off-load the scenery-engine. Do you get the picture? all this incorporated in fs, using a
gigabit-(LAN-Switch). But the beauty with this system, would be that you only buy a second computer If you feel you need it, flightsim would work just as fs9 works today, but having the otion to offload to other computers, would revolutionize flightsim.. Hopefully this is a great sugestion for the new Flightsimulator.
Also thanks for exchanging tips and trics with the community!
:-)


PS don't mind all the typos, i was writing this in a hurry.

Steve said:

Emerson - The issue with clouds is not that of the size of the textures, but rather the fill rate needed to render them and the geometry transform needed (in FS9, cloud sprite transform is handled by the CPU).

The cloud textures themselves live on very few texture sheets and are reused heavilly. The needed textures are also downloaded when you load the flight, so don't have much of a being on stuttering.

The reason you're seeing a performance boost by making them smaller is probably due to caching issues on the GPU. The hardware has a small texture cache on it (similar to the CPU's L1 cache), and if it can hit that cache consistently, performance will go up. As your cloud textures are smaller, it is likely that the vast number of texture reads needed to render the clouds are hitting that cache more often.

I doubt a video card with more memory will help the cloud performance - but the fact that it is a probably a more performant card will probably help all by itself...

As to limits, no, we place no limits on the video memory we use - we use it until we run out, and scale accordingly. The more memory the better.

- Steve

Steve said:

Rune - ahhh, distributed computing. I agree, it would be cool, but a big architectural shift for the codebase, to be sure!

It'd be interesting to have all the components in the system completely encapsulated and able to be "remoted", but then issues of synchonization and prediction start to rear their ugly heads.

Sort of a multiplayer problem on steroids!

Let me see if I can sneak that feature in past our PM. Hmmm, maybe not this rev...

- Steve

Rune Skjoelingstad said:

Hey, Steve
Thanks for answering,
I have a couple of other features to ask for, new modelling of reversers on jets in fs. Instead of using the F2-key as always, you now have to unlock them first. You use F2-key, to unlock them, then the plus/minus-keys, or your yoke/joystick to controll the revers-thrust, then again, close the reversers with the F2-key, you can see what I mean in Flight Unlimited 3 on the Beechjet 400A.
Also would it be possible to have a better startup-seqence for jets/turbines, Include hydraulics, pressurisation, apu, those vital things to make a jet or turbine start. Please don't use the mixture axis to start a jet, because then the engines-rpm, will rise rapidly, that does not seem realistic, it would be realistic for a piston-engine, but not for a jet.. :-) And Last thing, Don't forget the sounds!! in this simmulator, listen to how il-sturmovick has made sounds, also modell-airplanes do this, there are different sounds in-front of a airplane compared as to when you are behind the propeller or turbines, add sounds to turbulence, and when you bank the aircraft fast(rumble sounds) and add gear-rumble /flaps/speedbrake-rumble and make it more scary to fly, it seems to easy to fly straight through a thunderstorm with with no problems afterwards, in reallife you would avoid this as much as possible. If possible you could modell better turbulence.. But please don't forget about sound, they are vital in the imersion feeling.. - - - - - - - - - - - -

OK thanks for listening. Please include these features! :-) I'm sure you super-talented guys can pull this off ;-)

- - - - - - - - - - - - - -

Best Regards Rune

Gary Letona said:

While we're on the subject of distributed computing, I would love to have the ability to display other gauge windows using a second computer (GPS, radio stack, overhead panel, throttoe quadrant, ect.). If you exclude exterior views, would this be doable? I've tried doing this using dual monitors on one PC but that hits framerates hard. My rig is a P4 1.5 gig, 1 gig RAM, Nvidia 6800GT.

Tail said:

Nein! No distributed processing for you! (What, you thought I didn't read your blog comments?)

Steve

Once again thanks for expounding on a subject which has been of much interest to Flight Simulator users for some time.

The limit may be wrong, or boosted too high by users aiming to mitigate The Blurries.

Would I be correct in thinking you're referring to TEXTURE_BANDWIDTH_MULT here? If that's the case, would you be able to give us a little more information on what the units are and how to come up with a good setting, or should we be sticking to the default?

John

Steve said:

Rune - I'll pass on those ideas. FYI, you should send them to tell_fs@microsoft.com. We really do read it, and it goes directly to quite a few people on the team.

- Steve

Steve said:

John - By default, the texture manager will upload a maximum number of texture's per frame. This is measured in bytes, and the default is the equivalent of three 256x256 textures with mips.

The 'three' comes from a configuration variable you may not be familar with. This is TextureMaxLoad in the DISPLAY section. The default is three.

This value is multiplied by the TEXTURE_BANDWIDTH_MULT configuration variable and divided by the target framerate only in the case where you have a target framerate set. With 'unlimited', the variable will have no effect. So, you can see that the value is a multiplier, rather than having any specific units.

I agree that this is not ideal, and we're working on it. But this information should hopefully give you more info to tweak to your heart's content ;-)

- Steve

Fabio said:

Hi Steve,

i have a question for you... if i fly with fs9 in full screen mode there s a chance of view main window (FS98MAIN) in full screen in one monitor and another window with another view in second monitor but in windowed mode.....???
i had create a fs9 module that manage HWND of FS98CHILD and move resize and close it but it doesnt work for my propose of one view in full screen and one view in windowed mode... i also try to send alt+enter windows message but nothing to do...

do you help me.... or answer at my first question???

thanks Fabio

John Farrie said:

Steve

It's probably worth clarifying that your aren't referring to TEXTURE_MAX_LOAD in the GRAPHICS section. This appears to determine the maximum loaded resolution of textures such as aircraft textures and is normally set via the Global Max Texture Size slider in FS Display Settings, Hardware.

As far as I can see, you're referring to an entirely different parameter, TextureMaxLoad, which doesn't exist in the default FS9.CFG file, so would have to be added manually (to the DISPLAY section) if anyone wanted to change the default.

Can I ask a couple of things about this:

  1. Is TextureMaxLoad specified in bytes or as the number of 256x256 textures with mips. In other words, is the default TextureMaxLoad=3 or is it TextureMaxLoad=131286 (where 131286 = 3 x 43,762 bytes)?
  2. Which variable are you saying has no effect with 'unlimited',  TextureMaxLoad or TEXTURE_BANDWIDTH_MULT?

One minor detail (presumably) which has always puzzled me is whether there is any significance to the trailing zeros in parameters such as TERRAIN_MIN_DEM_AREA=10.000000 etc. Do they mean anything, or could they just as well be dropped, e.g. TERRAIN_MIN_DEM_AREA=10.0 ?

John

Steve said:

John - correct, this is a parameter that is not written by default.

1 - Number of 256x256 textures with mips. The default is 3.
2 - TEXTURE_BANDWIDTH_MULT.

The trailing zeros should have no effect.

- Steve

John Farrie said:

Steve

Thanks for the clarification. Can I test your patience with a few more questions?

  1. Do the texture loading settings you're describing above apply to aircraft/building textures, or terrain textures, or both?
  2. What role does LOD_TARGET_FPS (in the GRAPHICS section of FS9.CFG) play?
  3. Are there any other settings which influence the way the textures are loaded?

Thanks again for all your help with this.

John

Steve said:

John -

  1. They apply to everything.
  2. LOD_TARGET_ADJUST is the framerate that the model system attempts to attain by scaling the LODs used when rendering. It really shouldn't affect the blurries or stuttering.
  3. That's about it...

- Steve.

Maurizio said:

Hi Steve!
I have a question for you about limiting frame rate in FS2004. Why, if I limit the fps, I get much more blurries than if I don't limit fps? I have a Ati 9700pro with 128Mb of video RAM.
Best Regards,

Maurizio

Maurizio said:

Excuse me Steve, I have read a same topic like my own in "blurries" section.

Best Regards,

Maurizio

Tim said:

Steve,

Quick question. I have a problem with my computer (FS9 and all) locking up about 15-20 minutes into flight. The only thing that I am doing different is that I am connecting to real weather updates in FS9 via wireless connecting (desktop 1G processor, 1G memory, 64MB 3D video.

I realize my video may be weak, but it was working fine with ActiveSky WXRE before I had higher Internet connectivity (18-36mbs) availablity. Spoke with my friend Dave, he's seeing the same thing in his laptop...

We think it's the online weather, which we think is crucial for good realtime flying.

Comments?

Thanks, Tim

D. Miron said:

Dear Steve,
Many, many thanks for your valuable advice regarding minimizing my terribe stutters. As per your recommendation, I have set texturemaxload=10 as well as Texture_Bandwith_Mult=100, max frames are 24 and Texture_max_load to be 1024.
The stutters did dissapear, but all of a sudden, they came back. I didn't change anything in my sim, except installing two new AI textures (EvolveAI a320 planes). I am troubled, first because of these stutters but also because not knowing what did I spoil.
My specs are: FS9.1, WinXP SP2, Radeon 9600 256MB, Dell Precision workstation 2.66GHZ.
Yours very truly,
D.Miron

Leave a comment

About Me

Steve Lacey, software developer at Google, British, married to the lurvely Nabila, dad to the wonderful Julian and Jasmine. Living in Kirkland (near Seattle), WA.


A brief professional bio.


steve@steve-lacey.com
+1 425 466 9305

About this Entry

This page contains a single entry by Steve published on November 17, 2005 12:32 PM.

Last night's gig was the previous entry in this blog.

The band's music played on TPN Rock is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Statsorama

  • 989 posts
  • 1149 comments

Music