Console Commands

Learn useful console commands when developing with SnapNet

Debugging

ConnectSnapNetClient [Url]

Like Unreal’s native open command, this can be used to connect a client to a server that’s already running. It is useful most often during development when trying to connect two machines that are playing in editor or manually connecting to a development server for quick testing.

stat SnapNet

This command toggles the display of SnapNet statistics and graphs:

Screenshot showing SnapNet's network graphs and statistics

Latency: The average round-trip time from the client to the server and back, in milliseconds.

Jitter Buffer: The amount of additional buffering required to reliably compensate for network jitter, in milliseconds.

Jitter: The standard deviation of round-trip times from the average i.e., the variation in packet delivery times, in milliseconds.

Packet Loss: The percentage of packets that are being dropped by the network.

Bandwidth Down: The average number of bits received from the server per second, in kilobits per second.

Bandwidth Up: The average number of bits sent to the server per second, in kilobits per second.

Inputs Buffered: The number of frames of input the server has buffered for the client. A negative number indicates the number of frames the server advanced the simulation without valid input from the client.

Input Delay Frames: The number of frames between when the local player’s input is sampled and when that input is simulated.

Predicted Frames: The number of frames simulated ahead of the most recent authoritative state from the server.

Simulation Time Scale: The rate at which the client simulation is being ticked relative to normal in order to keep the client and server in sync.

SnapNet.RenderSource [SourceNumber]

Controls which simulation is used to feed the renderer actors. Valid values are as follows:

0: No entities will be rendered.

1 (default): Entities will be rendered using the client simulation.

2: Entities will be rendered using the server simulation.

This is a useful mechanism for investigating divergent behavior on either the client or server. Note that when rendering using the server simulation there will be no interpolation so there may be jitter due to mismatches between simulation rate and render rate.

Packet Captures

The following console commands control packet capture. For more details, see the Packet Captures page.

StartSnapNetPacketCapture

Begins writing a packet capture file into the project’s Saved/PacketCaptures folder. Note that this console command will only function if the server is being run locally.

StopSnapNetPacketCapture

Stops writing the packet capture file.

Replays

The following console commands control replay recording and playback. For more details, see the Full Match Replays page.

SaveSnapNetReplay [Name]

Saves a SnapNet replay file with the specified name. An extension of .rpl will be appended and the file will be placed in the project’s Saved/Replays folder. Note that this console command will only function if the server is being run locally.

PlaySnapNetReplay [Name]

Plays a SnapNet replay file with the specified name. It will automatically load the file and begin to play provided it is present in the Saved/Replays folder with a .rpl extension.

SpectateSnapNetReplay [PlayerIndex]

Spectates the currently playing replay from the perspective of the player index specified. If the player index is valid, SnapNet will automatically apply lag compensation so that the world is shown just as the specified player saw it during the original recording. In genres like shooters, this ensures that if the player had an enemy in their crosshairs that it still lines up as they saw it when later spectating their view in the replay.

SeekSnapNetReplay [TimestampMs]

Sets the playback position of the replay to the specified timestamp, in milliseconds, where 0 is the beginning of the replay file.