Skip to content
This repository has been archived by the owner on Dec 12, 2022. It is now read-only.

How are demos recorded into a file? #52

Answered by nulano
PK268 asked this question in Q&A
Discussion options

You must be logged in to vote

I do not know the exact details as it's been a while since I've looked into it, but in essence:

Demos contain per-tick camera coordinates (Source games always run a server, even in single player, with about 60 ticks per second, exact number depends on game IIRC; also sv_alternateticks affects this).

Smooth camera movement at high FPS is achieved by interpolating the camera position between server ticks, and also computing the orientation on the client to react to mouse movement instantly - fast mouse movements are removed from the demo recording.

A demo file also contains all of the network traffic from the server, so that replaying a demo is as simple as "connecting to it" as if it were …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@PK268
Comment options

Answer selected by PK268
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants