Pause, game time and real time.

Hi,

I have a scheduling system in my game that currently works with system.getTimer, a.k.a. real world’s time. (at least our perspective of “real”, but that’s not the topic here!). I’m about to add pause functionality and suddenly it struck me that if I count time based on real world and pause the game, after un-pausing everything should be a mess.

The immediate solution that I did with my previous games was to count each frame from game start and when game is paused, stop counting it, and every time I need to know the “time”, I have to divide it by 60, as my FPS is 60. The old frame-dependent, not time-dependent approach to game dev.

So I have two questions here:

  1. Is that approach reliable on mobile devices? I know that approach unleashes my game from real world time but makes it frame dependent so what if I don’t get enough frames and if that happens, when I want to do something in x amount of frames, that would be inaccurate because not that amount of frame is passed.

  2. Is there any better, and proven, approach than my old one?

Thanks.