Conceptually, how does replay work in a game?
        Posted  
        
            by SnOrfus
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by SnOrfus
        
        
        
        Published on 2010-06-17T18:07:54Z
        Indexed on 
            2010/06/17
            18:13 UTC
        
        
        Read the original article
        Hit count: 271
        
design-patterns
|game-development
I was kind of curious as to how replay might be implemented in a game.
Initially, I thought that there would be just a command list of every player/ai action that was taken in the game, and it then 're-plays' the game and lets the engine render as usual. However, I have looked at replays in FPS/RTS games, and upon careful inspection even things like the particles and graphical/audible glitches are consistent (and those glitches are generally *in*consistent).
So How does this happen. In fixed camera angle games I though it might just write every frame of the whole scene to a stream that gets stored and then just replays the stream back, but that doesn't seem like enough for games that allow you to pause and move the camera around. You'd have to store the locations of everything in the scene at all points in time (No?). So for things like particles, that's a lot of data to push which seems like a significant draw on the game's performance whilst playing.
© Stack Overflow or respective owner