Telling everybody what time it is

Hey thanks for looking at my post!

So im trying to figure out how to deal with world time and different time based events.
As is im sending the time to my player for its hud and to some plants in the test map but i have some things im a bitty foggy on with applying it on a larger scale.

80% of the actors are going to need to know what time it is, creatures and NPCs would sleep, while plants would grow and food would expire.
Im casting to them using inheritance now but would it get costly down the line if it tells 100 actors its time to pass out?

also does anyone have any insight on how level streaming would play into this? i Havent really gotten into that stuff yet im just working on frame work and that kind of jive

Im doing time of day with NPCs on 2 projects and I would suggest 1 of 2 models.

Push Model - have time of day calculated on a single actor in your scene and use an event dispatcher to send current time to the NPCs on a regular interval

Pull Model - each NPC holds a reference to that single actor and each NPC queries the actor for current time on an interval

A quick/easy but dirty solution would be to put the time of day into the GameInstance class. Other objects can get the time of day from that instance. A much cleaner solution would be to set up a singleton or a static class that manages the time of day.

Hey thanks so much for the replies!

How dirty would it be to hold the reference to the clock actor in the game instance?

I was tweaking things last night and made an actor component so now the comms kind of look like this

Clock Sets TOD - On begin play casts to Game Instance and sets the Clock Actor reference as itself.

Time Component gets game instance and casts to Clock with its reference, then adds itself to Array of active components receiving time

When actor is changed or destroyed time component removes itself from the Clock array.