Record & Replay Utility

Started by
1 comment, last by Hodgman 15 years, 2 months ago
Hi; I have developed first person shotter game. now i want to add record and replay feature in it. Can anybody let me the technique or utility other than saving states/events in file and playback in the same sequence for record and replay. Thanks in advance
Advertisement
You should take a look at the Command Design Pattern. If all of the actions of your engine are encapsulated in a generic command class, you can store the commands and replay them in the same order later.
Your simulation needs to be deterministic for starters. Then every frame you need to record the inputs into the simulation (e.g. key-presses, delta-time values, etc...).
Then when you want to replay, use the recorded inputs instead of actual inputs (instead of getting delta-time from a timer and key-presses from the user, just read them out of the replay file).

Check out the article "1500 archers..." for more info.

[EDIT]

Or if you just want to record a video of the gameplay, check out "YouTube Integration In Games".

This topic is closed to new replies.

Advertisement