by OneManClan » Tue Jan 11, 2011 1:14 pm
[DISCLAIMER: I'm still a newb, so the following might be ridiculously naive/unrealistic]
What if you did this:
1. The Server already has the ability to write an mvd during the game. Make it also store (eg) the last 2 seconds into a seperate buffer (which keeps getting written over)
2. Player dies.
3. Server sends the latest 2 second chunk to the client (should be a tiny dl)
4. The client automatically plays the last 2 seconds, at lower framerate (ie slow motion), using some function which selects them as the player to 'view', so they can see the best view of their death. You might even make a option to show the view from the point of view of the entity that killed them, facing the victim. ie see from behind the the rocket/projectile/path of direct fire weapon.
5. After the replay, the clients framerate is reverted to 'normal'.
If you can access the mvd data whlst it's being written, then you might not even need a seperate buffer, just send the last 2 secs of the (currently being written) mvd everytime someone dies. Off the top of my newbie head, I imagine the mvd is constantly being written at a certain rate, so you could calculate what offset is '2 seconds ago', and grab the chunk you need, though Im not sure you can access data from a file that's still being written to, surely it must exist as a 'temp'. (?)
Anyway... possible?