

.REPLAY PLAYER DRIVER
The DemoNetDriver is a specialized network driver that passes replicated data to Streamers, which record the information for later playback. Setting this variable to true causes dedicated servers to record games automatically. A value of 1.0 is normal speed.ĪGameMode::bHandleDedicatedServerReplays (variable) Speeds up or slows down playback by setting the time-scaling factor. WorldSettings->DemoPlayTimeDilation (variable) The "demopause" console command will automatically set or clear that variable. Setting it back to null will resume the replay. Setting Pauser to that value will pause the replay. The World's DemoNetDriver->ServerConnection has an OwningActor variable. Jumps to the provided time (in seconds) in the replay. If the (ReplayName) parameter is not supplied, the replay system can generate a name on its own. The Replay system can be used from C++ code, mainly via the UGameInstance and UWorld classes, or with console commands or command-line arguments.īegins recording a replay. More advanced usage of the system can include adding text tags (usually meta tags or the names of players involved in the game) to a replay, or querying existing replays based on text tags or version information present. While in playback mode, the Replay system supports commands to pause, change the playback speed, or jump to a specific point in time. The basic functions of the replay system are to start or stop recording a demo, or play back a previously-recorded demo. When viewing a replay, a DemoNetDriver will have access to all of the replicated information that was available during live play (as well as special data fields designated as relevant only to replays) so that it can reconstruct the events of the game from this data. The way this works involves the DemoNetDriver passing network data to a Replay Streamer, which handles the process of filtering and storing the data. Even if a project doesn't have a multiplayer mode, any project set up to replicate data is compatible with the Replay System without the need for further modification.

At a high level, the Replay system works by using a DemoNetDriver to read data drawn from the built-in replication system, similar to how a NetDriver operates in a live, networked gameplay environment. Unreal Engine 4 (UE4) features a Replay system which can record gameplay for later viewing. This feature is available in all games, from live, multiplayer games played on dedicated servers, to single-player games, and even including Play-In-Editor sessions.
