smashthewindow Posted December 21, 2011 Share Posted December 21, 2011 Does anyone know how the demo recording system in Source engine is done? I would like to implement something similar in my game, but I am absolutely clueless on how to do this. My initial thought is to save the absolute positions of every entity per frame into an XML file and then move every entity accordingly during demo replay. But my current solution would probably end up with giant XML files and game crashing when trying to load the XML file. (I currently use TinyXML as my XML library.). Thanks. Quote Blog & Portfolio Current project: moon.chase.star Link to comment Share on other sites More sharing options...
Naughty Alien Posted December 21, 2011 Share Posted December 21, 2011 ..what would be exactly 'demo recording system' ? Cut scene system or replay system for certain actions or..? Quote Link to comment Share on other sites More sharing options...
smashthewindow Posted December 21, 2011 Author Share Posted December 21, 2011 ..what would be exactly 'demo recording system' ? Cut scene system or replay system for certain actions or..? https://developer.valvesoftware.com/wiki/Demo_file https://developer.valvesoftware.com/wiki/Demo_Recording_Tools It's mainly used to create high-quality game recordings (export to picture frame by frame, edit by something like virtualdub). I need something like this. Quote Blog & Portfolio Current project: moon.chase.star Link to comment Share on other sites More sharing options...
Naughty Alien Posted December 21, 2011 Share Posted December 21, 2011 ..this can be done rather easy actually..only thing you have to save is time related to certain animation, first frame of that animation at the moment capture started, and time when animation changed to some other animation/corresponding frame..this data should be enough to be able to recreate complete and 100% identical events during gameplay and its not heavy at all as you capturing only changing states at specific time...this also considering that you controling your animations per frame/time and not as it is by default in LE. Quote Link to comment Share on other sites More sharing options...
smashthewindow Posted December 21, 2011 Author Share Posted December 21, 2011 ..this can be done rather easy actually..only thing you have to save is time related to certain animation, first frame of that animation at the moment capture started, and time when animation changed to some other animation/corresponding frame..this data should be enough to be able to recreate complete and 100% identical events during gameplay and its not heavy at all as you capturing only changing states at specific time...this also considering that you controling your animations per frame/time and not as it is by default in LE. And how are you recording entity positions? Quote Blog & Portfolio Current project: moon.chase.star Link to comment Share on other sites More sharing options...
Naughty Alien Posted December 21, 2011 Share Posted December 21, 2011 ..positions should be stored in similar fashion..long as direction vector is not changed, motion is in function of time you recording already..once direction vector is changed, you have to save it with new time start, until its changed again..on that way you will end up with rather small file size and it will be rather easy to reconstruct everything from this very few parameters.. Quote Link to comment Share on other sites More sharing options...
smashthewindow Posted December 21, 2011 Author Share Posted December 21, 2011 ..positions should be stored in similar fashion..long as direction vector is not changed, motion is in function of time you recording already..once direction vector is changed, you have to save it with new time start, until its changed again..on that way you will end up with rather small file size and it will be rather easy to reconstruct everything from this very few parameters.. Ok, I can give that a try. Thanks for the reply. Quote Blog & Portfolio Current project: moon.chase.star Link to comment Share on other sites More sharing options...
Naughty Alien Posted December 21, 2011 Share Posted December 21, 2011 ..you are welcome..let us know how it progress, its rather interesting thing to do actually.. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.