Demo recording, so far..
by Phil Carlisle · in Torque Game Engine · 09/08/2001 (12:05 pm) · 31 replies
Welp, demo recording definitely seems "broken" :)), Ive been messing with the demo recording features of netconnection and its derived classes.
The first (and most obvious) error was that it wasnt creating the resource object for the demo recording file.. this was a simple directory issue (it wont record to the root dir and I was using "test.demo" as my record file).
When I hack some demo recording in, it records and writes the file fine (afaik), but coming to replay the demo, its dying in some part of the bitstream processing functions (its quite obscure where these things are flying round inside the engine, so I'll not try and describe it more).
So, simple question is... Did it EVER work? I mean, could you start recording a demo, stop recording a demo, and play back a demo?
second simple question: what exactly IS a demo? I am assuming its a stream grab of the move event packets. But when I read the strings coming back from the bitstream, it looks like thier doing a lot of mission startup etc. Which kind of makes no sense to me (as your already in a mission when you start to record a demo).
third simple question: what was the demo used for? why was it in the engine? what was its purpose in life? :))
Answers to these, well.. lets see if I cant find some answers myself.
Phil.
The first (and most obvious) error was that it wasnt creating the resource object for the demo recording file.. this was a simple directory issue (it wont record to the root dir and I was using "test.demo" as my record file).
When I hack some demo recording in, it records and writes the file fine (afaik), but coming to replay the demo, its dying in some part of the bitstream processing functions (its quite obscure where these things are flying round inside the engine, so I'll not try and describe it more).
So, simple question is... Did it EVER work? I mean, could you start recording a demo, stop recording a demo, and play back a demo?
second simple question: what exactly IS a demo? I am assuming its a stream grab of the move event packets. But when I read the strings coming back from the bitstream, it looks like thier doing a lot of mission startup etc. Which kind of makes no sense to me (as your already in a mission when you start to record a demo).
third simple question: what was the demo used for? why was it in the engine? what was its purpose in life? :))
Answers to these, well.. lets see if I cant find some answers myself.
Phil.
About the author
Recent Threads
#2
Yeah, I know about the journalling. This is just a nicer place to have what I want. Its not a biggie to do the same thing myself, just wanted to save myself a bit of time.
So the demo recording actually worked BEFORE gg got the T2 is that right?
Phil.
09/08/2001 (3:46 pm)
Hi Harold,Yeah, I know about the journalling. This is just a nicer place to have what I want. Its not a biggie to do the same thing myself, just wanted to save myself a bit of time.
So the demo recording actually worked BEFORE gg got the T2 is that right?
Phil.
#3
09/08/2001 (4:35 pm)
No... the Demo recording wasn't working until after V12 was released. And it still isn't working in an official release patch. Just the beta patches.
#4
On top of Harold's answer to your third question, another reason for demos is to find bugs in your application. If something goes wrong while you are playing a game, you can just replay the demo and debug it.
09/09/2001 (7:34 am)
About your second question, I'm pretty sure that the demo is just a recording of all the events, but right at the beginning of games, all the datablock information is sent to the client, making server side mods possible. This could be what the demo is doing at the beginning, so you can even record games which have modified server settings (don't quote me on this one though).On top of Harold's answer to your third question, another reason for demos is to find bugs in your application. If something goes wrong while you are playing a game, you can just replay the demo and debug it.
#5
09/09/2001 (8:52 am)
Demos are used by clans too. Take demos of the matches from everyone's perspective and look at them to see what went wrong/right. Also, they are nice to have as backup when you tell the story about when you hit a guy you couldn't even see with a rifle shot. (true story on Snowblind...little red triangle dissapeared, a second later I guessed and shot...flag carrier down)
#6
Demo's are essentially recordings of all client and server communication and can therefore only record sessions with a server (which includes your own "loopback" server). Demo's are used to record and playback game sessions. When a demo is started it saves off the current state of the mission objects (including datablocks), and then simply stores all locally generated moves, and remote server events, as they arrive. Demos do not store other local events such as keyboard, mouse or timing events. When they're working, you can start and stop recording on the fly, and pause during playback. Demo playback does not interfere with keyboard or mouse input.
Journals record all events, including mouse motion, timing, keyboard, network events, etc. This is a debugging tool and is useful for tracking down any number of bugs or problems. Journals are not like demos, you cannot stop, pause or play them "on-the-fly". Journals record everything from the time the game starts until it ends. You can theoretically start and stop journals on the fly, but in practice this does not produce a useful journal as input events are very context sensitive. When a journal is being played back all interaction with the engine is disabled, as all external events are being obtained from the journal.
09/09/2001 (10:56 am)
Demo recording was not working in the engine when we got it. Dynamix has subsequently fixed it, but we are a few engine patches behind.Demo's are essentially recordings of all client and server communication and can therefore only record sessions with a server (which includes your own "loopback" server). Demo's are used to record and playback game sessions. When a demo is started it saves off the current state of the mission objects (including datablocks), and then simply stores all locally generated moves, and remote server events, as they arrive. Demos do not store other local events such as keyboard, mouse or timing events. When they're working, you can start and stop recording on the fly, and pause during playback. Demo playback does not interfere with keyboard or mouse input.
Journals record all events, including mouse motion, timing, keyboard, network events, etc. This is a debugging tool and is useful for tracking down any number of bugs or problems. Journals are not like demos, you cannot stop, pause or play them "on-the-fly". Journals record everything from the time the game starts until it ends. You can theoretically start and stop journals on the fly, but in practice this does not produce a useful journal as input events are very context sensitive. When a journal is being played back all interaction with the engine is disabled, as all external events are being obtained from the journal.
#7
So I have another question now, basically for Tim. Do you get engine updates from Sierra for bugs and/or fixes they create for T2 as part of the deal? For instance the demo recording fixes (which, to be honest, wouldnt be a huge amount of work for me to replace with my own, but seems like wasted/duplicated effort on my part).
If theyre not going to be coming up with updates, then I'm clearly going to need to reimplement it (and in some ways I'd prefer to do this so that the code's clearer to me and fits in with my planned use better).
All in all its not THAT far from working, the demo recording seems to be essentially working, even playback seems to start working ok, its probably just misordered or stored some packet information that wasnt relevant or safe to store in the saved demo file.
Anyway, thanks for the feeback guys.
Phil.
09/09/2001 (2:04 pm)
Thanks for the replies guys. It pretty much confirms what I had in mind :))So I have another question now, basically for Tim. Do you get engine updates from Sierra for bugs and/or fixes they create for T2 as part of the deal? For instance the demo recording fixes (which, to be honest, wouldnt be a huge amount of work for me to replace with my own, but seems like wasted/duplicated effort on my part).
If theyre not going to be coming up with updates, then I'm clearly going to need to reimplement it (and in some ways I'd prefer to do this so that the code's clearer to me and fits in with my planned use better).
All in all its not THAT far from working, the demo recording seems to be essentially working, even playback seems to start working ok, its probably just misordered or stored some packet information that wasnt relevant or safe to store in the saved demo file.
Anyway, thanks for the feeback guys.
Phil.
#8
I'm not sure what the issue is with the recorder, but apparently it was a little tricky to fix (some event ordering issue). In any case we'll integrate their fix, so I wouldn't worry about it too much :) Unless you just want to check it out for academic reasons.
09/10/2001 (10:10 am)
We continued to get updates for the first set of major patches, and in turn we've informed them of bugs we've fixed.I'm not sure what the issue is with the recorder, but apparently it was a little tricky to fix (some event ordering issue). In any case we'll integrate their fix, so I wouldn't worry about it too much :) Unless you just want to check it out for academic reasons.
#9
From my brief delving into the code, it was pretty clear that there were some issues with what it saved in the demo files.
I'll have to think on a bit about this.
Thanks Tim.
09/10/2001 (10:19 am)
Maybe I should implement my own alternative version of it just so I have a nice understanding of where its working and where its not.From my brief delving into the code, it was pretty clear that there were some issues with what it saved in the demo files.
I'll have to think on a bit about this.
Thanks Tim.
#10
and has anyone ever tried to inhabit a demo whilst recording another?
sounds fun.
01/10/2002 (10:43 pm)
have you had any luck with the demo recording code Phil ?and has anyone ever tried to inhabit a demo whilst recording another?
sounds fun.
#11
Ive traced through to a certain point, but havent had time to fully debug it. Its obviously just some sort of sequencing issue with some of the record packets being saved in the wrong order (so when theyre replayed there is an error).
I think what I got to was that something was calling a method on an invalid object (so its likely the object hadnt been stored before the method call, or it was an invalid object saved into the rec).
I'll be looking at this more fairly soon.
Phil.
01/11/2002 (1:02 am)
Sam, yeah, the demo recording as it was saves the demo fine, its when it comes to play back that it fails.Ive traced through to a certain point, but havent had time to fully debug it. Its obviously just some sort of sequencing issue with some of the record packets being saved in the wrong order (so when theyre replayed there is an error).
I think what I got to was that something was calling a method on an invalid object (so its likely the object hadnt been stored before the method call, or it was an invalid object saved into the rec).
I'll be looking at this more fairly soon.
Phil.
#12
01/13/2002 (1:52 pm)
If the GG team was going to incorporate Dynamix's demo fixes, what's the status of that?
#13
01/13/2002 (2:07 pm)
oh yeah I noticed in tribes when you record something and then play it back it dosn't show your player in custom skins (if you have any) just default for the level. Anthony
#14
01/25/2002 (9:21 am)
What's the status of this?
#15
02/13/2002 (11:29 pm)
Any news concerning demo recording?
#16
I completely forgot about this. I'll add it as a TCP project. Thanks for the reminder.
Basically, its not working, but not far off.
Phil.
02/14/2002 (1:18 am)
Haha.. thread from the past.I completely forgot about this. I'll add it as a TCP project. Thanks for the reminder.
Basically, its not working, but not far off.
Phil.
#17
03/07/2002 (11:03 am)
Hey, demo recording seems to work now... at least a file is created "fps/recordings/demoXXX.rec" - my dumb question now is: how do I view/play them in the engine?
#18
Playing them is a whole 'nother story starting with: "A long time ago, in a Galaxy far, far away... demos don't playback."
03/07/2002 (11:31 am)
Demo recording has worked for a while.Playing them is a whole 'nother story starting with: "A long time ago, in a Galaxy far, far away... demos don't playback."
#19
I'm fairly sure that the code in there WILL work with some relatively minor changes, but figuring out HOW the engine works well enough to be able to spot the erroneous data was beyond me at the time (and to be fair, probably still is).
Phil.
03/07/2002 (11:45 am)
From what I learnt while i was trying it out, the issue with playback is some slight discrepancy in the data stored (for instance it fails to store an ID that it later uses to name an object to move).I'm fairly sure that the code in there WILL work with some relatively minor changes, but figuring out HOW the engine works well enough to be able to spot the erroneous data was beyond me at the time (and to be fair, probably still is).
Phil.
#20
03/07/2002 (12:32 pm)
how do you record the demos? what is the commands. I would like to mess with this some.
Torque Owner Harold "LabRat" Brown
Why was it there - For people to show of their 1337 skills.
Other alternatives - Look at journaling