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.