V0.1.07 Highonsnow Glass Cockpit 11-19FPS boost on Airliners and 4-6FPS on GA Aircraft

NOTE: This mod is currently not effective on recent releases of MSFS as the goalposts have changed regularly in the codebase. Until a stable and predictable mechanism is found to improve the FPS of the aircraft, this mod should not be used. When a way forward has been found again, there will be a release again. Thanks for all of your support and understanding.

Thank you VERY much for your kind PayPal donations so far! They have been greatly appreciated!

Update September 17th 2020 - v0.1.07 - This mod overrides the fixes in place for the G1000 and G3000 and primarily focuses on the Airliners to get people back at workable FPS rates for the time being. It’s apparent that the refresh mechanism has changed dramatically and this is a hot fix to ensure that people have workable Airliners with operational flight plans (flight plans appeared to break in-aircraft).
Official Download: Highonsnow_InstrumentRefreshFPSPatch_0.1.07.zip

Update September 17th 2020 - v0.1.05 - DELETE v0.1.04 if you had downloaded it, it’s buggy and doesn’t work on a cold start. Update for patching MSFS v1.8.3 (for MSFS patch > release date September 16th 2020). There are still some FPS gains to be made in the Airliners, less so > in some glass cockpit GA aircraft, but there are still some FPS gains (see images).
19 FPS improvements in the Airbus A320 Neo
16 FPS improvements in the B747-8i
11 FPS improvements in the 787-10
(Airliners have marginally improved since previous MSFS version of the game compared to previous benchmarks with almost identical FPS gains still to be made by this mod)

6FPS improvements in the Beachcraft King Air 350i
6FPS improvements in the DA62
4FPS improvements in the TBM930
(Glass cockpit GA aircraft have improved since previous MSFS version of the game compared to previous benchmarks but still some gains to be made with this mod)

Above results tested on MSFS v1.8.3

Update September 9th 2020 - v0.1.03 - Update includes optimisations for instruments in the Airliner cockpits (lower latency on non PFD and MFD instrumentation), added instrumentation tuning for Aera, AS3X, AS1000 (MFD and PFD), AS3000 (MFD and PFD) for other aircraft included in MSFS.

Added Benchmarks:
21FPS improvements in the Beachcraft King Air 350i
17FPS improvements in the TBM930
10FPS improvements in the DA62

Update September 6th 2020 - v0.1.02 - Some changes to include the AS3000 instrument on 15ms timings, as well as moving the FCU instrument to 50ms timings.

Installation

Step 1: Extract the single folder contained in the downloaded ZIP file and place that folder in:

MS Store Version: %homepath%\AppData\Local\Packages\Microsoft.FlightSimulator_8wekyb3d8bbwe\LocalCache\Packages\Community
Or more directly: C:\Users<yourusernamefolder>\AppData\Local\Packages\Microsoft.FlightSimulator_8wekyb3d8bbwe\LocalCache\Packages\Community\

Steam Version: %homepath%\AppData\Roaming\Microsoft Flight Simulator\Packages\Community
Or more directly: C:\Users<yourusernamefolder>\AppData\Roaming\Microsoft Flight Simulator\Packages\Community\

Step 2: Start the game cleanly, making sure not to try to use the fix whilst the game is still running (close down game and start it cleanly, so that the fix is loaded on game start from the community folder)

Having looked through the source code of a lot of MSFS, it appears that there are some further improvements to be made around the place. I’m aware of other fixes, however this particular fix for airliners goes straight to the processing of the data for the individual instruments/screens, preventing the CPU cycles from being used, rather than skipping frames for rendering (which does have an impact, but would still result in wasted CPU processing of data of the skipped frames).

This fix affects the file BaseInstrument.js located in:
asobo-vcockpits-instruments\html_ui\Pages\VCockpit\Instruments\Shared\

The updated is self contained inside the createMainLoop() function, which takes a targeted approach of deciding what sort of update times should affect which instrument or range of instruments.

    if(this._MainLoopOverride)
    {
        this._refreshTime = 50;
    	
        if(this.instrumentIdentifier.startsWith("Aera"))
        {
            this._refreshTime = 50; // Tuned
       	}
        else if(this.instrumentIdentifier.startsWith("AS3X"))
        {
            this._refreshTime = 15; // Tuned
       	}
        else if(this.instrumentIdentifier.startsWith("AS1000"))
        {
            if(this.instrumentIdentifier.includes("MFD"))
            {
                this._refreshTime = 50; // Tuned
       	    }
            else if(this.instrumentIdentifier.includes("PFD"))
            {
                this._refreshTime = 15; // Tuned
       	    }
       	}
        else if(this.instrumentIdentifier.startsWith("AS3000"))
        {
            this._refreshTime = 40;
            if(this.instrumentIdentifier.includes("MFD"))
            {
                this._refreshTime = 50; // Tuned
       	    }
            else if(this.instrumentIdentifier.includes("PFD"))
            {
                this._refreshTime = 15; // Tuned
       	    }
       	}
        else if(this.instrumentIdentifier.startsWith("A320") || this.instrumentIdentifier.startsWith("B747") || this.instrumentIdentifier.startsWith("B787"))
        {
            this._refreshTime = 80;
            if(this.instrumentIdentifier.includes("Com") || this.instrumentIdentifier.includes("CDU") || this.instrumentIdentifier.includes("FDW") || this.instrumentIdentifier.includes("FMC"))
            {
                this._refreshTime = 100;
            }
            else if(this.instrumentIdentifier.includes("ALT") || this.instrumentIdentifier.includes("EICAS") || this.instrumentIdentifier.includes("FCU") || this.instrumentIdentifier.includes("HUD") || this.instrumentIdentifier.includes("IAS") || this.instrumentIdentifier.includes("MFD") || this.instrumentIdentifier.includes("PFD") || this.instrumentIdentifier.includes("SAI"))
            {
                this._refreshTime = 50; // Tuned
            }
        }
    }
    else
    {
        this._refreshTime = 0;
    }
    this._nextrefreshTime = 0;

As you can see, there’s a branching range of IF conditions which then set the parameters for the loop, selecting the known Airliners and then going further to define the refresh time for a variety of different instruments, depending on their refresh stability and necessity to refresh often. The PFD and MFD displays will understandably require a faster refresh, compared to the likes of the FMC or the Com instruments across the various Airliners.

I’m seeing:
19 FPS improvements in the Airbus A320 Neo

16 FPS improvements in the B747-8i

15 FPS improvements in the B787-10

21FPS improvements in the Beachcraft King Air 350i

17FPS improvements in the TBM930

10FPS improvements in the DA62

You can probably squeeze out further improvements, depending on the level of latency you wish to have on your instrument displays, but this has resulted in a great improvement in FPS for my setup.

I’m operating on:
Intel i7-4790
32GB RAM
AMD RX 5700
Samsung 860 EVO SSD (game disk)
3440x1440 full screen

Game Settings for the above results (right click and open image in new tab to see full size):

(Outdated) I started working on the G1000/AS1000 instrument timings, which are a lot more sensitive to higher values (it shows notable stutter if the value is above 20ms, so there must be some sort of layered processing going to cause that effect). Leaving the G1000 at 15ms appears to keep it happy and doesn’t degrade performance. Effects are minimal, but it’s helpful to have that in place for tweaking if it comes in to effect in later updates of the game.

64 Likes

so how is this different from Small JS config file mod to gain 10/15+ FPS in airliners and glass cockpit planes ?!

1 Like

It targets individual instruments for fine tuning, and disrupts the CPU processing of the instruments on a timeout.

2 Likes

So we just have to copy your code into the file starting at line 290 ?

You’ll want to replace the original function called createMainLoop() as seen below (replace all) which I believe is found at lines 280-303 on my original file.

createMainLoop() {
        this._lastTime = Date.now();
        let updateLoop = () => {
            if (!this._isConnected) {
                console.warn("Not connected. Exiting...");
                return;
            }
            try {
                if (BaseInstrument.allInstrumentsLoaded && !this.xmlConfigLoading && SimVar.IsReady()) {
                    if (!this._isInitialized)
                        this.Init();
                    this.beforeUpdate();
                    this.Update();
                    this.afterUpdate();
                }
            }
            catch (Error) {
                console.error(this.instrumentIdentifier + " : " + Error, Error.stack);
            }
            requestAnimationFrame(updateLoop);
        };
        this._isConnected = true;
        requestAnimationFrame(updateLoop);
    }

and replace it with the following:

createMainLoop() {
    this._lastTime = Date.now();
    this._MainLoopOverride = true; // Set this to false if you wish to see the original performance, without the selective refreshTime values
    // Added Highonsnow 04-09-2020
    if(this._MainLoopOverride)
    {
        this._refreshTime = 50;
    	if(this.instrumentIdentifier.startsWith("AS1000"))
        {
            this._refreshTime = 15;
       	}
        else if(this.instrumentIdentifier.startsWith("B747") || this.instrumentIdentifier.startsWith("B787") || this.instrumentIdentifier.startsWith("A320"))
        {
            this._refreshTime = 80;
            if(this.instrumentIdentifier.includes("FCU") || this.instrumentIdentifier.includes("FDW") || this.instrumentIdentifier.includes("FMC") || this.instrumentIdentifier.includes("Com") || this.instrumentIdentifier.includes("CDU"))
            {
                this._refreshTime = 800;
            }
            else if(this.instrumentIdentifier.includes("PFD") || this.instrumentIdentifier.includes("MFD") || this.instrumentIdentifier.includes("HUD") || this.instrumentIdentifier.includes("ALT") || this.instrumentIdentifier.includes("IAS") || this.instrumentIdentifier.includes("EICAS") || this.instrumentIdentifier.includes("SAI"))
            {
                this._refreshTime = 50;
            }
        }
    }
    else
    {
        this._refreshTime = 0;
    }
    this._nextrefreshTime = 0;
    				        
    let updateLoop = () => {
        this._HereandNow = Math.round(Date.now());
        if(this._HereandNow >= this._nextrefreshTime || this._nextrefreshTime == 0) {
            if (!this._isConnected) {
                console.warn("Not connected. Exiting...");
                return;
            }
            this._nextrefreshTime = this._HereandNow + this._refreshTime;
            try {
                if (BaseInstrument.allInstrumentsLoaded && !this.xmlConfigLoading && SimVar.IsReady()) {
                    if (!this._isInitialized)
                        this.Init();
                    this.beforeUpdate();
                    this.Update();
                    this.afterUpdate();
                }
            }
            catch (Error) {
                console.error(this.instrumentIdentifier + " : " + Error, Error.stack);
            }
        }
    	requestAnimationFrame(updateLoop);
    };
    this._isConnected = true;
    requestAnimationFrame(updateLoop);
}

Any chance you could package this as a mod to be put into Community folder? Would make the use of it much simpler for anyone.

I’ll give it a try nonetheless, currently I’m using the older fps fix which simply skips frames for updates of all displays in general, but differentiating on the importance of the screens makes totally sense!

2 Likes

Great idea! I haven’t gotten around to packaging the file but I must look into that when I get a chance.

5 Likes

Thanks a lot for your work! Just trying it, it’s great!

1 Like

You’re very welcome, is it working better for you?

This is certainly an interesting solution, well done!

Some feedback from my first minutes of testing: the altitude display on the A320 (is that the FCU?) is too laggy. I thought the game bugged and refused to show 10000 (I only saw 11000 and 9000), but it turns out it was due to it updating too rarely.
Maybe 250 ms or so could work; I doubt it will cause too much of a performance hit. I might try later, but I’ll try the stock settings a while longer.

1 Like

Ahhh, it seems I might have bundled the wrong instrument into the 800ms category!

Yes. I get approx the same FPS than the 10Hz fix, but with a much more comfortable experience.

Fantastic!

1 Like

Tested right now, great fix, thanks for sharing! I will link to this topic from the other solution.
When you think it’s complete for all planes and instruments, if you want I can prepare the package to use it from the Community folder o avoid editing the original file.

3 Likes

i have copied it and my instruments screens are all black in the a320 ??

You misaligned something :slight_smile:

Watch out for missing characters :slight_smile: Especially the curly brackets

ok will try again

Brilliant, thanks very much! I’m just testing a packaged version now, I’ll publish it shortly if I can determine that it’s working correctly

3 Likes

Patch Highonsnow_InstrumentRefreshFPSPatch_0.1.01.zip released, see top of post

9 Likes