Jump to content
The simFlight Network Forums



Recommended Posts

Hi Paul,

I've been doing a lot of googling over the last couple of days in search of the best way to create turbulence around the aircraft. I’d seen a couple of posts where other users had discussed how to work with METARS (http://forum.simflight.com/topic/78354-metar-format/ ) but I couldn’t find the documentation around this. I wasn't 100% sure if this is the correct approach (i.e set a new METAR) or if it was possible to simply change turbulence from “none” to “severe” which would be the most ideal solution but from what I can see these offsets aren’t writable.

Last night I started to experiment with changing the aircraft pitch/roll/bank to try and simulate it myself but I was hoping there may be a quicker and easier-to-manage option, ideally of course, through an offset.

So in short, I’m really looking for some guidance on the best way to achieve on-demand turbulence/weather – if this is even possible.

Thanks for all your efforts.

Link to comment
Share on other sites

Sorry for the delay in replying.

I think working with METARs would be difficult because of reading the string and changing it to add turbulence. The extended METAR format for SimConnect is quite obscure and not well documented.

It might be easier to use the 'New Weather Interface' in FSUIPC. Below is an example of how to use it from my DLL. I also attach the latest version that has these weather facilities. Version 3 only targets the .NET 4.0 Framework (or later).

By altering the weather you can add turbulence to the current wind layers (or even add your own wind layers), or do the same with cloud layers.

You would probably need to set GLOBAL weather to ensure it has an effect. If you just set nearby weather stations then you're not guaranteed to get the exact weather at the aircraft. This might interfere with other weather programs however, so that might be something to think about.

As you say, the other way of doing turbulence is to directly control the plane to simulate it. I think this is favoured way for add-ons that simulate turbulence like Accu-Feel as it doesn't mess with the weather.



        private void weatherExample()
            // 1. grab a reference to the weather services to save typing...
            // NOTE: Connection must already be open.
            WeatherServices ws = FSUIPCConnection.WeatherServices;

            // 2. Get METAR string at London, Heathrow
            // string METAR = ws.GetMetarAtLocation("EGLL");

            // 2. Now get a weather object or create a new one. Examples below...

            // Get the current weather at the aircraft
            // so we don't have to fill in every bit of weather data,
            // just modify what's currently set.
            FsWeather weather = ws.GetWeatherAtAircraft();

            // You can also get weather from a specific station, e.g. London Heathrow
            // Note that the player must be near to the weather station so it's active.
            // If the station is not active you'll get an FSUIPCException thrown which you can catch.
            // If the player moves the aircraft using Goto Airport menu, the weather stations take a few seconds
            // to initialise.
            // FsWeather weather = ws.GetWeatherAtLocation("EGLL");

            // Or from a specific Lon, Lat point (see other overloads of GetWeatherAtLocation())

            // Or start from scratch and fill in everything you need to:
            // FsWeather weather = new FsWeather();

            // 3. Setup or modify the weather object...

            // Setup a single wind layer
            FsWindLayer wind = new FsWindLayer();
            wind.Direction = 270; // west
            wind.DirectionVariance = 5; // 5 degree variance
            wind.SpeedKnots = 12; // 12 Knots
            wind.GustKnots = 16; // 16 knot gusts
            wind.UpperAltitudeFeet = 5000; // layer active up to 5000 ft
            wind.Turbulence = FsTurbulenceLevel.Light; // Set up seom turbulance

            // Clear all existing wind layers and add the new wind layer

            // Change the visibility
            weather.Visibility.RangeNauticalMiles = 1; // 1nm visibility

            // Set the pressure
            weather.Pressure.PressureMillibars = 1023;
            // Add turbulance to existing cloud layers
            foreach (FsCloudLayer cloudLayer in weather.CloudLayers)
                cloudLayer.Turbulence = FsTurbulenceLevel.Moderate;

            // 4. Now write this weather as global weather (everywhere)

            // If not using global mode you can write the weather to a specific station: e.g. Heathrow, UK
            // ws.SetWeatherStation("EGLL", weather);

            // NOTES:
            // * See the intellisense for details for all the available weather options
            // * METAR strings can be read via the appropriate methods on the WeatherServices.
            // * METAR can be written in theory but no one seems to know the format. (It's not he same as the read format)
            // * Cloud layers can be cleared and setup in the same way as Wind layers.
            // * More visibility layers can be managed via the VisibilityUpperLayers list on the weather object.
            // * All weather can be cleared using ws.ClearWeather();



Link to comment
Share on other sites

  • 1 year later...

Hello Dear Flightsimmers,

I would like to make another approach to this issue. I'd like to detect turbulent conditions on aircraft to start a cabin announcement, something like "ladies and gentlemen, currently we are on a turbulent condition, please get back to your seats and keep your seatbelts fastened until bla bla..."

Should I continously watch the vertical speed and airspeed readings to detect this situation or do you guys offer me a better way, like maybe there is an offset that i can get this state directly through fsuipc connect dll?

Link to comment
Share on other sites

It's difficult to detect turbulence because it can be generated in the sim in different ways. For example:

  • By the FSX/P3D weather engine - this can be wind turbulence or cloud turbulence
  • By an addon which induces turbulence for realism by directly pushing the plane around

It's possible to get the current turbulence values set in the weather engine using the weather services in the dll. It's just a matter of working out which cloud and wind layer the player is in and reading the level of turbulence set. (See my sample code application).

However, this won't work if the turbulence is coming from another source, or if a third-party weather system is not updating the Sim's turbulence values.

I remember a user trying to detect turbulence from the cloud layers with ActiveSky and the turbulence always seemed to be set to 'none' in the sim. So maybe programs like ActiveSky are doing turbulence a different way.

I think the most robust way (but also more difficult) would be to monitor the acceleration with respect to the airframe (See offsets 0x3060, 3068 and 3070). You'll probably need to calculate and test the rate of change in acceleration (i.e. metres per second cubed) rather than the raw acceleration values. You'll need to determine which levels are turbulence and which are normal. There is also the added complication of different aircraft being different weights which will affect the acceleration values.

Just my initial thoughts on this; I've never tried to detect turbulence. Maybe another user has already worked out a good solution for this...


Link to comment
Share on other sites

  • 2 weeks later...

Hello, I heard the prosim 737 work with activ sky and buttkicker and turbulence. is that correct ?

I don't know. You'd need to ask the developers of those products.


I need offsets for turbulence. Can someone help me please ? I have rex weather. would like to work with buttkicker.

The only offsets for turbulence are for the currently set weather. Each cloud layer has it's own turbulence setting when using the internal FSX/P3D weather. I don't know if REX weather sets those values. These offsets can be found in the FSUIPC documentation, specifically the "New Weather Interface" zip file in the SDK. Or, if you're using my DLL you can just use the weather services.

There are no offsets that will tell you what level of turbulence the aircraft is currently experiencing. The only way I can see to derive this is from the aircraft acceleration. See my post above yours.



Link to comment
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
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.