Is it possible to record a game without having to store too much memory to record the game in the game?
I want to allow the user to save that game as some type of video file, if possible?
// Edit - Things are easier for more architecture / ideas / that the user can use the app to change the texture within a pre-animated view and when they are done Can export it to the video.
Thanks
Is your game deterministic? If so, you should be able to record user input. Then you just play the game to play it back and provide the recorded input instead of the live input.
Depending on the type of game, the toughest part will make it deterministic. You have to capture all the seeds at the random number generator and how many times you have got from the generator so that you get the same results. Since we are talking about a core, you do not need to worry a lot about the order of evaluation which is good, but make sure it is well defined.
Second, if you setup an MVC (Model View Controller) then you only have one playback controller and a live user controller that records timestamped input as needed. Note: How you do it, it can be easy to use frame count instead of a real time. When the player records the record, then collect the game's entire position, and the player starts capturing the input.
To export the video, what you have to do is load the initial state playback in one frame, capture the frame and iterate over the entire playback record. If you have a game that is based on time, then you have to be bored with the clock so that the time spent capturing video is taken out. Alternatively, you can record time-based events with the count of frames, so that it is on the right frame, but then you have to make sure that different processing orders do not change the game.
Another option is to go through incident-based, just record each incident occurring in the game, while during playback only trigger those incidents that happened originally during those frames. You need to get more data for this because you do not have to simulate everything to use the game (you still need the animation and this way), but the render time can be improved because you can play the whole game Are not running.
Comments
Post a Comment