Jump to content
Sign in to follow this  
Emerson67

Finally we have a visibility limiter plugin

Recommended Posts

An important plugin has been released for flight simmers that use on-line weather in X-Plane. It's important because X-plane has a basic primary flaw: it sets infinite visibility from the "9999" visibility tag, which causes frame rate drop - because the very distant scenery is rendered - and is unrealistic. This plugin fix it. The METAR "9999" tag means visibility 10km or above.

 

You can download the plugin here:

 

http://forums.x-plane.org/index.php?app=downloads&showfile=19748

 

Create a folder "PythonScripts" inside "resources\plugins" folder and put the file "PI_VisibilityLimit.py" there.

 

The plugin is a Python script, so you must install Python. For 64-bit X-Plane Windows, install "Python 2.7.5 Windows X86-64 Installer". Get it here:

 

http://www.python.org/download/

 

Then download "PythonInterface.zip" (the 2.7 version)  from here:

 

http://xpluginsdk.org/python_interface_latest_downloads.htm

 

Extract this file and put the folder "PythonInterface" inside the "resources\plugins" folder.

 

Start x-plane and check if the plugin is running (look on the "Plugins" menu, "Python interface").

 

Share this post


Link to post
Share on other sites

And some guys complain about the limited visibility in altitude :-)  Now, there is a plugin to limit it even more ;-)

 

But, jokes aside, it makes sense, for surface visibility, although any limit imposed artificially when visibility set to 9999 in the METAR is always subjective because it might be 11km, 50km, etc...  

 

The same problem applies to cloud bases. If above your sector alt and not of Cb type they will not be reported, even if you have a OVC of stratocumulus...


Main Simulation Rig:

Ryzen 5600x, 32GB RAM, Nvidia RTX 3060 Ti, 1 TB & 500 GB M.2 nvme drives, Win11.

Glider pilot since 1980...

Avid simmer since 1992...

Share this post


Link to post
Share on other sites

I think the "not so high" visibility at high altitude problem is something related to XP graphic engine.

 

Regarding the plugin: it relaxes the limit as altitude increases, and it does consider the dew point, etc, and the good thing is that the script is an open text file (as the LUA scripts), so you can edit it and modify the behavior... :rolleyes:

 

Actually I was about to write my own plugin to carry out such task, but this one was released first.

Share this post


Link to post
Share on other sites

 

 


and it does consider the dew point

 

Ah! That is indeed good to know, as well as the "ralaxation" with alt!  I will certainly try it ;-)


Main Simulation Rig:

Ryzen 5600x, 32GB RAM, Nvidia RTX 3060 Ti, 1 TB & 500 GB M.2 nvme drives, Win11.

Glider pilot since 1980...

Avid simmer since 1992...

Share this post


Link to post
Share on other sites

I like it - seems to have a much more convincing haze effect than default.

 

However it keeps changing my weather setting from real weather to set weather uniformly for globe. Is that intended?


i910900k, RTX 3090, 32GB DDR4 RAM, AW3423DW, Ruddy girt big mug of Yorkshire Tea

Share this post


Link to post
Share on other sites

I like it - seems to have a much more convincing haze effect than default.

 

However it keeps changing my weather setting from real weather to set weather uniformly for globe. Is that intended?

 

I also noticed this after installing the plugin. I have to go into weather settings after flight has loaded to set real-weather, and redo that every time i for instance swap airports etc.

 

Feels like quite a nice fps improvement too, not sure. Haven't noticed any visual difference yet thou (flew only in real weather with normal cloudy weather)

Share this post


Link to post
Share on other sites

I've noticed that i have to manually put the sim on "grab real weather from the net" mode and then click on "download right now" button if I want to refresh the weather (i.e download current weather) after some flying time. Yes, this is annoying. I´m going to write a note on the first post. Update: I can´t edit it. No edit button!

I also noticed this after installing the plugin. I have to go into weather settings after flight has loaded to set real-weather, and redo that every time i for instance swap airports etc.

 

Share this post


Link to post
Share on other sites

Actually not much so far, but there's some FPS gain :smile: indeed . You have to consider my PC hardware spec that is not "low-end".

 

Some tests:

 

SCSE 211700Z 31008KT 9999 FEW025 12/02 Q1020

Plugin off: 32 FPS (20SM)

Plugin on: 35 FPS (11.2SM)

 

MDPC 211800Z 09013KT 9999 SCT023 31/24 Q1018

Plugin off: 34 FPS (20SM)

Plugin on: 37 FPS (11.2SM)

 

No FPS gain on CAVOK:

ETNG 211750Z 06007KT CAVOK 31/16 Q1018

Plugin off: 34 FPS (20SM)

Plugin on: 34 FPS (11.2SM)

 

How much of a performance gain do you notice, if any?

Share this post


Link to post
Share on other sites

 

 


SCSE 211700Z 31008KT 9999 FEW025 12/02 Q1020
Plugin off: 32 FPS (20SM)
Plugin on: 35 FPS (11.2SM)

 

Honestly then, I'll pass, not because of the FPS but rather because of the fact that for such a wide range between T and Td I see no justification for "just" 11.2 SM horizontal visibility...


Main Simulation Rig:

Ryzen 5600x, 32GB RAM, Nvidia RTX 3060 Ti, 1 TB & 500 GB M.2 nvme drives, Win11.

Glider pilot since 1980...

Avid simmer since 1992...

Share this post


Link to post
Share on other sites

jcomm,

 

This is the plugin logic (from the PY text file):

 
HIGH_MAX_VIS = 50000.0          # meters at high altitude (float)
NORMAL_MAX_VIS = 30000.0        # meters in normal conditions (float)
MEDIUM_DPRATIO_VIS = 21000.0    # meters when difference between temp and dp is less than 10
LOW_DPRATIO_VIS = 18000.0       # meters when difference between temp and dp is less than 5

def FlightLoopCallback(self, elapsedMe, elapsedSim, counter, refcon):

        visibility = XPLMGetDataf(self.VisibilityDataRef)

        maxVis = HIGH_MAX_VIS

        diff = XPLMGetDatai(self.TemperatureSL) - XPLMGetDatai(self.DewPointSL)

        elev = XPLMGetDatad(self.elevation) / 0.3

        if (elev < 8000):

            if (diff < 5):

                maxVis = LOW_DPRATIO_VIS

            elif (diff < 10):

                maxVis = MEDIUM_DPRATIO_VIS

        if (visibility > maxVis):

            XPLMSetDataf(self.VisibilityDataRef, maxVis)

        # Return 1.0 to indicate that we want to be called again in 1 second.

        return 1.0

You can have good ideas...

Now I see the plugin considers the elevation as well

Share this post


Link to post
Share on other sites

yep, the idea itself is good! 


Main Simulation Rig:

Ryzen 5600x, 32GB RAM, Nvidia RTX 3060 Ti, 1 TB & 500 GB M.2 nvme drives, Win11.

Glider pilot since 1980...

Avid simmer since 1992...

Share this post


Link to post
Share on other sites

Jcomm, the logic and code of the plugin is very very simple. You could download it and then change the values of just HIGH_MAX_VIS, NORMAL_MAX_VIS, MEDIUM_DPRATIO_VIS, LOW_DPRATIO_VIS, to tune its behaviour.


"The problem with quotes on the Internet is that it is hard to verify their authenticity." [Abraham Lincoln]

Share this post


Link to post
Share on other sites

Yes Murmur and Emerson, I agree, it's easy to edit ant tune to one's preferences.

 

The original idea is an excellent one too. It makes me think that other interesting "weather interventions" could be made through dataref access...  I confess I didn't even know the Td made part of the internal variables, since it is not listed in the Weather menus...


Main Simulation Rig:

Ryzen 5600x, 32GB RAM, Nvidia RTX 3060 Ti, 1 TB & 500 GB M.2 nvme drives, Win11.

Glider pilot since 1980...

Avid simmer since 1992...

Share this post


Link to post
Share on other sites

If one of you guys could tweak the logic to make it more realistic...:)


i910900k, RTX 3090, 32GB DDR4 RAM, AW3423DW, Ruddy girt big mug of Yorkshire Tea

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...