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: What about snow cover?

A: Unlike all other weather condition indicators, the ground snow coverage is not reported in METARs. There are some specific indicators that you may encounter, such as 4/nnn or SOG, but those are typically related to runway conditions, and not surrounding areas. The mod honors these indicators, but they are rare.

In addition, the mod will generate snow coverage when the current METAR indicates that it is snowing. This feature is controlled by the following flag in the mod's settings:

enable_snow_cover_from_precipitation: 1

The above approach will not address all possible scenarios, obviously, especially when the weather is clear. If you fly over the areas that should definitely have snow cover, but the corresponding METARs prove to be unhelpful, you may want to set the snow cover value manually, using the corresponding slider in the Weather Settings panel. In order to do that, disable the corresponding feature in the mod's settings by changing the flag's value to 0 and restart the Sim:

enable_snow_cover: 0

That will ensure that the mod will not attempt to adjust the Snow Cover value on its own, enabling you to use the slider as you wish.

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 code or 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 had 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: 165,

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 165 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 had 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.

Unreal Weather - Live METAR Version 1.7 Has Been Released!

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