Time and Day Night Cycle management #
Day Night and Time System #
The Day night system simulates celestial positioning. This celestial positioning can be accurate or simplistic based on options set in the BP_TimeManager. The Time system simulates accurate or simplistic time with durations for day and night, timezones, coordinates and more.
This means that the DayNight Cycle always needs the time manager and therefore it is automatically included in the daynight cycle package. However, the time manger can also be used as a standalone system. This documentation is for both the time manager as well as the day night cycle system.
Core System #
Actors #
-
- BP_DayNight_SunMoon
- BP_TimeManager
Components #
-
- AC_GameState_DayNightCycle_Manager_Advanced
- AC_GameState_Time_Advanced
System Setup #
Setting up the day night system is straight forward. In your target level drag out BP_DayNight_SunMoon and BP_TimerManager. Once you have dragged out both into your level we can proceed to the next step.

For the next step the creation of a custom game state class is required. Create a custom game state class and add it to your world settings Game State class.

Inside the custom Game State Class add the AC_GameState_Time_Advanced component. This component is manages the time inside the runtime level. This is very important because BP_TimeManager acts as a bridge between in editor and runtime, the data you set to the Time manager gets transferred to the AC_GameState_Time_Advanced on Begin Play

Once completed, the basic setup is now completed, see BP_TimeManager to change any properties to your liking.
Simple Time System Overview #
By default simple time is used. This section explores attributes of the simple time and what they are.

Use Seasonal Variation – if enabled allows dynamic day and night lengths as per season.
Day Duration – duration of the day(Sun above the horizon) in minutes.
Night Duration – duration of the night(moon above the horizon) in minutes.
Current Year – Current year the system will start out on.
Current Month – Current month the system will start out on.
Current Day – Current day the system will start out on.
Simple Time – Current Time(HH:MM:SS) the system will start out on. Range is 0-24hrs.
Days in Month – Months consist of x days. This allows us to specify how many days all months have in them.
Months in Year. Years consist of x months. This allows us to specify how many months each year contains. Months in Year maps a month to a season. This is important for seasonal variations if enabled.
Azimuth Curve – Azimuth is the horizontal angle of the sun in the sky. This curve specifies the horizontal angle offset.
Accurate Time System Overview #
To enable accurate time check Use Accurate Time to true.

The accurate time option allows the user to be more specific in how they want the system to behave. Enabling this option allows for accurate moon and sun positioning, accurate seasons, the use of coordinates and timezone, and much more.

Cycle Time – The time it takes for a single day. In this example the entire day will last for 0.01 min.
Day – The current day the system will start out on.
Month- The current month the system will start out on.
Year- The current year the system will start out on.
UTC Time – UTC time is universal time. Time zones are calculated from this time. UTC Time is the main driver for the calculations of the Day night system.
Use Simple Accurate Time – Since Having to worry about timezones and UTC time may be confusing, having this option set sets the desired timesone to Greenwhich Mean Time
(UTC + 0) this means that there is no offset and 6:00 acts like 6am in the morning.
Desired Time Zone – In order to see the effects of the timezones make sure Use Simple Accurate Time is set to false(UnChecked). Changing the Timezone affects the suns position since timezones are offsets from UTC Time

Coordinates – By default each timezone has general coordinates associated with them. For example the general coordinates for EST that the system uses is (15 latitude,-75 longitude). If the user wishes to be more precise, set Use General coordinates to false and override the coordinates for example to 40.7128 Latitude, 74.0060 Longitude to Simulate celestial positioning for New York City.
Time Events and Dispatchers #
Each event can be expanded on but implementations and intentions for the AC_GameState_Time_Advanced class will be covered.

Update Part Of Day – Associates the part of day(morning, afternoon, evening, and night) with a custom time value. When this event gets called it updates the time to the given enum argument.
Add Time – Adds a custom time amount to skip.
Skip Time – Adds a custom time amount to skip + Cosmetics.

Freeze Time – Pauses current time progress.
Change Notify Time – Every x minutes a delegate will be fired. This x minutes is called notify time.
Change Time Multiplier – Normal time multiplier is 1x, changing the multiplier will either increase or decrease the day length.

Update UTC Part Of Day – Associates the part of day(morning, afternoon, evening, and night) with a custom time value. When this event gets called it updates the time to the given enum argument.
Add UTC Time – Adds a custom time amount to skip.
Skip UTC Time – Adds a custom time amount to skip + Cosmetics.
Set UTC Timezone – Sets a desired timezone.
Update UTC Timezone Part of day- Associates the part of day(morning, afternoon, evening, and night) with a custom time value. When this event gets called it updates the time to the given enum argument for the current timezone time.
AC_GameState_Time_Advanced includes event dispatchers. Below are definitions for these dispatchers.

On UTC Day Incremented – called when date is incremented.
On UTC Day Decremented – called when date is decremented.
On Simple Day Incremented – called when simple date is incremented.
On Simple Day Decremented – called when simple date is decremented.
On UTC Notify Time Interval Reached – called when the notify time interval has been reached.
On Time Notify Interval Reached – called when the simple notify time interval has been reached.
On Part Of Day Changed – called when the part of day has been changed.
OnDayTimeDawn – called when dawn time has been reached.
OnDayTimeDusk – called when dusk time has been reached.
Day night cycle dispatchers #
AC_GameState_DayNightCycle_Manager_Advanced has two dispatchers

UTC Season Changed – calls when a season has changed for UTC Time. Season changes are intended to be accurate but may execute up to day late.
Day Status Updated – Dispatcher that gets executed when the day status is updated(morning, afternoon, evening, night). This event is the exact same event as On Part of day changed but exists within this component instead.
BP_DayNight_SunMoon Property Overview #

Use Aurora – Toggle visibility of aurora.
Celestial mode – Allows both sun and moon to be accurate or just sun. This option will only take effect if Accurate time is enabled

Sky Light Intensity – modifies intensity of the skylight.
Day Night Cubemap Intensity – modifies intensity of the current cubemap.

Sun Light Color – Changes the color of the sun.
Sun Light Intensity – Modifies the intensity of the sun.
Moon Light Color – Changes the color of the moon.
Moon Light Intensity – Modifies the intensity of the moon.
If the weather system is set up and present within the level these options will be overridden.
Useful Components #
AC_ToggleLights #
Component to toggle light visibility for morning and night. Toggles lights off for the morning and toggles lights on for the night.

Toggle Lights at Once – whether all the lights turn on and off at once if enabled. If disabled(defalut) the lights will turn on and off sequentially. The Sequential Toggle Time is the time in between each toggle.
Shuffle Array – If enabled the lights will be randomized for toggle order.
Sequential Toggle Time – Time in between each light toggle in seconds.
