About This File
3jFPS12 - FPS control for X-Plane 12
This FlyWithLua script is the XP12 version of my plugin 3jFPS-wizard11
+ keeps performance stable by auto adapting view distance for buildings, vegetation and objects and scenery shadows
+ smoothtransitions to make visual effects less noticeable
+ easy configurable,wizard mode guides you to find your best configuration
+ nice graphical and/or numeric FPS display
+ 4 configurable profiles with different settings for different situations (e.g. VR and non-VR)
+ enables shadows for distant 2d trees, so you can have a great scenery look with increased shadow distance (if your PC can handle it)
DISCLAIMER:
This plugin uses some inofficial internal control parameters (so called "private DataRefs" or "Art controls") of X-Plane.
These inofficial DataRefs are undocumented and can change with every release or update of X-Plane.
When you install this plugin, please keep that in mind and don't blame the developers of X-Plane, FlyWithLua or me, if the plugin stops working with a later version of X-Plane. : )
Also, in case you are encountering any bugs or glitches when using this plugin, please ALWAYS test without this plugin before reporting bugs to X-Plane.
When the bugs/glitches then disappear without this plugin, please comment on the COMMENTS tab of this page to inform me.
Compatibility
+ for X-Plane 12.00, compatibility with higher versions is not guaranteed (see disclaimer above)
+ NOT compatible with any other "auto-LOD" plugin (like AUTO_LOD1.3, 3jFPS-control, 3jFPS-wizard11)
Known issues and limitations
+ the plugin can cause distant objects (buildings, tress, etc.) to suddenly pop up or disappear. (In theory everything should fade-in/fade-out smoothly, but I assume hacking the LOD by the plugin confuses X-Plane's scenery system sometimes)
+ shadows and trees can flicker a bit (trees may blend in and out between 3d and 2d)
+ large distant buildings like skyscrapers can look strange, as they get faded in
+ the calculated CPU usage displayed (and used for AUTO mode) is often too high, when GPU usage is high
+ when extending the shadow distance (which looks very nice imho) near scenery shadows can get a little blocky/flickery
+ no display in VR (the plugin itself works, but you will see the FPS-display or the settings window only on the monitor mirror)
Installation
+ install current version of FlyWithLua NG+, if you don't have it already.
download here: https://forums.x-plane.org/index.php?/files/file/82888-flywithlua-ng-next-generation-plus-edition-for-x-plane-12-win-lin-mac/
+ the file 'jjjLib1.lua' is required in the modules folder of FlyWithLua ('/Resources/plugins/FlyWithLua/Modules/'). It comes with the FlyWithLua download, make sure you have not removed it.
+download 3jFPS12.lua from this page and copy it to'/Resources/plugins/FlyWithLua/Scripts/' folder.
Usage
Click on the FPS display (default on the upper left corner) to open the settings window.
Or click in menu -> "Plugins" -> "FlyWithLua Macros" -> "3jFPS12: open/close settings"
The settings window should be mostlyself explanatory. It has 4 sections:
On top you can select the plugin mode
+ AUTO: The plugin tries to keep your FPS stable. This is the default and recommended option.
+ MAX FPS: Visual quality is reduced to minimum, therefore FPS should reach their maximum value.
+ MAXQUAL: Visual quality is set to maximum, therefore FPS probably will be getting quite low.
+ OFF: Bring X-Plane back to it's original state (as if the plugin was not installed)
Just below you can select the current profile
+ There are 4 different profiles: A, B, C and D
+ The highlighted button shows the active profile
+ When you change and save settings, you always only change/save the active profile
+ You can set a default profile for VR and non-VR, to be automatically loaded
In the middle you can adjust the FPS-display
At the bottom you can open one of the configuration modes
+ WIZARD: The wizard guides you through the process of detailed configuration, to help you find the perfect settings for your hardware and taste. <<< RECOMMENDED!
+ ADVANCED: For total control of all settings without long explanations.
+ PROFILES: Set default profile(s) for non-VR and VR.
Configuration
3jFPS12 will work only as good as you configure it. The default settings are for mid-range to higher-end hardware and set to my personal taste.
So, it is not very likely that they are perfect for you and your hardware. To get the maximum out of the plugin, please take the time and step through the 'WIZARD' configuration pages and follow the instructions.
If you set everything up the right way (again: for your taste, hardware, X-Plane settings, add-ons, ...), the plugin really can improve FPS and smoothness.
But first, you have to set the rendering options of X-Plane to reasonable values for your system.
Setting "Number of world objects" to "maximum" on a lower-end computer for example, will never work.
How 3jFPS12 works: In "SMART" mode
In SMART mode (default), you set your "desired FPS" (with the configuration wizard, or "FPS target" under advanced settings). Based on that FPS target, the plugin calculates how much time is available, to render each frame to reach the wanted FPS (or higher). This calculation is quite easy: 1 second divided by the wanted FPS.
For example, when you set 50 FPS as your FPS target, XP has 20ms (1000ms/50 = 20ms) to render each frame.
The plugin evaluates the time actually needed to render the frame, as separate values forCPU time and GPU time. (You can also see those values, when enabling XP's data output "fps" and look under "cpu" and "gpu". Though, unfortunately, the CPU time that the plugin evaluates is not accurate sometimes, see "Known issues and limitations" above.)
When the actually needed time of CPU or GPU is higher than the available time, the wanted FPS can't be reached. In that case, the plugin reduces the visual quality (shown as "Q" in the FPS display of the plugin), until both CPU and GPU times are below the available time and XP delivers the wanted FPS. (Or the plugin reached the minimum quality, then you won't get the desired FPS.)
In case, the actual times of CPU and GPU are both below the available time, the plugin increases the visual quality, until CPU or GPU gets close to the available time. (How close is defined by the "headroom" values, under advanced settings.)
The average CPU time and GPU time needed tor the frame are displayed on top of the FPS display of the plugin (if enabled). CPU on top, GPU below.
If "numbers" is enabled in the display settings, you see the times in ms on the left as numbers. (These are not FPS values, these are the needed times in ms.)
If "graphic" is enabled, you see 2 white bars. Those bars are relative to the available time for a frame. For example: FPS target is 50, available time per frame therefore is 20ms. If the CPU needs 10ms for each frame, the white bar will be at 50%. If the CPU needs 20ms, the bar will be at 100%, etc.
In case, for example, the CPU needs 30ms (that means performance drops to about 33 FPS, thus below the target of 50 FPS), the bar will be full white and the time above the availabe time will be "reflected back" in red. So, in this case (30ms > 20ms = 50% over) half of the bar will be red.
Or simplified: Whenever you see red on the CPU or GPU bar, the wanted FPS are not achieved at the moment.
How 3jFPS12 works: In "BASIC" mode
In BASIC mode (how all earlier versions of my FPS plugins worked), you set a range of minimum FPS and maximum FPS. The plugin then only evaluates the actual FPS for each frame.
When the actual FPS are below the minimum value, the plugin reduces the visual quality, until the FPS are again above minimum FPS. (Or the plugin reached the minimum quality.)
When the actual FPS are abovethe maximum value, the plugin increases the visual quality.
You can try, if the BASIC mode works better for you (go to advanced settings to activate it). Though, I would only recommend it, in case you have a display with a variable refresh rate ("Freesync" or "G-Sync") or v-sync turned off in XP's settings.
In BASIC mode, as the plugin then only looks at the actual current FPS,with a fixed refresh ratethe plugin will not find out that it should reduce the quality, before it is too late and the current FPS dropped below the refresh rate, at least for 1 frame. Then a micro stutter already has happend.
In SMART mode, the plugin is able to detect CPU or GPU time going up, before it has reached the point where a stutter happens (as long as the CPU or GPU time doesn't have a sudden big spike, there is nothing to do against that ofc).
Key/controller Commands
The plugin hast the following commands that can be bound to a key or controller button:
"3jFPS12: open/close settings"
"3jFPS12: mode auto" = set mode to "AUTO"
"3jFPS12: off" = set mode to "OFF"
"3jFPS12: toggle on/off" = toggle between "AUTO" and "OFF"
"3jFPS12: max FPS (lowest quality)" = set mode to "MAX FPS"
"3jFPS12: max quality (lowest FPS)" = set mode to "MAX QUAL"
"3jFPS12: Profile A/B/C/D" = activate the selected profile
"3jFPS12: screen shot (max quality)" = do a high quality screen shot (saved to "/output/screenshots") with the max. settings
Type "3jFPS" into the search box of the key bindings or controller bindings page to easily find the commands.
------------------------------------------------------------------------------------------------------------------------------------------------
If you should have any problems, bug reports or support questions, please use theCOMMENTS tab!
Please do not use the reviews tab for this kind of feedback.
------------------------------------------------------------------------------------------------------------------------------------------------
Edited by jörn-jören jörensön
Refined description