Saturday, August 19, 2017

The Dynamic Weather System Mk. II

As a part of our code rewrites for optimization and feature adding purposes, we've recently begun working on remaking our Dynamic Weather System plugin for the Ultra Dynamic Sky blueprint. I am happy to announce that we now have a much more complex simulation using much simpler code.

Below is a list of features for our new plugin. (Optimized features are in yellow, new features are in green.)

Features:

Start-up Checks and Reference Assignments:
This is a backend feature that ensures everything is available for DWS to work correctly. Properly, the Dynamic Weather System should be called by the level blueprint and spawned somewhere in the world. Once it is spawned, the system will check for an Ultra Dynamic Sky actor. If one is not found, then the operation of the plugin is ceased and an error message is provided to the end user, stating that a UDS actor is required for the DWS to work correctly. We do not automatically add UDS to the scene since there are many customization options that the world builders are able to take advantage of; we want to avoid an out-of-the-box feel to the plugin. If more than one UDS is present for some reason, we will use the first one placed.

The start-up procedure also checks for a directional wind actor. If one is not present in the scene, then the system will add one. If more than one directional wind source is present for some reason, we will use the first one placed.



The last thing the start up procedure checks for is an exponential fog height actor. Due to its importance in realistic rendering of the UDS, we also halt the system here if one isn't found since the UDS must be set up with the exponential fog height actor.

Once all required actors are located in the scene, references to those actors are established so that they can be later manipulated by the code.


Timer Ordering:
This is another backend feature that ensures the start up of our system goes smoothly. Basically, a timer in the system is not able to start until validation events in the startup checks are passed. This introduces more order to the system and prevents things from breaking.












Cloud Density Shifts:
Cloud density changes aren't new to the system, but they have been reworked in order to work with our wind simulation. Specifically, how they are generated has been changed to work in adapting to the speed changes of our wind.




Temperature:
Temperature is also not new, but how it is calculated is. Temperature is no longer a variable that randomly fluctuates within a given range based solely on cloud coverage and active weather events. Temperature now also takes into consideration the time of day; if it is daytime, then the temperature will be more inclined to increase; if it is nighttime, then the temperature will begin to drop.


Humidity:
For sakes of simplicity, humidity changes are mostly random with some influence from the current temperature. If the temperature is high, then humidity is more likely to increase slightly more than it normally would. If the temperature is cold, then it is more likely to decrease slightly more than it normally would.















Wind:
Perhaps one of the biggest things in this update is our directional wind simulation. The direction of the wind is able to change randomly throughout the day. The wind must update within certain parameters, however.

We originally contemplated allowing the wind to update as it wanted, free of most constraints, or programming in a jet stream so that the wind would always be blowing primarily in one direction with some variation. We settled on programming in a jet stream, so now the wind is able to blow in any direction within a North-to-East heading. (Thank you everyone who voted on this topic in our Discord and on Twitter.)

In addition to wind direction changes, the wind speed will also randomly update within a certain range.

Furthermore, in addition to the wind itself changing direction and speed, the clouds in the UDS also change direction and speed in relation to the wind.














Weather Events:
Though weather events aren't anything new, we have added some new features to the weather events themselves. Weather events no longer work as something entirely dependant on the cloud density; humidity also comes into effect when calculating the possibility of a weather event occurring. 

We also have a new weather event that is able to occur because of our inclusion of the humidity variable; fog. A general humidity based fog is always present in the scene. A fog event, such as the one pictured below, only occurs when a certain set of conditions is met. Important factors in determining the ability for a fog event to appear are the scene's humidity, as well as its temperature.















Solar Activity Simulation:
We now have random solar activity simulation. We simulate solar activities because we added auroras to the game that can be seen during the night. Every time that we run an update of the aurora, there is a chance that a solar flare occurs, which makes the typically unnoticeable aurora much brighter and more vibrant.