@@ -145,7 +145,7 @@ private enum State
145145
146146 // Maximum reliable throughput, assuming the full reliable window can be sent on every
147147 // frame at 60 FPS. This will be a large over-estimation in any realistic scenario.
148- private const int k_MaxReliableThroughput = ( NetworkParameterConstants . MTU * 32 * 60 ) / 1000 ; // bytes per millisecond
148+ private const int k_MaxReliableThroughput = ( NetworkParameterConstants . MTU * 64 * 60 ) / 1000 ; // bytes per millisecond
149149
150150 private static ConnectionAddressData s_DefaultConnectionAddressData = new ConnectionAddressData { Address = "127.0.0.1" , Port = 7777 , ServerListenAddress = string . Empty } ;
151151
@@ -1175,17 +1175,20 @@ public override void Initialize(NetworkManager networkManager = null)
11751175
11761176 m_NetworkSettings = new NetworkSettings ( Allocator . Persistent ) ;
11771177
1178- #if ! UNITY_WEBGL
11791178 // If the user sends a message of exactly m_MaxPayloadSize in length, we need to
11801179 // account for the overhead of its length when we store it in the send queue.
11811180 var fragmentationCapacity = m_MaxPayloadSize + BatchedSendQueue . PerMessageOverhead ;
1182-
11831181 m_NetworkSettings . WithFragmentationStageParameters ( payloadCapacity : fragmentationCapacity ) ;
1184- #if ! UTP_TRANSPORT_2_0_ABOVE
1182+
1183+ // Bump the reliable window size to its maximum size of 64. Since NGO makes heavy use of
1184+ // reliable delivery, we're better off with the increased window size compared to the
1185+ // extra 4 bytes of header that this costs us.
1186+ m_NetworkSettings . WithReliableStageParameters ( windowSize : 64 ) ;
1187+
1188+ #if ! UTP_TRANSPORT_2_0_ABOVE && ! UNITY_WEBGL
11851189 m_NetworkSettings . WithBaselibNetworkInterfaceParameters (
11861190 receiveQueueCapacity : m_MaxPacketQueueSize ,
11871191 sendQueueCapacity : m_MaxPacketQueueSize ) ;
1188- #endif
11891192#endif
11901193 }
11911194
0 commit comments