
(Save the killcams to file and watch them later? It is very good for server admins=]) What if you’re optimizing very hardly, and you simply don’t send info about the player movement if they can’t see each other? It can have many reasons why it should be on the server. Programmatically i don’t see any difference? Record -> Replay. Remember that this is about showing the kill from the killer’s perspective, not about replaying the last few seconds of the player’s death. But it wouldn’t surprise me since COD has an endless list of in-game “bugs” D That would be very, very, very interesting. I think Source engine works that way… possibly Unreal too, it’s been a while since I’ve looked at the player replication code.Ī thought just occurred to me, isn’t CoD using peer to peer networking? Some games store the player’s previous positions and rotations for a set period of time, so that they can rewind time a few seconds for latency compensation purposes. So when a request to playback the replay comes in, they restore the game state to the closest fully serialized frame, and then play back all the state change messages at the appropriate time.Īlternatively, I guess you could just store all the network messages over a set period of time and reverse their effect, then play them back again. Messages like “this guy threw a grenade”, “the grenade exploded”, “this guy took damage”, etc. If I had to guess, they probably serialize the game state periodically, and then store network messages that change the state of the game for actors that they care about, until the next serializable frame. I think it’s more likely that they store a history of the game for a set length of time, as your client saw it, and then play it back client-side. I could be wrong, but personally I think it’s unlikely that a replay comes from the server, as that’s not a very elegant way to implement it. Then to play it back just send the frames to the client one by one. It will eat out some memory but you can skip some frames if you need.

If(Frames.Time < CurrentTime) // Check if our first frame is old enoughįrames.RemoveAt(0) // delete the old frame If not, then the code should look something like this:įFRame Frame //Frame is a snapshot of player positions / movementsįrame.Time = CurrentTime+15 // Set the expiration for 15 seconds.
To play back a previously recorded game, use the console command “DemoPlay
If the player dies play it back to the client.Īlso the recording should be server side, to avoid unnecessary network packets.ĭemo recording works automatically with any Unreal Engine game that is networking-enabled. To make a KillCam is simply record everything what is happening on the server.
