Saving/Playing Input
by Mark J A Smith · in Torque Game Builder · 05/12/2005 (2:07 pm) · 7 replies
Hi, I remember seeing something (document, forum post, can't remember) a few days back about a command line switch that would allow you to save/playback input with T2D.
I'm quite interested in trying this out, but couldn't manage to locate the information.
It was along the lines of "T2D.exe -save filename" I think.
Thanks in advance!
I'm quite interested in trying this out, but couldn't manage to locate the information.
It was along the lines of "T2D.exe -save filename" I think.
Thanks in advance!
#2
05/12/2005 (2:32 pm)
Holy cow, does this work with T2D? I've gotta try it. :)
#3
One more question - I notice that when playing back the input, it plays back at 2 or more times the regular speed - is this normal?
Also, is there documentation somewhere that describes this, or should I just dig into the source?
05/12/2005 (2:35 pm)
Thank you kindly - that works swimmingly!One more question - I notice that when playing back the input, it plays back at 2 or more times the regular speed - is this normal?
Also, is there documentation somewhere that describes this, or should I just dig into the source?
#4
So instead of calling various functions directly, you could schedule them with the timer set as the amount of time between the previous keypress and the one you're about to process.
05/12/2005 (2:58 pm)
I've never used it, so I don't know how it should work (or what gets recorded). I guess it's being read back and processed as fast as possible. You might need to artifically slow it down. Maybe recording the time difference between key presses and then processing that when you read the file back would work.So instead of calling various functions directly, you could schedule them with the timer set as the amount of time between the previous keypress and the one you're about to process.
#5
05/12/2005 (4:19 pm)
Hmm, it should play back at the same speed, haven't tested journaling under T2D, but with TGE, I've only seen the speed go wacky when using a journal recorded under Release build with a Debug build and vice versa, if memory serves me well
#6
However, after some scrutiny, it has become apparent that the replay is indeed playing at the correct speed, except for the player movement. The player is moving at double the regular speed. I'm using the script code from the tutorial that ships with T2D, so am not sure if the movement code there is possibly conflicting with the way that replays work.
I'll dig into the C++ source tonight and see if I can figure out what is happening.
It would be in my best interest to also mention that my player and enemy bullets, and enemy bullets are all running at the proper speed.
Any thoughts?
05/12/2005 (4:30 pm)
Well, that's definitely not the case here - I'm using the Release build for all saving and playing.However, after some scrutiny, it has become apparent that the replay is indeed playing at the correct speed, except for the player movement. The player is moving at double the regular speed. I'm using the script code from the tutorial that ships with T2D, so am not sure if the movement code there is possibly conflicting with the way that replays work.
I'll dig into the C++ source tonight and see if I can figure out what is happening.
It would be in my best interest to also mention that my player and enemy bullets, and enemy bullets are all running at the proper speed.
Any thoughts?
#7
Everything in the engine happens as a result of events. Even the standard physics frame-loop stuff only happens because the system generates a "time elapsed event" every frame.
The journal is simply a linear record of all events that happened. Input events, "time elapsed events", etc. Given such data, and starting from the same initial conditions (ie, you don't suddenly change how your GUI's or scripts work between runnings), it can recreate exactly what happened during the recorded run. It won't let you go backwards and forwards through time, but it will let you see a recording of what happened.
05/12/2005 (5:22 pm)
Quote:I've never used it, so I don't know how it should work (or what gets recorded).
Everything in the engine happens as a result of events. Even the standard physics frame-loop stuff only happens because the system generates a "time elapsed event" every frame.
The journal is simply a linear record of all events that happened. Input events, "time elapsed events", etc. Given such data, and starting from the same initial conditions (ie, you don't suddenly change how your GUI's or scripts work between runnings), it can recreate exactly what happened during the recorded run. It won't let you go backwards and forwards through time, but it will let you see a recording of what happened.
Torque Owner Philip Mansfield
Default Studio Name
-jSave
-jPlay
-jDebug