Beta 1.1 animation Bug
by NEOK · in Torque Game Builder · 02/13/2006 (7:52 am) · 5 replies
I found something strange in animation sprite.
If I set animationCycle to false and adjust animationTime to a certain value, the animation doesn't stop at the last frame but the earlier one.
I guess you can test it by adding below lines in \tools\levelEditor\data\datablocks.cs
and place it on the level editor, then it will stop at 3 rather than 4.
If I set animationCycle to false and adjust animationTime to a certain value, the animation doesn't stop at the last frame but the earlier one.
I guess you can test it by adding below lines in \tools\levelEditor\data\datablocks.cs
datablock t2dAnimationdatablock(defaultAnimation2)
{
imageMap = defaultAnimationImageMap;
animationTime = 0.7;
animationCycle = false;
};and place it on the level editor, then it will stop at 3 rather than 4.
About the author
#2
I tested the next solution:
04/21/2006 (2:58 pm)
The last beta 2 has this bugI tested the next solution:
Index: D:/jtech/T2D/engine/source/T2D/t2dAnimationController.cc
===================================================================
--- D:/jtech/T2D/engine/source/T2D/t2dAnimationController.cc (revision 58)
+++ D:/jtech/T2D/engine/source/T2D/t2dAnimationController.cc (revision 59)
@@ -398,7 +398,8 @@
mCurrentModTime = mFmod( mCurrentTime, mTotalIntegrationTime );
// Calculate Current Frame.
- mCurrentFrameIndex = mMaxFrameIndex ? (U32)(mCurrentTime / mFrameIntegrationTime) % mMaxFrameIndex : 0;
+ //mCurrentFrameIndex = mMaxFrameIndex ? (U32)(mCurrentTime / mFrameIntegrationTime) % mMaxFrameIndex : 0;
+ mCurrentFrameIndex = (S32)(mCurrentModTime / mFrameIntegrationTime);
// Check Current Frame Index.
#3
04/24/2006 (12:24 am)
I'm getting this same bug too in beta 2. Maybe it'll be fixed for beta 3 which I heard comes out pretty soon.
#4
By the way, I've confirmed the other problem that animations gets slowed when running for a long time.
The problem was that the sceneTime in Debug banner doesn't get increased, so I fixed the below lines and everything was fine. (I've forced the timer not to use performancecounter)
platform32/winWindow.cc
I wonder if QueryPerformanceCounter() doesn't cause any problem which is mentioned in MSDN
04/24/2006 (2:15 am)
Thanks for the help.By the way, I've confirmed the other problem that animations gets slowed when running for a long time.
The problem was that the sceneTime in Debug banner doesn't get increased, so I fixed the below lines and everything was fine. (I've forced the timer not to use performancecounter)
platform32/winWindow.cc
WinTimer()
{
- mUsingPerfCounter = QueryPerformanceFrequency((LARGE_INTEGER *) &mFrequency);
+ mUsingPerfCounter = false;
if(mUsingPerfCounter)
mUsingPerfCounter = QueryPerformanceCounter((LARGE_INTEGER *) &mPerfCountCurrent);
if(!mUsingPerfCounter)
mTickCountCurrent = GetTickCount();
}
U32 getElapsedMS()
{
if(mUsingPerfCounter)
{
QueryPerformanceCounter( (LARGE_INTEGER *) &mPerfCountNext);
U32 elapsed = (U32) (1000.0f * F64(mPerfCountNext - mPerfCountCurrent) / F64(mFrequency));
return elapsed;
}
else
{
mTickCountNext = GetTickCount();
return mTickCountNext - mTickCountCurrent;
}
}I wonder if QueryPerformanceCounter() doesn't cause any problem which is mentioned in MSDN
Quote:
Remarks
On a multiprocessor machine, it should not matter which processor is called. However, you can get different results on different processors due to bugs in the BIOS or the HAL. To specify processor affinity for a thread, use the SetThreadAffinityMask function.
#5
04/24/2006 (6:09 pm)
Yeah i'm getting it too
Torque Owner NEOK
By the way, another possible bug found.
I have my game run for 4 days straight, then t2dAnimatedSprite(animationCycle=true) doesn't get animated for assigned time, rather, it changes each frame after a long period time around 3 second. It happend to the only animation objects existing on the screen for 4 days long, but not to the animations created newly each second.