Game Development Community

Recording a demo

by Hanton Yang · in Technical Issues · 09/22/2008 (1:35 am) · 3 replies

Do anybody has used the
startRecording(filename)
stopRecording
isDemoPlaying
isDemoRecording
playDemo
function to record a demo

Could you give some example code?

About the author


#1
10/02/2008 (4:11 pm)
The recording system hasn't worked for a while, its a shame
#2
10/03/2008 (7:48 am)
Hi,

I just tested everything and demo/journal recording works great in TGE 1.5.1 (and, I assume 1.5.2 as well).

Unfortunately, in TGEA 1.7.1, the recording/playback system has been disabled in script. I spent some time last night tracking down the problem. The start and stop recording functionality still saves out a demo###.rec file to the tools/recordings folder in the Stronghold mission (I didn't try it in the T3D project). However, the "Recordings" button on mainMenuGui.gui doesn't do anything when clicked. The command code on the button is valid, but the necessary script and gui haven't been enabled.

You can get things working again by going into stronghold/game/scriptsAndAssets/client/init.cs and adding the following exec references at line 106 (near the middle of the initClient() function . . .

exec("./ui/RecordingsDlg.gui");
exec("./scripts/recordings.cs");

Of course you'll want to make sure that those two files are in the right folders for Torque to find them (or change the path names in the script ref), but once you've done that, and saved your changes, TGEA 1.7.1 should now allow you to engage in all kinds of demo recording and playback shenanigans.

However, even after the basic journaling functionality has been restored in TGEA, particle effects seem to be having problems on playback. In 1.7.1, projectile particle trails don't show up in the recorded demos (which is a bit annoying).

But the big problem is that particle effects generated from projectile impacts actually crash the game during playback. My guess is that the crashing behavior is why the system was originally disabled by Garage Games.

I tracked the particle crash to ParticleData(CrossbowExplosionFire) in crossbow.cs, but any particle data called from a particle emitter will probably cause the engine to crash at that point in the demo playback.

Of course, a workaround would be to use billboarded dts shapes for all your collision 'particles', but that would be a poor solution.

I haven't gotten around to finding out how to fix the particle rendering and particle crashing problems for recorded demos/journals in TGEA. Eventually, I may dig deeper into the problem, but this post should be a good starting point for anyone wanting to track it down and fix it. The ultimate solution will probably require C++ engine changes in one or more places. Just looking through the cpp and h files reveals that demo recording checks get performed in a lot of different places, so it might take a while to find the problem code.

I apologize for rambling. I hope this information is helpful in some way.

[Edit: added new information, clarified some of the details and fixed a few typos]
#3
10/03/2008 (7:53 am)
Very nice information, Aaron!