Integer size and timeframes with time of day
Hi there, I have a time of day setup using a timeframe and a timeline to control the position of the sun and moon. The timeframe is being controlled by an "absolute_time" int variable which stores in game seconds. It constantly counts up based on a loop called every 0.1 seconds (to make things go by a little faster). I can "wait" or "sleep" by adding a "wait_time" int variable to "absolute_time" and it update the timeline accordingly for the sun and moon position.
The question is: should I be worried about the "absolute_time" int variable getting too big as time goes on in the game? I was thinking that it could be reset to 0 after each day and then have a separate day variable if int max size could be an issue.
Nevermind haha i think i figured out my own solution. I could have a branch that checks the absolute time size. If it is greater than a days worth of seconds, I just subtract a days worth of seconds. That way the wait time carries over to the next day whereas if absolute time was just set to 0 once exceeding the day, wait time would get stuck at midnight.
answered Dec 22 '17 at 12:58 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here