File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
com.unity.netcode.gameobjects/Runtime/Transports/UTP Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -517,7 +517,12 @@ public NetworkSettings GetDefaultNetworkSettings()
517517 // package. We just need to initialize the settings since otherwise these features will
518518 // not be enabled at all in the driver.
519519 settings . WithSimulatorStageParameters (
520- maxPacketCount : 300 , // TODO Is there any way to compute a better value?
520+ // Assuming a maximum average latency of 50 ms, and that we're somehow able to flush
521+ // an entire reliable window every tick, then at 60 ticks per second we need to be
522+ // able to store 60 * 0.05 * 64 = 192 packets per connection in the simulator
523+ // pipeline stage. Double that since we handle both directions and round it up, and
524+ // that's how we get 400 here.
525+ maxPacketCount : 400 ,
521526 randomSeed : DebugSimulatorRandomSeed ?? ( uint ) System . Diagnostics . Stopwatch . GetTimestamp ( ) ) ;
522527 settings . WithNetworkSimulatorParameters ( ) ;
523528#endif
You can’t perform that action at this time.
0 commit comments