Pro : Animation aged.
by NEOK · in Torque Game Builder · 08/02/2006 (1:14 am) · 1 replies
I've already noticed this problem, and finally found the source of the problem.
My game has to be played for days long without turning off.
The problem is that the t2dAnimatedSprite object doesn't get animated when days passed.
It happens because of the datatype of mCurrentTime in t2dAnimationController
While it keeps increasing in t2dAnimationController::updateAnimation, it lost its precision around 263000 in my machine.
Assumming that mCurrentTime holds the seconds, it happens if you keep your game on for 74 hours.
The only solution without modifying the source code is that I can recreate the aniatmion object before its time loses precision.
Any update or suggestion for this problem??
My game has to be played for days long without turning off.
The problem is that the t2dAnimatedSprite object doesn't get animated when days passed.
It happens because of the datatype of mCurrentTime in t2dAnimationController
class t2dAnimationController
{
...
F32 mCurrentTime;
...
}While it keeps increasing in t2dAnimationController::updateAnimation, it lost its precision around 263000 in my machine.
Assumming that mCurrentTime holds the seconds, it happens if you keep your game on for 74 hours.
The only solution without modifying the source code is that I can recreate the aniatmion object before its time loses precision.
Any update or suggestion for this problem??
About the author
Torque 3D Owner Phil Carlisle
The best thing to do, would be to write a routine that kicks in at very large intervals and re-sets the mCurrentTime value back to 0+last time step. Essentially, make it wrap to 0 but remember to keep the interval calculation the same so that you dont get a jump when you reset it.
Or simply exit the app after 73 hours? :)