Summary #
Our Weather System currently supports rain and hail, which affects the global wetness of objects in your levels.
It integrates with our Wind System, allowing for sideways rain and stormy wind effects on your plants.
It is suitable for outdoor scenarios – but unfortunately does not support indoors yet. We will attempt to provide this in a future update.
For a quick summary of the features of this system, read below
- Provides easy Saving and Loading of exact weather state
- Allows for randomised weather patterns, with fully customisable timing
- Contains 9 Different Startup Types
- Rain and Hail blows with the intensity and direction provided by BP_WindController
- Customize Raining and Non-Raining Fog Visuals in the viewport before applying to the system
- Rain Sounds adjust dynamically, according to rain heaviness
- Material Wetness fades out much slower than it fades in, simulating the drying effect
- Hail Particles bounce off objects with collision
- Can start and stop rain based on calling Events.
- Fades water murkiness on water material when raining
- Automatically increases the water level of BP_RisingWater based on rain heaviness
- Provides numerous hail controls, including chance of hail, and rain heaviness threshold before hailing
Adding the Weather Blueprint #
To begin, please navigate to Content / AlienPhysicsWorld / Blueprints / Atmosphere / Weather
Drag BP_WeatherController into your level.
This blueprint is the core system for controlling the weather and its effects.
Implementing Fog #
Next, you’ll need ensure you have Two ExponentialHeightFog actors in your level for this blueprint to function correctly.
One Fog actor will be used for when there is no rain, while the other will be used for when it rains.
Naturally, you’ll want to ensure the raining fog is thicker than the non-raining fog.
Add these 2 fog actors by searching “Fog” in the Place Actors toolbox.
Its best to name them to be something like “Fog Rain” and “Fog Non-Rain” as we will reference them later.
You may change the fog colors, thickness, and any other settings until it is to your liking.
Do this for both Rain and Non-Rain fog actors.
(To view Unreal Engine’s official documentation on fog, click here)
Once you have completed setting up your fog actors, select BP_WeatherController in your level.
In the details panel, reference the fog actors you just created under these variables:
- Original Fog: This is the fog used when it is not raining.
- Rain Fog: This is the fog used for when it rains
Next, ensure that the following checkboxes have been appropriately set:
- If your fog actors have volumetric fog enabled,
tick the Fog Is Volumetric? checkbox - If your non-rain and rain fog have different colors,
tick the Lerp Fog Colors checkbox - If your two fog actors animate additional properties besides Fog Density
(such as height falloff, Max Opacity, Start Distance, Cutoff Distance, Directional Inscattering Exponent, & Directional Inscattering Start Distance)
You must check the Lerp Advanced Fog Settings checkbox
The Move Rain Fog To Same Location As Original Fog checkbox moves the Rain Fog actor to the same location as the Original Fog in the level. This ensures that the fog visuals you see in the editor will match those in the game, maintaining visual consistency when editing values.
Please be aware that the Rain fog appearance will match what you see in the viewport when the rain is at 100% Heaviness.
If your rain is NOT at 100% heaviness, it will be a blend between the non-rain fog and the raining fog.
Saving and Loading #
If your project has saving and loading of games, you’ll naturally want the weather to save and load its state as well.
We’ve implemented a system to allow this to be done very easily.
In the details panel of BP_WeatherController, you’ll find a number of checkboxes related to saving and loading games.
To ensure that saving and loading is activated, please tick the “Load Rain From Save Game” Checkbox. If unchecked, the level will completely reset the weather system each time the level is loaded.
The “Save Game is Level Dependent” checkbox ensures that the weather saves for each level independently, regardless of whether the Save Game Slot Name is the same. It does this by adding the level’s name to the end of the Save Game Slot Name when saving and loading.
This should be true by default, to stop rain values being loaded from one level to another.
Let’s go over the correct way to save and load a weather system using your custom Save Game Slot Name.
First, make sure the “Save Game Must Be Set Before Begin Play” checkbox is set to TRUE. This prevents the weather system from automatically starting at Begin Play, allowing you to specify the Save Game Slot Name before it begins its functions.
Next, in your Level Blueprint or a custom blueprint, set the weather system’s Save Game Slot Name according to your preferences.
Once you’ve set the Save Game Slot Name, call the “Initialize” event to instruct the weather system to load the weather state from your save game.
Please note that the publicly editable variable “Save Game Slot Name” in the blueprint’s details panel is only editable for debugging purposes. It’s useful if you need to test a specific save game slot name, but it should be ignored unless you are in a debugging phase.
For game develpment, you should always set the Save Game Slot Name through blueprints and not the details panel of BP_WeatherController.
Weather Behavior #
Select how you want the rain to behave using the dropdown box labeled “Rain Startup Setting.”
There are several options available, each defined by a few key features.
The first feature to choose from is how the rain starts. Here are the available options:
- Control Rain using Manually Triggered Events
- Fade in Rain on Game Start after Delay Timer
- Rain Pours on Game Start
Next, choose an option based on whether you want to enable weather patterns. The weather patterns feature automatically creates periods of rain and dryness during gameplay, adding a dynamic element to your environment.
- – No Weather Patterns
- + Weather Patterns
Next, you’ll need to decide if you want the rain to have a constant or varying heaviness.
This feature can be optionally utilised to trigger hail after reaching a certain rain heaviness level.
Varying heaviness is random but can be adjusted with additional settings that we will cover later on in this documentation.
- – Constant Heaviness
- + Varying Heaviness
If you ever have trouble knowing what to choose, simply hover your mouse over one of these options and it will explain what it does.
Rain Events #
If you select an option with “Control Rain using Manually Triggered Events“, rain will not start unless you manually call the events “Rain Start” and “Rain Stop” using blueprints.
simply reference the BP_WeatherController in another blueprint, and call “Event Rain Start“.
You can also call “Event Rain Stop” to cause the rain to fade out.
Delay Timer #
If you selected an option with “Fade in Rain on Game Start after Delay Timer,” the rain will not fade in until a specified number of seconds have passed after the game starts.
You can set the delay duration by adjusting the variable “Fade in On Game Start – Delay.”
If you have set up the saving and loading system, the remaining seconds of this delay are saved and loaded using your Save Game Slot Name, ensuring the gameplay feels natural and consistent each time you load the game.
Rain Heaviness #
Rain Heaviness is a multiplier applied to the base rain value, adding realism and variety to the weather. It’s important to note that Rain Heaviness does not directly control the total amount of rain. The total rain amount is calculated as Rain × Rain Heaviness
The heaviness value is randomly selected between the “Rain Heaviness Minimum” and “Rain Heaviness Maximum” settings. A new value is chosen after a set period, which is also randomly determined between these specified minimum and maximum durations:
- Rain Heaviness Anim Delay – Min
- Rain Heaviness Anim Delay – Max
The “Starting Rain Heaviness” variable determines how heavy the rain is when it begins. This setting is especially important to adjust if your Rain Startup Setting is set to Constant Heaviness.
Even if you choose Varying Heaviness, this value will still influence the initial rain intensity and can be most noticeable if the rain starts pouring right when the game begins.
Hail #
If you would like hail to be enabled, simply tick the “Hail” checkbox in the details panel.
The “Hail – Rain Heaviness Threshold” variable sets the rain intensity level needed for hail to start falling. To have hail fall constantly, set this value to 0.
The “Hail Chance %” variable sets the likelihood of hail occurring during a rain period. This option is only relevant if you have chosen a Rain Startup Setting with Weather Patterns. When it begins to rain after a dry period, the game uses the Hail Chance % to determine if hail will fall or if it will just rain without hail. This chance resets each time the rain stops. Keep in mind that even if the Hail Chance % indicates hail, the rain must still meet the Hail – Rain Heaviness Threshold for hail to actually occur.
The hail’s particle size will vary from small to large according to the “Rain Heaviness” level.
The “Rain Heaveinss At Which Hail Is Max Size” variable controls the threshold at which the hail particle reaches its maximum size.
The “Hail Fade Anim Speed” variable determines the speed in which hail will fade in when it meets the requirements for falling.
Weather Patterns & Timing #
If you’d like to customise the speed at which rain fades in an out, adjust the “Rain Fading Anim Speed” variable.
If you have selected a Rain Startup Setting with the option of “Weather Patterns“, you may want to customise these additional settings.
The Rain Duration Minimum & Maximum variables control how many seconds rain lasts for after it starts.
The Dry Duration Minumum & Maximum variables also respectively control how long dry periods last for.
Sound Customisation #
The sound setup we use for rain is dynamic, meaning that it crossfades between two sound waves based on the Rain Heaviness.
If you absoloutely hate our sound effects and want to replace our rain sound for your own, you can do this using the RainSound variable.
We recommend first duplicating our sound cue as it has the crossfade settings already set up.
You can find this at:
Content / AlienPhysicsWorld / Sounds / Atmosphere / Rain
You can then open up the new Sound Cue and replace the Light and Heavy sound waves with your own.
Please make sure they are set to looping!
Particle Adjustments #
In the BP_WeatherController details panel, there are two variables you can adjust.
When Particles Follow Camera is checked, rain and hail particles will follow the camera. If this variable is unchecked, the rain and hail particles will follow the player pawn instead.
The Falling Particles Offset is the amount of units the rain and hail particles are offset from the camera or player. This can be used to control the height that the rain falls from.
If you wish to modify the rain or hail Niagara particles, locate these files at Content / AlienPhysicsWorld / Effects / Atmosphere / Weather
We recommend creating a backup of these files before modifying them as they can be quite complicated.
Do not attempt to create your own particles from scratch, as they will no longer work with our weather system or wind system. Always start from the foundation of NS_Rain or NS_Hail.
Check the Sprite Renderer Module for a reference to each particle’s material, which you can feel free to modify.
If you have made copies of NS_Hail or NS_Rain instead of modifying the originals, you can still apply it to our weather system by opening up BP_WeatherController and replacing the Niagara Systems.
Rain Materials #
Wetness & Splashes #
There is a material parameter collection called MPC_EtherionFunctions which contains a number of useful values for blending your material wetness and splash effects.
It is located at
Content / AlienPhysicsWorld / Materials
There are three parameters inside of MPC_EtherionFunctions which should be used to change the state of materials in your level:
- RainDrops – This should blend in any rain particle effects. It fades in first when raining. Its generally not needed in materials unless they are rain particles.
- Wetness – This should blend the roughness and specular values of your material. It fades in the middle when raining.
- RainSplashes – This should blend any material puddle splash effects. It fades in last when raining
Now let’s continue on to the basic process of how to use these values in your Material designs.
Create or open a material which you need rain to affect.
To access MPC_EtherionFunctions, right click and type in Collection.
Click Collection Parameter.
With the Collection Parameter selected, go to the details panel.
Under Collection, search for and select MPC_EthieronFunctions
Next, select your chosen rain parameter from the list.
You can use these parameters to lerp between values in your material
To speed up the process of material creation, we made two Material Functions that will help you swiftly apply rain effects to your materials.
MF_RainSpec allows you to input a specular value and a roughness value.
It will automatically fade between these inputs and some designated values when it starts to rain.
If you use this material function and then create a Material Instance of your material, you can see some additional values that the material function created for the Rain Roughness and Rain Spec.
Their default values should work for most objects, but feel free to adjust them as needed.
The second material fuction is called MF_RainDrops.
It is an animated normal map of tilable raindrop ripples.
These ripples will only apply to the top of a mesh (not the bottom).
It will automatically fade in when it starts to rain.
This function should be used with the BlendAngleCorrectedNormals node to blend with your existing normal map.
Water Material Murkiness #
If you’d like rain to cause your water material to react realistically, you’ll want to make sure that its murkiness increases when it rains.
To do this, simply use the Material Parameter Collection mentioned in the step above to lerp the Absorbtion value of the rain in your water material.