Savable Day Night Cycle System

defaltdobrasao - Mar 29, 2021
Not Yet Rated

Actors that provides a way to make a smooth day-night transition through the use of a sky sphere, atmospheric fog, exponential height fog and skylight wrapped in an intuitive and easy way.Save and load functions are included both as sync and async methods

  • Supported Platforms
  • Supported Engine Versions
    4.26
  • Download Type
    Engine Plugin
    This product contains a code plugin, complete with pre-built binaries and all its source code that integrates with Unreal Engine, which can be installed to an engine version of your choice then enabled on a per-project basis.

Usage video

Showcase video


A set of actors that can be used to simulate a day/night cycle with different weathers blending into each other.

Make use of ue4 components such as height fog, exponential fog, sky light, etc. but pack them into a small numbers of actors to make things more manageable and intuitive.


The parameters to set a sky condition are split between two structures (Day and Night) held inside a data table. The data table row entry defines the weather condition.

The weather can be changed by simply providing the row entry name to a blueprint function and the sky will naturally blend to the new weather condition at the speed you define inside the properties panel.


Multiple data tables can be added (at the moment is not possible to switch them at runtime but if anyone is interested I will update the code).


In the plugin there are two data tables examples:

the first one, aims to be realistic but a bit excessive in his colors, the second one is an alien planets with green atmosphere.


Finding the correct values to set into the data table is easier thanks to the editor button to switch between current data table night and day conditions, so you can set the values you like in the editor and copy them into the data table.


The object has functions to save and load everything about the day cycle system and can be done both sync and async. A structure is returned from the save function and can be saved in blueprints, the same structure is taken as input in the load function to restore the sky state.

Technical Details

Features:

  •  Day/Night seamless transition.
  •  Every parameter used to make the transitions is customizable for both day and night from a simple data table.
  •  Different weather support, every data table entry is categorized by a weather condition so different values can be used for both day and night for each weather condition you add.
  • Since everything is done through c++, several useful blueprint functions have been provided to give you full control over the logic.
  • Async and synchronous save/load built in functions.
  • Pausable support.
  • Ease of use. A toggle day/night button accessible through the editor give you the opportunity to setup a day scene, set the value you have chosen inside the data table for the day, toggle the scene to the night lighting e repeat the process.
  • No use of post process. Since the cycle is procedural and does not use any post process, you have even more control on how the scene should look.
  • Godrays from sun and other directional lights interact with the atmosphere, fog, clouds and dynamic objects.
  • Events on sunset and sunrise. A simple example scene is setup where a cube will turn the light up at sunset and turn off the light on sunrise.

Number of Blueprints: 6

Number of C++ Classes: 8

Network Replicated: (No)

Supported Development Platforms:

Windows: (Yes)

Documentation: https://drive.google.com/file/d/1ge5OoL5iE1weH44Bz2hZNprAAt1rBrcv/view?usp=sharing

Important/Additional Notes:

I mainly develop using c++ and use blueprints just as data containers, i tried to think as a blueprint developer and included the functions that I thought will be more useful.

If anyone has suggestion/requests I will gladly implement new blueprint access to the plugin.