Calendar/Time Keeping

Classes that reference time

Calendar Subsystem

The Calender Subsystem is the heart of the time keeping logic, It keeps track of what time of day, month, and year it is ingame.

Calendar Subsystem

Subsystem functions

image.png

The Calendar subsystem has a few functions that can be accessed from anywhere, The most important being Get Day Progress that outputs 0-1 0 to 0.5 is night and 0.5 to 1 is day

Calendar Subsystem

Project Settings

image.png

The subsystem is highly customizable, you can set how many days per month there is along with how long the day is in seconds

Clock UI

Clock UI

Clock hands

image.png

Within RTP_Clock on the tick we just get the day progress 0-1 and convert it to minutes and hours then it multiplys the values by the angle the hand needs to move

Clock UI

Clock Gradient

image.png

The clock gradient is controlled by a shader, the NightShader Mask output outputs 0 if its day, 0.5 if its dusk or dawn, and 1 if its night. We yse this value to sample a curve to properly lerp between the 3

Backwards Compatibility (Event Manager BP)

Backwards Compatibility (Event Manager BP)

Hourly Time Dispatcher

image.png

The EventManagerBP has this on its tick, Its not ideal but it works for now and can be replaced eventually, Until then i have marked the dispatcher as depreciated.

Backwards Compatibility (Event Manager BP)

Time of Day Dispatcher

image.png

The previous time manager kept track of a enum for the time of day, this converts the Day Progress to the time of day then runs a dispatcher, Id like to move this to the calendrer but just dont have time for that atm

Editor Tool

I have updated the garden save manager but due to how the ini files work you need to play in standalone or restart the editor, The visuals the the editor still update and the value in the ini but it doesn't load the new start time if you play in the viewport without restarting

image.png