I’m moving from UDK to UE4 and need to transfer my code over. I thought that knowing C would help me here, but the difference between C and C++ is much larger than I thought it would be, though I suspect most of my hiccups are coming from my lack of familiarity with the UE4 codebase itself.
Anywho, I would like some feedback on the following (i.e., am I thinking about this correctly, is there a better way of doing it, etc.):
I need a Time-of-Day system which can track and work with spans of time ranging from minutes to thousands of (ingame) years. The UDK version of this system was singleplayer-only, but I’d like to give multiplayer a shot here - or at least leave the option open - so this time, I’m worried about replication. I think that the best way to go about things is to create a Time Manager or Timekeeper that resides only on the server, and updates the in-game time either once per tick (probably inefficient and generally overaccurate) or via a timer with a predefined interval, like 15 or 20 times per second. This timekeeper would then send the calculated timestamp (a custom class containing an array of ints corresponding to year, month, day, hour, and minute, and a handfull of functions to compare, add, or subtract timestamps) to the GameState, which would then be replicated out to connected clients. Any movement of the sun or moon would also be calculated server-side and pushed to GameState for replication. On the client side, when GameState detects an update of the Timestamp, it pushes out the new data: human-readable time gets printed to HUD, the sun and moon get translated to their new positions, etc.
Is this a good way of doing things? Is there something more efficient?
Also, I haven’t found any kind of ElapsedTime variables or functions yet; is there any built-in way of getting the length of time elapsed since the game has started (not counting paused time), or do I need to spawn and use my own timer when the game starts?
Thanks in advance.