Slow Motion Heeeelp Meeeeeee
by Kevin James · in Torque Game Builder · 04/22/2005 (9:58 am) · 8 replies
In my Strategery game, something very strange started to happen after I updated to 1.0.2. After each click of "Reset Game" the action gets slower and slower. And its everything that slows down.. movement, animation, particle effects, the works. With each click it slows down even more.
I vaguely remember someone somewhere talked about a "slowmotion" feature in T2D. That sounds cool, but honestly, I'm not invoking any slowmotion commands in my script. Once I fix this problem, I think I'll add a "Slow-Mo" button because it looks pretty neat, but for now I would like it to behave :-)
I vaguely remember someone somewhere talked about a "slowmotion" feature in T2D. That sounds cool, but honestly, I'm not invoking any slowmotion commands in my script. Once I fix this problem, I think I'll add a "Slow-Mo" button because it looks pretty neat, but for now I would like it to behave :-)
About the author
Computer security, digital forensics, and platform jumper enthusiast. shells.myw3b.net/~syreal/
#2
04/22/2005 (10:17 am)
Thanks for the tip, King Tut, I'll look into resetting that manually. Although, the fact that I'm not touching it in the first place leads me to believe this is a new bug in 1.0.2
#3
04/22/2005 (10:28 am)
Yeah your right, not sure why exactly =/ you using D3D or OpenGL ?
#5
Next, I predict you'll want to see this:
The reset button sends a null %msg to scenePauseToggle if its already paused, but it slows down even when its not paused.
04/22/2005 (10:36 am)
function ResetGameBoard()
{
if ( $playerScore > $pref::Player::HighScore )
$pref::Player::HighScore = $playerScore;
if (!$ScenePauseFlag) {
// EndGameLose();
}
else {
scenePauseToggle();
}
for (%col=0;%col<$Cols;%col++){
for(%row=0;%row<$Rows;%row++){
DeleteGuy($team1Guy[%col,%row]);
DeleteGuy($team2Guy[%col,%row]);
}//for
}//for
StartUpGame();
}Next, I predict you'll want to see this:
function scenePauseToggle(%msg)
{
$ScenePauseFlag = !$ScenePauseFlag;
t2DSceneGraph.setScenePause( $ScenePauseFlag );
%msg.setEnabled( $ScenePauseFlag );
if (!$ScenePauseFlag){
YouWinMessage.setEnabled( false );
YouLoseMessage.setEnabled( false );
if (%msg==scenePauseMessage){
MoveAllRows(true);
}
}
else if (IsObject(%msg)){
t2dSceneGraph.setLayerDrawOrder(%msg,"FRONT");
//echo("here");
}
}The reset button sends a null %msg to scenePauseToggle if its already paused, but it slows down even when its not paused.
#6
04/22/2005 (10:51 am)
I added $timescale=1, trying to force a timescale reset each time the board is reset, but that has no affect.
#7
04/22/2005 (10:55 am)
Console output regarding my display:Video Init: Accelerated OpenGL display device detected. Accelerated D3D device detected. Voodoo 2 display device not detected. Activating the OpenGL display device... Activating the OpenGL display device... Setting screen mode to 800x600x32 (w)... Creating a new window... Acquiring a new device context... Pixel format set: 32 color bits, 24 depth bits, 8 stencil bits Creating a new rendering context... Making the new rendering context current... OpenGL driver information: Vendor: NVIDIA Corporation Renderer: RIVA TNT2/AGP/SSE2 Version: 1.2.2 OpenGL Init: Enabled Extensions ARB_multitexture (Max Texture Units: 2) EXT_compiled_vertex_array EXT_texture_env_combine EXT_packed_pixels EXT_fog_coord (ARB|EXT)_texture_env_add WGL_EXT_swap_control OpenGL Init: Disabled Extensions EXT_paletted_texture NV_vertex_array_range ARB_texture_compression EXT_texture_compression_s3tc 3DFX_texture_compression_FXT1 EXT_texture_filter_anisotropic NPatch tessellation
#8
Why did it work under 1.0.1 and not 1.0.2, only Melv knows... Dang it! I was sure I found a bug! Feel free to move this from "Report Bugs" to "T2D Scripting" if that's appropriate.
04/22/2005 (11:07 am)
Ok, I was calling the CreateTileMap() function from StartupGame() with every "Reset Game" click, that was causing the slowdown.function CreateTileMap()
{
//Create tile-map.
%battlemap =new fxTileMap2D(){scenegraph =t2dSceneGraph;};
//Load saved tile-map file.
%battlemap.loadTileMap("~/client/maps/battleground.map");
//Load tile layer from tile-map
%battleground =%battleMap.getTileLayer(0 );
%battleground.setPosition("0 3");
}Why did it work under 1.0.1 and not 1.0.2, only Melv knows... Dang it! I was sure I found a bug! Feel free to move this from "Report Bugs" to "T2D Scripting" if that's appropriate.
Torque 3D Owner Matthew Langley
Torque
the slow motion feature