Page 1 of 1

Varius Time subsystem inaccuracies/questions.

Posted: Tue Dec 04, 2018 10:19 pm
by personwithhat2
Why is "m_lBaseTime" adjusted?

Code: Select all

// Adjust the base time so that time actually seems to have moved forward m_fFrameTime m_lBaseTime += realTicks - simTicks;
In my edits, m_lBaseTime is not adjusted and just used as the 'time at last reset' as normal.
Removing this adjustment has not impacted times/timers negatively and made it easier to debug level startup/etc. accurately.

On that note, GetAsyncCurTime() gets reduced randomly across frames when the base-time adjustment is in effect (default CE engine).
Could someone, PLEASE, explain what "GetAsyncCurTime()" is used for, and if this is intended?

Re: Timer questions

Posted: Wed Jan 02, 2019 3:31 pm
by Cry-Flare
GetAsyncCurTime get the number of seconds since boot up. It is generally used to check whether a period of time has passed to action things, eg, how long after a grenade is primed before it explodes).
I am unsure why base time is adjusted specifically but it may be due to pausing the game.

Re: Timer questions

Posted: Wed Jan 02, 2019 6:47 pm
by personwithhat2
Pausing is unrelated. Pausing only affects game simulation time, not UI time (which is monotic blah blah and unaffected by pausing/smoothing/etc.), BUT adjustment offsets the base time for both.

Due to timer adjustment GetAsyncCurTime() is heavily inaccurate and does not properly return the number of seconds since boot. Removing the adjustment makes it return what you think it does .-.

Not that hard to test, spam GetAsyncCurTime() during boot (really anywhere) with and without the timer adjustment and compare values.

Hence why I'm asking this, hopefully you can bother someone, I have about 3-4 more Timer.cpp related questions >.<

Re: Timer questions

Posted: Mon Jan 14, 2019 11:26 pm
by personwithhat2
Bumping via comment now just so I can keep track on how long this is hanging around.

Re: Varius Time subsystem inaccuracies/questions.

Posted: Tue Mar 26, 2019 8:17 pm
by personwithhat2
Another bump.