Fight Replays
Jaxx86
Member Posts: 26
I think it would be great if the game included a replay feature that eliminated the pauses, so that we could take a moment to reflect back on an epic battle. This can include a start and stop time feature where you could look at the replay out of game later. It would be a nice way to analyze difficult battles or share them with your friends.
12
Comments
But what I'd also like is a program that keeps the last 30 seconds of game in video stored somewhere. Sometimes, epics prowess happens with no warnings ^^ and then you really want to see it again.
@Jaxx86 http://forum.baldursgate.com/discussion/205/post-ship-features-what-would-you-like/p1
In theory...the recorder would duplicate everything on screen, then simply stop recording when the pause value was true. Only one variable really would need to be shared. It could even be an external application..........again, in theory
Alternatively, you could simply store the entire state of the simulation each frame, but that would likely be prohibitively expensive in terms of memory.
So, that seems simple, but it requires that in the engine:
- nothing happens in the simulation that isn't issued through a time-stamped command
- every command has a deterministic effect - if a random number generator is used for simulating dice rolls, for instance, it has to produce the same sequence of random numbers every time
Implementing multiplayer usually entails the same requirements (not necessarily though), so there's hope that the IE is already designed this way. But if it's not the case, then the entire simulation code would need to be re-designed and re-written.
[
Frame: 26901
Command: Move
Unit IDs: 1, 2, 3, 4, 5
Location: x=345 y=567
]
with the unit IDs being some unique identifier for each of the footmen. The command gets executed on frame 26901 (the game updates at 30 frames per second, so that commands happens at roughly 15 minutes in). The engine takes care of executing the command: calculating the path for each of footmen and updating their position until the command is done. The engine is very carefully designed so that the result of executing that command is entirely deterministic: this allows for multiplayer synchronization and for easy replay functionality: the only thing that needs to be exchanged between machines (for multiplayer) or stored to disk (for replays) are the commands; the state of the simulation is computed on each frame from the state of the previous frame + the ongoing and new commands, and the engine makes it so a given set of commands always produce the same end result.
So in the end a replay is just a list of commands issued by the players, every order they give, everything they do that has an actual effect on the simulation, i.e. selecting a unit wouldn't be saved, but moving a unit would. As SC2 shows even the fastest players only issue around 100 actual commands per minute (total APM takes into account UI actions that don't do anything like selecting/deselecting etc), and each command can be stored using only a few bytes, so replay files can be incredibly compact. Quick calculation: 50 bytes per command * 100 commands / minute * 20 minutes * 2 players = 200KB. That's about the size of a typical replay file.
If you're interested here's a very good article on how multiplayer was done for AOE: the same basic ideas apply for implementing replays. http://www.gamasutra.com/view/feature/3094/1500_archers_on_a_288_network_.php
For fast forward all you do is increase the update rate of the simulation. For moving backwards that's very touchy; I believe W3 was the first game to implement that. I suppose what they do is do a full state save at certain points in time (notice how the slider will only let you go back at specific points in time); when you request moving back in time, the state is restored from that point and execution resumes as normal. So the simulation never actually executes in reverse, it's just a fancy save/reload hack.