Version 9.0 Migration Notes
SnapNet for Unreal Engine version 9.0 focuses on removing the need to pre-register maps/scenes, replacing the underlying protocol to provide multiple congestion control algorithms for transmitting larger payloads reliably, and a new network simulator which more closely reflects real-world behaviors including the ability to control the probability of packet reorderings. The major developer-facing changes are as follows:
- The payload passed to USnapNetTransport::Send() is now const
- The following are deprecated as they’re no longer required:
- USnapNetSettings::Maps
- USnapNetSubsystem::RegisterMap()
- USnapNetSubsystem::RegisterMaps()
- USnapNetSubsystem::UnregisterAllMaps()
New Protocol
A new underlying protocol has been implemented for performing connection-oriented reliable and unreliable data transfer.
Warning
We plan to remove the previous protocol in the future. If you find your project requires the below setting enabled, please reach out to us as soon as possible.The new protocol is enabled by default but should you experience any issues you can temporarily switch back to the previous protocol by enabling the setting found under Project Settings → SnapNet → Common → Debug → Legacy Protocol.
Congestion Control
The new protocol supports two different congestion control algorithms for sending large payloads reliably:
- BBR (Bottleneck Bandwidth and Round-trip propagation time)
- Reno
BBR is the default congestion control algorithm. Although it is newer and less widely used than the Reno algorithm, it is a better fit for games as it’s designed to saturate bandwidth without bloating buffers and inflating your round-trip latency. If you encounter issues, you can try switching from BBR to Reno using the option found under Project Settings → SnapNet → Common → Advanced → Congestion Control.
Reliable Messages
The new protocol allows bandwidth-efficient transmission of much larger payloads. There are a few different settings that have been added for customization, all of which are available under Project Settings → SnapNet → Common → Advanced:
Max Reliable Message Size
The maximum size a reliable message can be, in bytes. In prior versions, this was limited to a maximum of 8 KB, but can now be as large as your configured Max Packet Size. It defaults to 8 KB so that the existing behavior is unchanged.
Warning
If larger reliable messages are needed and this value is raised, consider reducing Max Queued Reliable Messages to minimize the required memory.Max Queued Reliable Messages
The maximum number of outgoing reliable messages that can be queued awaiting acknowledgement at any given time. On servers, this is per-client. Attempts to send reliable messages while the maximum number are pending acknowledgement will fail. Defaults to 32.
Max Reliable Receive Buffer Size
The maximum size of the receive buffer for reliable data, in bytes. The receive buffer is used for reassembling data when it arrives out of order. The size bounds the maximum achievable bandwidth assuming some packet loss occurs and should be based on the BDP (bandwidth-delay product) of your target connection:
MaxReliableReceiveBufferSize = BDP = BytesPerSecond * RoundTripTimeInSeconds
The default is 512 KB which could achieve ~40 Mbps assuming 100ms of latency.
Packet Reorder Probability
The previous network simulator would cause increasingly extreme packet reordering as the configured jitter was raised beyond the send rate. In real-world conditions, jitter rarely causes reordering because jitter is typically the result of queue delay within FIFO buffers. The new network simulator allows developers to simulate a realistic rate of packet reordering. This option can be found under Project Settings → SnapNet → Client → Network Simulation → Packet Reorder Probability and is set to 2% by default.