Game Development Community

Slow motion

by Max Thomas · in Torque Game Engine · 09/11/2004 (9:32 am) · 12 replies

I was wondering if anyone knew how to do slow motion in torque. I want it to go into slow motion when the right mouse button is pressed and go into normal speed when it is pressed again.

Thanx, Max

#1
09/11/2004 (9:45 am)
There is a global variable that controls timescale. $Sim::timeScale? Something like that. If you examine the variables registered with script, you should find it fairly easily. Tweak that to control the speed at which time goes by.
#2
09/11/2004 (9:51 am)
Note that this will only effect things based on the Sim timescale. It will not slow down sounds, sounds are processed on a different timescale. All things related to Simulation get processed at 32ms intervals (Ben confirm that?), things, such as sound, get processed every frame.
#3
09/11/2004 (11:25 am)
I believe it is just $timeScale.

Another artifact of using this is mouse control. The time between actual mouse position sampling is slowed but no scaling is done on the actual value of mouse movement. The result (which gets worse the slower you go) is looking around (using the mouse) happens in pulses, but you can do a 360 turn in one pulse as easily as you can when timeScale isn't changed. So depending on your desired effect you might want to scale down the mouse x/y axes input value accordingly.
#4
09/11/2004 (11:03 pm)
As of 12:25 am, Sunday the 12th of September, reliable sources report that Ben Garney has confirmed the 32ms granularity of Torque simulation.

There is a bit of work to do to get this time scale effect working perfectly, but the nice thing is it's largely working out of the box. A bullet time resource would go over very well. :)
#5
05/16/2005 (2:44 am)
Anyone have an idea on where to start to get the sounds to slow down too?

Nick
#6
05/16/2005 (3:32 am)
The audio directory. I believe there's a main loop that updates audio playback - you might be able to apply a pitch shift effect based on the timescale.
#7
05/16/2005 (3:33 am)
BTW, it's good forum etiquette not to revive posts over a year old. Better to start a new thread and link to the old one, ie, "I saw __this_thread__ and was wondering..."
#8
05/16/2005 (3:38 am)
Thanks Ben. 7 months actually:)
#9
05/16/2005 (5:53 am)
Since this is already is revived, I might add that slowing down the sound wouldn't be something that you want to do in realtime in a game. If you are looking for a bullet time effect, I'd recommend to 'rescale' the sounds with appropriate audio software and load them additionally, plus bridging the de-acceleration and acceleration with some special sound effect.
#10
05/16/2005 (6:07 am)
I was thinking of using it when a character receives a big blow. Like in Call of Duty, when a bomb explodes near you, there is some kind of effect where everything seems slower as well as the sounds for a few seconds. Don't remember exactly, I might have to replay it to see how it's done.

Now that I think of it, what you're saying is probably doable. For example, during the slow down time, you can set a global variable and swap monster roar sounds and other sound effects with their slower equivalent. But can that be done in realtime?

Nick
#11
05/16/2005 (6:12 am)
I would recommend the method above because for dramaturgical effect the sounds even can be different. In other words the people expect to hear a lower sound - it doesn't have to be the same sound, it just has to sound like it :-). So for suspense reasons you might even want to alter them for effect.
#12
05/16/2005 (6:18 am)
Thanks, sounds like a plan.