Game time versus real time.

Hi,

In my game time is very crucial and at certain intervals I take certain steps, I use system.getTimer() to get current time and I add certain number to it so I can check when time has passed as much as I wanted.

Problem is system.getTimer() returns real world timer and when I’m debugging my game and game goes into debug mode at breakpoints, the real world time goes still and when I get back from breakpoints, game time should just resume but real world’s time is passed and I lose track of the game.

Do I have to manually count frames in enterFrame and act upon it rather than system.getTimer() or is there such feasibility in Corona?

Thanks. [import]uid: 206803 topic_id: 36789 reply_id: 336789[/import]

Hi Aidin,
I’m a bit confused… when you enter this “debug” mode, you want to later resume and know how much actual “game time” has elapsed, -excepting- the time spent in the “debug” period? Perhaps you could have “totalTimeElapsed” and “breakTime” values that handle the delta time…

  • “totalTimeElapsed” and “breakTime” begin at 0
  • game starts running
  • at first break point, set the “system.getTimer()” value as “totalTimeElapsed”… let’s say it’s 23.4567 seconds.
  • on resume, set “breakTime” to current “systemGetTimer()” value.
  • on next break point, subtract “breakTime” from current “systemGetTImer()” value… let’s say 12.3456 seconds have elapsed since the last break point. Add this value to “totalTimeElapsed” and you have 35.8023 seconds having passed in total game time, outside of the debug periods.

Is this what you need, or did I misunderstand?

Brent [import]uid: 200026 topic_id: 36789 reply_id: 145119[/import]

Umm, I want the game’s time passes when game is actually running so when game is paused via the debugger, it won’t progress.

For example, imagine that when Corona simulator’s window loses focus, the game running inside it would pause. Currently Corona simulator doesn’t do imagine if it does and in that case from the game’s perspective, when game looses focus, the game’s time won’t progress but our world’s time (human’s time) does progress.

So if we measure the game with real world clock, when game pauses with debugger or loosing focus, game doesn’t understand it.

Hope I made myself clear this time, if not, please say so and I’ll try to explain again. [import]uid: 206803 topic_id: 36789 reply_id: 145126[/import]

Hi Aidin,
I’m a bit confused… when you enter this “debug” mode, you want to later resume and know how much actual “game time” has elapsed, -excepting- the time spent in the “debug” period? Perhaps you could have “totalTimeElapsed” and “breakTime” values that handle the delta time…

  • “totalTimeElapsed” and “breakTime” begin at 0
  • game starts running
  • at first break point, set the “system.getTimer()” value as “totalTimeElapsed”… let’s say it’s 23.4567 seconds.
  • on resume, set “breakTime” to current “systemGetTimer()” value.
  • on next break point, subtract “breakTime” from current “systemGetTImer()” value… let’s say 12.3456 seconds have elapsed since the last break point. Add this value to “totalTimeElapsed” and you have 35.8023 seconds having passed in total game time, outside of the debug periods.

Is this what you need, or did I misunderstand?

Brent [import]uid: 200026 topic_id: 36789 reply_id: 145119[/import]

Umm, I want the game’s time passes when game is actually running so when game is paused via the debugger, it won’t progress.

For example, imagine that when Corona simulator’s window loses focus, the game running inside it would pause. Currently Corona simulator doesn’t do imagine if it does and in that case from the game’s perspective, when game looses focus, the game’s time won’t progress but our world’s time (human’s time) does progress.

So if we measure the game with real world clock, when game pauses with debugger or loosing focus, game doesn’t understand it.

Hope I made myself clear this time, if not, please say so and I’ll try to explain again. [import]uid: 206803 topic_id: 36789 reply_id: 145126[/import]

Hi Aidin,
I’m a bit confused… when you enter this “debug” mode, you want to later resume and know how much actual “game time” has elapsed, -excepting- the time spent in the “debug” period? Perhaps you could have “totalTimeElapsed” and “breakTime” values that handle the delta time…

  • “totalTimeElapsed” and “breakTime” begin at 0
  • game starts running
  • at first break point, set the “system.getTimer()” value as “totalTimeElapsed”… let’s say it’s 23.4567 seconds.
  • on resume, set “breakTime” to current “systemGetTimer()” value.
  • on next break point, subtract “breakTime” from current “systemGetTImer()” value… let’s say 12.3456 seconds have elapsed since the last break point. Add this value to “totalTimeElapsed” and you have 35.8023 seconds having passed in total game time, outside of the debug periods.

Is this what you need, or did I misunderstand?

Brent [import]uid: 200026 topic_id: 36789 reply_id: 145119[/import]

Umm, I want the game’s time passes when game is actually running so when game is paused via the debugger, it won’t progress.

For example, imagine that when Corona simulator’s window loses focus, the game running inside it would pause. Currently Corona simulator doesn’t do imagine if it does and in that case from the game’s perspective, when game looses focus, the game’s time won’t progress but our world’s time (human’s time) does progress.

So if we measure the game with real world clock, when game pauses with debugger or loosing focus, game doesn’t understand it.

Hope I made myself clear this time, if not, please say so and I’ll try to explain again. [import]uid: 206803 topic_id: 36789 reply_id: 145126[/import]

Hi Aidin,
I’m a bit confused… when you enter this “debug” mode, you want to later resume and know how much actual “game time” has elapsed, -excepting- the time spent in the “debug” period? Perhaps you could have “totalTimeElapsed” and “breakTime” values that handle the delta time…

  • “totalTimeElapsed” and “breakTime” begin at 0
  • game starts running
  • at first break point, set the “system.getTimer()” value as “totalTimeElapsed”… let’s say it’s 23.4567 seconds.
  • on resume, set “breakTime” to current “systemGetTimer()” value.
  • on next break point, subtract “breakTime” from current “systemGetTImer()” value… let’s say 12.3456 seconds have elapsed since the last break point. Add this value to “totalTimeElapsed” and you have 35.8023 seconds having passed in total game time, outside of the debug periods.

Is this what you need, or did I misunderstand?

Brent [import]uid: 200026 topic_id: 36789 reply_id: 145119[/import]

Umm, I want the game’s time passes when game is actually running so when game is paused via the debugger, it won’t progress.

For example, imagine that when Corona simulator’s window loses focus, the game running inside it would pause. Currently Corona simulator doesn’t do imagine if it does and in that case from the game’s perspective, when game looses focus, the game’s time won’t progress but our world’s time (human’s time) does progress.

So if we measure the game with real world clock, when game pauses with debugger or loosing focus, game doesn’t understand it.

Hope I made myself clear this time, if not, please say so and I’ll try to explain again. [import]uid: 206803 topic_id: 36789 reply_id: 145126[/import]