I’m not even close to being skilled enough to implement the solution to this, whatever it may be; but this question is bugging me all the same. Here goes…
I want to track the passage of in-game time – which will not be tied to the passage of time in our world. Time will mainly pass when the player character chooses to do something, and we cut to “X hours later, you’re done with the activity”; it’ll also pass when we’re moving on the world map.
When an in-game day ends, I want to send out a daily update to every character, faction, and location in the game. This will track things like wounds healing over time, moods returning to normal after big successes or failures, factions making decisions about what they want to do next, and even the growth of crops, the beginning and end of the harvest season, the progress of the spring thaw, etc.
Together with this, I want to have multiple maps. There’s the world map, of course; but there are also zoomed-in location maps, and the player might spend weeks or months on a single zoomed-in map, before eventually returning to the overworld.
During these zoomed-in periods, I need to keep the clock ticking, allowing the rest of the world to go on doing its own thing (up to and including a hostile faction sending troops or an assassin after you, if they’re confident about where you are). Whether an actor is present on the same zoomed-in map as the PC or not, they still need to get daily updates.
When I was trying to write games in C++ without an engine, my solution to this problem was to store everything that needed daily updates in dedicated monitor classes; I had a Factions Monitor, a Characters Monitor, a Locations Monitor, and so on. When I wanted to reference an object that lived in a monitor, I’d save its monitor key; I could’ve used pointers for this, but I wasn’t confident that I could’ve kept my code bug-free, and using keys made everything easier to serialize (which I was also doing by hand).
I always felt a little guilty about this solution. Singletons have a reputation as an anti-pattern, and here I was storing everything in the game in singletons…
Facing this problem in Unreal, what tools are available to me? What approach should I take? Are there any tutorials on this?
Any advice or thoughts would be appreciated – even advice on which keywords to use if I want to learn more about this question. “Time,” “daily,” and “persistent” tend to refer to other things!