I know that Doom (1993 edition) supported the ability to record and play back states. They actually accomplished this through a quirk in the random number generator. The game didn’t seed the RNG, so the number sequence would always be the same. The main “randomness” was caused by different things calling the RNG at different times as the monsters continued to react to the player. As such, Doom could just record the player inputs and then play them back through the engine.
Of course, RNG in most games (including yours, likely) have more complex mechanics, so I would rather follow something like @pspeed
’s suggestion and rely on recording the current state of the game (enemy positions, current actions, etc), and just inputing them through the game engine. Of course, the feasibility of this depends on your code. While this could be fairly easy on a standard client-server architecture (just redirect the client to look at the playback stream), it could be harder on others.