Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Small JS config file mod to gain 10/15+ FPS in airliners and

Featured Replies

  • Moderator

Ah well, stuff happens. XML and JS have most operators in common fortunately. I happen to use modulo frequently in both modeldef.xml scripts and gauges to implement custom timers.

I note you live in Park Ridge, IL. I live nearby -- relatively speaking -- in Hammond, IN, just a few miles west of KGYY.

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator
  • Replies 53
  • Views 8.3k
  • Created
  • Last Reply
50 minutes ago, hangar said:

What happens is that your gauges are assigned a frame rate that is equal to your current fps (lets make believe you are getting 40 fps out your window) divided by the value you used for this tweak. In this case we used a vlaue of 5, so then its 40fps divided by 5 which equals 8.

That's close but not quite right.   As n4ginx noted above, this is a modulo operator, not division.    What this code in general does is increment the frameCount variable every time the main loop runs.     This happens in afterUpdate() on line 233.   Then, in CanUpdate(), it checks (for medium, for example) frameCount % 8.   This means it takes the total number of frames that have been rendered overall, divides those by 8, and only if the remainder is 0, meaning the total rendered frames is evenly divisible by 8, will it render the gauges.

In effect, it counts your rendered frames and only renders the gauges (in your example) on every 5th one, so it's essentially affected by your overall framerate for the entire time the gauge has existed, or at least until frameCount is reset, but I don't see that happening here.  It's not tied to any instantaneous fps measurement.

(I apologize if you were just extrapolating to FPS for the sake of the example, but I didn't want folks to get the wrong idea about what this logic actually does. 🙂 )

 

Edited by kaosfere

4 minutes ago, n4gix said:

Ah well, stuff happens. XML and JS have most operators in common fortunately. I happen to use modulo frequently in both modeldef.xml scripts and gauges to implement custom timers.

I note you live in Park Ridge, IL. I live nearby -- relatively speaking -- in Hammond, IN, just a few miles west of KGYY.

Yeah, I'm mostly a Python, Go, and (rarely) C programmer.  But mod is mod wherever you go. 😄

And yeah, Hammond's not far at all, but a little too close to the wonderful smells of Gary for my taste.  <g>

Ever fly out of PWK?   That's where I've flown most of my limited number of flight hours out of.

according to the post, the "quality" refers not to the graphic level you have set in your video options, but to the fact that the cockpit view is designated high and various external views are designated med, low etc. 

9 minutes ago, n4gix said:

Ah well, stuff happens. XML and JS have most operators in common fortunately. I happen to use modulo frequently in both modeldef.xml scripts and gauges to implement custom timers.

I note you live in Park Ridge, IL. I live nearby -- relatively speaking -- in Hammond, IN, just a few miles west of KGYY.

Ah! Hometown of Jean Shepherd... Though the town in “A Christmas Story” was called “Hohman” it was supposed to represent Hammond.

Jim Barrett

Licensed Airframe & Powerplant Mechanic, Avionics, Electrical & Air Data Systems Specialist. Qualified on: Falcon 900, CRJ-200, Dornier 328-100, Hawker 850XP and 1000, Lear 35, 45, 55 and 60, Gulfstream IV and 550, Embraer 135, Beech Premiere and 400A, MD-80.

  • Moderator
12 minutes ago, kaosfere said:

Ever fly out of PWK?   That's where I've flown most of my limited number of flight hours out of.

IRL? No. But I regularly make GYY <> PWK flights while testing stuff in the sim.

I must say that it is far more enjoyable now that there's some lovely scenery to admire along the way... 😊

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator
21 minutes ago, kaosfere said:

I apologize if you were just extrapolating to FPS for the sake of the example

Exactly...typically it's just the coders out here that will understand the jargon and technicalities of what's actually occurring in the code snipets. I was merely trying to paint a picture that could more easily be understood for the rest of us dummies, lol.

I apologize as well, it's just the "teacher" in me 🙂

Edited by hangar

  • Moderator
5 minutes ago, JRBarrett said:

Ah! Hometown of Jean Shepherd... Though the town in “A Christmas Story” was called “Hohman” it was supposed to represent Hammond.

That's not too surprising since Hohman Avenue at that time was the Main Street through "downtown" Hammond. Now days there isn't much of a "downtown" any longer.

Although I've lived in NW Indiana for just over 30 years, I remain a displaced Florida Cracker, and thus a "foreigner." LOL!

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator
4 minutes ago, n4gix said:

Although I've lived in NW Indiana for just over 30 years, I remain a displaced Florida Cracker, and thus a "foreigner." LOL!

Hah!   Same here, I grew up in NC.  I prefer the winters here to the summers there, though.   (I also lived in Texas for 6 years.  I really prefer the winter here to the summers there.)

I don't know if you saw, but Flyt released a version of Frasca Field down in Urbana for a very reasonable price.  I picked that up for some area flights but haven't had time to explore it yet.

I'll curtail my midwest derail there.   😂

 

On topic, I will say that I'm very excited by the web-based rendering used for gauges in this sim.  Seems like it will make customization a lot more obtainable for folks without specifically detailed knowledge.

Edited by kaosfere

  • Moderator
18 minutes ago, kaosfere said:

On topic, I will say that I'm very excited by the web-based rendering used for gauges in this sim.  Seems like it will make customization a lot more obtainable for folks without specifically detailed knowledge.

Oddly enough there is a clever fellow at FSDeveloper.com who developed HTML based 'glass displays' for use in FSX/P3D several years ago.

Unfortunately for advanced gauge coders, the backend support for the WASM sandbox isn't developed enough yet to allow for refactoring .dll into .exe files at this time.

Neither XML or JS provides what is truly needed for our requirements.

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator
1 hour ago, n4gix said:

Neither XML or JS provides what is truly needed for our requirements.

That's unfortunate.   From your perspective, does what MSFS provides give you the ability in some way to accomplish what you need with the quality that you want?

  • Moderator
1 minute ago, kaosfere said:

That's unfortunate.   From your perspective, does what MSFS provides give you the ability in some way to accomplish what you need with the quality that you want?

I believe that eventually it will. The only question is when. Asobo have pledged to work with all 3rd parties to add and/or improve whatever is necessary to their version of WASM, 

In the meantime however, they have their immediate focus on resolving many other issues that are frankly fundamental.

Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Thanks for the tip.  Regardless of whether this is actually based off refresh rate or current FPS all I know is this finally makes the 787 usable.  That thing is a slug.  I was still hitting mid-20's at 1440p med or high settings while up in the air and now it's very low 30's.  Running it  at 3 right now.  The rate change is definitely noticeable in the gauges, but for now I'll take it for the overall boost.

AMD Ryzen 9950X3D | Asrock X870E Taichi | Gigabyte Gaming OC 4090 w/EK waterblock | Full Custom Loop Cooling | Corsair Dominator Titanium DDR5-6000 | Samsung & WD NVME/SSDs | Phanteks Enthoo 719 | Seasonic Vertex Gold 1200W | Keychron Q5 Max | Corsiar Scimitar Elite SE Wireless | Honeycomb Alpha and Bravo | Logitech Pro Flight Pedals | VKB Gladiator Pro NXT L&R handed | MiniCockpit MiniFCU | Alienware AW34DWF | Asus PG279Q | Win 11 Pro

KJFK with the A320 at start around 45-50 in air >60fps (4k Ultra/High/Med settings)

 well this trick works, i just hope it doesent change something in the flight physics 😅

A caution to anyone doing this. I downloaded and installed the mod and the sim worked fine with slightly better frame rates. However, with the mod installed, the scenery editor in developer mode would CTD 100% of the time. Once the mod was removed, the SE worked fine again. What does that mean? I have no idea. But maybe it's not the greatest idea to tinker with the official code.

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.