Saturday, October 17, 2020

Unreal Weather - Live METAR FAQ

Q: What is this mod all about?

A: The Unreal Weather - Live METAR mod simulates the real weather within Microsoft Flight Simulator 2020, using up-to-date METeorological Aerodrome Reports, a.k.a. METAR. It provides a free alternative to the built-in "Live" weather within the game.


Q: How is the weather simulated by the mod different from the "Live" weather in MSFS 2020?

A: While the Unreal Weather - Live METAR mod uses the current METAR reports to simulate the weather, the in-game "Live" weather utilizes the weather reporting and prediction services provided by MeteoBlue, plus some artificial intelligence on top of that. In addition, the "Live" weather utilizes the internal weather simulation means in full capacity, while the mod is currently limited to the data model available in the Weather Settings menu. It, for example, cannot recreate different "zones" around the player, so the weather will always appear uniform.

Also, this mod is a work in progress, which means that it is being constantly improved, often accommodating the feedback from its users. 


Q: How do weather transitions work?

A: There is a separate post dedicated just to that topic alone:

About Weather Transitions and How They Work


Q: I've installed the mod and added my API token to it, but the mod does not work.

A: Here is how to troubleshoot this issue:

  • Shutdown the sim and remove the existing copy of the mod from your Community folder.
  • Deploy a fresh copy of the mod from the ZIP file, but do NOT modify the mod settings or add your API token to it just yet, i.e., leave it "as is."
  • Start the sim, make sure it works and the mod is operational: your World Map screen should work, and the weather presets list should now have the "Unreal Weather - Live METAR" choice.
  • Start flying and make sure that you select "Unreal Weather - Live METAR" in the weather presets list. At this point you should see the "Missing API token; check settings" error in your Weather Settings panel, just underneath the Pressure MSL slider.
  • If you got this far, the mod is working.
  • Now, shutdown the sim and add your API token to the WeatherEditionMenu.js file in the deployed copy of the mod in your Community folder. Save the file.
  • Start the sim. Your World Map screen should still be complete, without any missing buttons. (If it looks incomplete, that would mean that you've damaged the JS file while making changes to it.)
  • Start flying; the mod should be working and the METAR information should be displayed in Weather Settings.

Q: I've just installed the mod and now my in-game World Map screen is broken, some buttons are missing.

A: This would indicate that the WeatherEditionMenu.js file in the mod folder got damaged, most likely, when you were adding your API token to it or modifying the mod settings. Re-deploy the mod and start over.

Remember: You should always use a plain-text editor, such as Notepad, Notepad++ or similar when making changes to the JS file. Do NOT use Microsoft Word or any other editor that supports text formatting - such editors are not suitable for modifying program code.


Q: I've just made some changes to the mod settings, but the mod seems to ignore them.

A: In order for the changes to become effective, the Sim must be fully restarted. It will not pick up your changes on the fly, as it does not reload the mod files after it has loaded them initially.


Q: I am flying near my house, and the real weather outside is different!

A: METAR reports only include some data points about the local weather, but not all of them. Therefore, the mod can only simulate the real weather to a certain limit. Cloud layer thicknesses are just one example - they not part of METAR, except for cumulus clouds, so that missing information is randomized. In addition, each report only provides the weather information as observed at the station's location; some of them are created automatically, while others are supplied manually by operators. Here are some additional points:

  • Learn how to interpret the METAR data. It can be confusing at first, but soon enough you'll starting "parsing" these reports in your head easily. If certain data points are missing from, or present in the current report, there is nothing the mod can do to fix that.
  • Consider how far you live from the station that provided the report; your local weather can be different from what your closest station reports.
  • METAR reports are not always up-to-date, especially in remote areas or developing countries. Occasionally, they can be stale, i.e. the weather may appear outdated. Even if a report is only 1 hour old, the real weather may have changed since the report had been created. Again, see what is in the report, not outside your house window.
  • Make sure that you have not disabled certain features when editing the mod settings. If you have, the mod will not affect those features within the game.


Q: What about winds aloft? Does this mod support them?

A: METAR reports do not include any information about winds aloft, so the mod cannot recreate such winds in the Sim. It, however, tries to emulate randomized winds at the higher altitudes in order to provide some variety. That option can be turned on or off in the mod settings.


Q: Can winds aloft be emulated using the real-life data?

A: No, not at this point. If someone could locate a robust and free web API that would accept latitude and longitude as the arguments and provide the winds aloft data in real time, then yes, it can be done. So far, no one has located it. Paid providers collect that data in bulk from NOAA or similar sources, parse, cache and then expose it via their own custom web services on demand. This mod alone, without a similar backend, cannot do that.


Q: I found a web site that displays up-to-date wind aloft data. Can it be used by the mod to simulate such winds?

A: Unfortunately, no. Please see the answer to the precious question.


Q: I have some ideas about this mod. What should I do?

A: You can always contact me directly. See the main page of this blog for my contact details.


Q: How can I contribute to the development of the mod?

A: If you like the mod, please consider making a small donation. See the main page of this blog for the details.


Thursday, October 15, 2020

About the Weather Transitions and How They Work

If you’ve noticed, there are 3 important variables included in the mod settings:


metar_polling_frequency_minutes: 3,

weather_transition_span_seconds: 180,

weather_transition_step_seconds: 0.5


metar_polling_frequency_minutes: This, I think, is self-explanatory. The value (in minutes) determines how often the mod pulls the METAR report from the AVWX server, using the plane’s current location (lat and long) as the arguments. The server returns the current (or sometimes, cached) report from a monitoring station that happens to be the closest to that position. 3 minutes seems like a good number, unless you’re piloting a super-fast airliner, in which case you may want to reduce it to, say, 1 or 2 minutes. Be careful, though, as pounding the server with extra requests is an overkill, as you will be getting lots of duplicate METAR reports with no real benefit to you. Also, keep in mind that with the free “Hobby” tier you’re limited to 4000 reports per day.


weather_transition_span_seconds: When a new METAR report is received and it is differenrt from that last one, the mod generates a new weather snapshot and then starts a “transition period”: it interpolates all values between the current and the new weather snapshots and applies the changes to the in-game weather in small steps. That’s when you start seeing your cloud layers move up and down, change their shape, the rain die or pick up, etc. This particular variable controls how long such transition periods last, in seconds. Set this value too low and the changes are going to be more abrupt. If you increase the value instead, the transitions will last longer. I’d suggest you experiment and pick a value that is closer to your preference.


weather_transition_step_seconds: This value controls how smooth the weather transitions are (see above), i.e. it dictates the duration of each small step at which the incremental changes are applied to the in-game weather. I left it at 0.5 seconds in order to accommodate those folks who have weaker PCs, but you may want to reduce it to 0.1 sec or even lower, if you have powerful hardware. Pay attention to your effective frame rate, though: for example, if your sim runs at solid 60 FPS, then there is absolutely no reason to set this value lower than 1/60 sec, i.e. 0.0167 sec. Even that would be too low, as each adjustment to the in-game weather values may cause MSFS to stutter slightly and you may do more harm than good in such case. Values that cover a few frames like 0.1 sec or slightly lower seems like a good pick. Again, experiment and see what works best for you.


Now comes a valid question: What if the weather is currenly in transition, but yet another, differerent METAR report is received? This can happen when moving very fast over a few airports or stations in sequence. In that case, the mod abandons the current transition, picks up where it left off and starts a new transition, this time to that new METAR report. This may lead to what might seem like a prolonged transition period. No need to be alarmed. (Note that this would only happen if your weather transition period is longer than your METAR polling interval. By default, they equal: 3 min and 180 sec respectively.)


The last note: If you change any of the above settings, you will need to completely restart the sim. It will not pick up any changes made to the JS file after the sim has loaded it in the beginning.

Sunday, October 11, 2020

How to Uninstall Older Version of Unreal Weather - Live METAR

You will only need this procedure if you have previously installed this mod by directly modifying the game. You will need to remove it prior to installing the Community package version, which is available starting with version 1.3.


To ununstall that version (1.0 through 1.2), you will need to perform the following steps:

1) Remove the custom weather preset file:

C:\Users\<YourUserName>\AppData\Roaming\Microsoft Flight Simulator\Weather\Presets\UnrealWeatherLiveMetar.WPR

2) Restore the 2 original code files in this subfolder in your game folder:

Microsoft Flight Simulator\Packages\fs-base-ui\html_ui\Templates\WeatherEditionMenu\

You should delete following 2 files from the above folder, and then put the original files back into this folder (or rename them back, if you kept them in this folder alongside with the modded copies):

WeatherEditionMenu.html
WeatherEditionMenu.js

Now start the game and verify that a) the custom preset "Unreal Weather - Live METAR" is no longer available in the weather presets list and b) your Weather Settings menu fully works while in-flight.

If everything is OK, you should now be able to install the Community package version of the mod as described in the main post.

Saturday, September 26, 2020

Unreal Weather - Live METAR 1.6 Released!

Cumulonimbus clouds generated by the mod (HUEN, Entebbe Intl Airport, Kampala, Uganda)


MOD STATUS

MSFS 2020 Steam                                    OK

MSFS 2020 Microsoft Windows Store         OK

MSFS 2020 Boxed                                     OK


FREQUENTLY ASKED QUESTIONS


You can find some of the popular questions about the mod answered in this post:


REVISION HISTORY

1.6 (20-Oct-2020)

  • Improved cloud layer transitions
  • Improved winds gusts
  • Cached METAR reports can now be disabled
  • Other minor improvements

1.5 (12-Oct-2020)

  • Altimeter indicator in METAR now takes priority when calculating MSL pressure
  • Weather Settings panel now refreshes itself properly
  • High-elevation winds can be disabled in the mod settings
  • Other minor improvements

1.4 (07-Oct-2020)

  • Resolved the issue that prevented the mod from running in some situations
  • MSL temperature is now set correctly
  • METAR station elevation is now displayed along with its name
  • Added support for variable winds
  • Added support for high-elevation winds (experimental)
  • Added support for wind gusts
  • Altimeter indicator is now honored, when MSL pressure information is missing
  • Improved handling of SLP indicator
  • Added diagnostics log panel to Weather Settings

1.3 (01-Oct-2020)

  • Added "re-roll weather" button to METAR panel. (See details below.)
  • Switching between weather presets while in-flight is now much faster
  • The mod is now available as a Community package add-on

1.2 (28-Sep-2020)

  • Fixed issues with sea-level pressure (QNH and SLP)
  • Fixed wind direction transitions
  • Switching to and from 'Unreal Weather - Live METAR' preset should work when in-flight. (This is experimental. If you experience any issues, just select the preset before you start your session.)

1.1 (27-Sep-2020)

  • A fix for the critical issue that was causing MSFS 2020 to crash due to incorrect handling of the variable wind report values.

1.0 (26-Sep-2020)

  • Initial release.

If you like this mod, please consider making a small donation in the form of an Amazon gift card. I would greatly appreciate that. You can find my contact information at the bottom of this post. Thank you!


DOWNLOAD LINKS

Unreal Weather - Live METAR 1.6 - CURRENT

For game versions 1.7.12.0, 1.7.14.0, 1.8.3.0, 1.9.3.0, 1.9.5.0. To be installed into your Community folder as an add-on.

For game versions 1.7.12.0, 1.7.14.0, 1.8.3.0, 1.9.3.0, 1.9.5.0. To be installed into your Community folder as an add-on.


WHAT IS IT?

Unreal Weather - Live METAR is a mod for Microsoft Flight Simulator 2020 that adds live dynamic weather to the game, using METAR - current METeorological Aerodrome Reports from around the world. METAR reports are retrieved in real time, based on the current location of the player, and the in-game weather is updated accordingly.

In addition, the current METAR report and monitoring station information is displayed in the Weather Settings menu within the game. The mod is highly configurable, which allows users to adjust it to their liking and gaming hardware capabilities.

It also supports smooth, user-configurable transitions between different weather states to provide the best experience.






This mod is developed as an alternative to the built-in "live" weather system in MSFS 2020, which uses MeteoBlue weather information instead of METAR.


HOW DO I GET THE MOD TO WORK WITH MY GAME?


In order to use this mod, you will need to do the folowing:

1) Obtain an API token from AVWX, https://account.avwx.rest/ . Their "Hobby" tier is free and good, as of now, for 4000 report retrievals per day, which is more than sufficient for any MSFS 2020 user.

Disclaimer: I am not affiliated with AVWX in any way, yet I like their API.

2) Deploy the package to your Community folder, and, finally...

3) Add your API token to one of the mod files.

That's it!


INSTALL AS A COMMUNITY PACKAGE ADD-ON


WARNING: If you have previously installed this mod by modifying the game, you will need to remove it prior to installing the Community package version.

To ununstall that version, you will need to perform the steps described in the separate post.


1. Obtain API Token

First, you must obtain your own API token from AVWX. You will only need to do that once.

Go to https://account.avwx.rest/, create an account and sign up for their free "Hobby" tier.

After you have logged in, generate an API token, by hitting the "+" sign in the toolbar at the top. Copy the generated token value, as you will need it to use the mod:


Note that you can add, update and delete these API tokens as needed. You are NOT limited to just one token!


2. Deploy the Mod to Your MSFS 2020 Community Folder


Download the Community package version of the mod and deploy it to your Community folder. Make sure to use the mod version that corresponds to your current MSFS 2020 build version. You can confirm the build version in-game, by going to your Profile screen.

After you have installed the mod, it will end up in this folder, alongside with your other mods and add-on that you may have already installed:

Community\unreal-weather-live-metar\


3. Add Your API Token to the Mod


Once you have deployed the mod, add your API token to it.

Navigate to the following folder inside your deployed copy:

Community\unreal-weather-live-metar\html_ui\Templates\WeatherEditionMenu\

You should see the following 2 files in that folder:

WeatherEditionMenu.html
WeatherEditionMenu.js

NOTE: Windows 10 hides certain well-known file extensions in Windows Explorer by default. That fact alone may confuse the heck out of you when looking for particular files like the ones listed above. I strongly suggest that you globally disable that "feature" in your Windows Explorer by following the instructions in this post. Trust me, that is going to make your life much, much easier!



Open the WeatherEditionMenu.js file in any plain text editor, such as Notepad or Notepad++, and add your API token to it. The API token is going to be used by the custom code to obtain METAR reports while you're playing the game.

At the top of the file, locate the line that references the metar_api_key variable and insert you API token between the two single quotes as shown below:



(Naturally, you API token is going to look somewhat different from the one shown in the above picture.)

That completes the installation process. You should be ready to go!

Start MSFS 2020, select "UNREAL WEATHER - LIVE METAR" as your weather preset and enjoy. If everything is working correctly, you should see the current METAR data in your Weather Settings panel (see the example picture at the top of this post) and you weather should adjust dynamically according to the current METAR report from the monitoring station, closest your currect location. (Typically, an airfield.) As you move around the world, you will see the weather change.

The installation process is also shown in this nice video made by Flying Theston on YouTube:





HOW DO I CONFIGURE THE MOD?


While you have WeatherEditionMenu.js file open in your text editor, you may also want to consider making some adjustments to the mod's behavior, such as the polling frequency or weather transition speed. For example, reducing the transition step duration to just 0.1 sec provides smoother visuals, but required a more powerful PC. You can also enable and disable some of the weather features. Look for the correspoinding variables at the top of the file and make changes as needed. Keep in mind that any changes will be applied only after you fully restart Flight Simulator; they cannot be adjusted while in-flight.

A warning about the enable_aerosol_density flag: I left it disabled by default. The reason is that, while aerosol density works within the game just fine for the purpose of emulating fog, dust, mist and similar obscurations, changing it from one value to another, no matter how small the gap, causes MSFS 2020 to severely stutter while it recalulates the visuals. Occasionally adjusting that value via the in-game Weather menu is not an issue, but when this mod transitions the weather from one state to another, the aerosol density may change continuously for the whole transition period (if aerosol is specified in the weather report), causing an annoying prolonged FPS drop. That's especially severe on weak PCs. So, do not enable that flag, unless your rig can handle such situations or you just want to experiment.

You may also want to read this post: About the Weather Transitions and How They Work

WHAT DOES "RE-ROLL WEATHER" BUTTON DO?


While a typical METAR report contains many data points, the supplied information about some of them is approximate and insufficient in order to replicate the corresponding weather 100% correct within the game.

For example, the information about cloud layers is somewhat vague: it includes coverage and altitude, but layer thicknesses or scattering are not specified at all. The same applies to precipitation, aerosol density, etc.. Because of that, this mod adds the missing information in a random fashion, i.e. it is possible to get noticeably different results for any given METAR report.

Should a user dislike the automatic results, the "Re-roll Weather" button allows them to quickly recalculate the weather on the fly, as many times as they want. Each time the button is clicked, a new weather snapshot is generated, yet each new snapshot will still conform to the same METAR report. Note that this button works during weather transition periods as well.




KNOWN ISSUES AND LIMITATIONS

  • (FIXED IN VER. 1.2) It is better to select the Unreal Weather preset from the beginning, before you start your session. Use the Flight Conditions menu on the World Map screen. If you start with a different preset, or if you change the active preset while in-flight, Unreal Weather may not update the weather until it gets an updated METAR report. (This is going to be fixed shortly.)

  • (FIXED IN VER. 1.2) Seal-level pressure calculation can be wrong. If that's causing you grief, please set enable_pressure = 0 instead of 1 in the "features" section at the top of the WeatherEditionMenu.js file and restart Flight Simulator. (This is going to be fixed shortly.)

  • The weather is only updated when your session is live. It will not be reflected on the World Map or on the loading screen where you see the "Ready to Fly" button.

  • Please keep in mind that the METAR data is geographically patchy, as it is mostly provided by airfield stations. So if you are in the middle of nowhere, you may get stuck with the last report you have managed to catch, or keep getting updated reports from a far away station. For example, if you depart from New York and head East, you may keep receiving the current New York weather for a while until you get closer to some islands, or the coast of Africa or Europe.

  • (FIXED IN VER. 1.5) The Weather "Settings" menu panel does not update itself continuously, so it may appear that the temperature, pressure, snow cover values etc. are not being updated. To get around that, just select any of the cloud or wind layers and then click back on "Settings" to see the actual current values:




HOW TO CONTACT ME


Please send any feedback to me at unrealweathermetar /at/ gmail /dot/ com.

Have fun and stay safe!

Unreal Weather - Live METAR Version 1.6 Has Been Released!

 Please see the main post for the details about this release: Unreal Weather - Live METAR