tweak(network): Reduce the minimum runahead latency limit from 10 to 4#1489
tweak(network): Reduce the minimum runahead latency limit from 10 to 4#1489xezon merged 1 commit intoTheSuperHackers:mainfrom
Conversation
|
Wonder why EA chose a value of 10. Maybe because internet speeds/latency weren't as good as nowadays? That begs the questions:
I almost feel like this should be configurable by the host for best performance |
This is only setting the absolute minimal value that the Runahead can be set to. The game already dynamically adjusts the Runahead based on the network latency. While testing with GO, we found that when we tried using a value of 2 as the bare minimum, which still allows the local machine to process some frames while waiting on data, the game would stutter when playing with some players but not others. This was when the network latency allowed the runahead to go this low. In the above instance, 2 GO frames is 33ms compared to 66 for SH builds due to the 60/30Hz differences. In a LAN i would still consider having some frames of runahead since there will still be some latency that's not directly network related with message processing etc. I would say that 3 frames is the absolute minimum i would consider but i chose 4 as a reasonable bufffer that can work in 30Hz and 60Hz logic rates without needing individual settings. Over Radmin, i have had some games where the latency can go bellow 10 but often won't go near the lower limit till you are playing with one other player. More of the netcode needs adjusting before the SH build can become as fast as how GO works. |
There was a problem hiding this comment.
Can we also make this configurable, in a follow up change?
There even is a EA todo for it:
m_runAhead = min(max(30, MIN_RUNAHEAD), MAX_FRAMES_AHEAD/2); ///< @todo: don't hard-code the run-ahead.
Both MIN_RUNAHEAD and MAX_FRAMES_AHEAD can be made configurable right near
{ "NetworkRunAheadSlack", INI::parseInt, NULL, offsetof(GlobalData, m_networkRunAheadSlack) },I also wonder what is up with that max(20 or 30, MIN_RUNAHEAD) and MAX_FRAMES_AHEAD/2. Very confusing.
There was a problem hiding this comment.
There is not a great deal of need to make the minimum value configurable.
That runahead with the comment is for the initial value, the runahead is constantly updated during runtime.
I have attempted to lower the initial runahead value, but it can just end up causing the game to lockup and a disconnect timeout to occur at the start of a match.
08d4ea8 to
f453b88
Compare
|
Updated with a comment on the tweak |
… run at lower network latencies
f453b88 to
4c31ca8
Compare
|
Tweaked and pushed. |
This PR reduces the minimum run ahead limit.
This then allows the game to run with a lower input latency when the network latency allows.
The limit for now has been reduced by 6 frames. If the limit is set too low it can start to introduce stutter to the game where the game starts waiting on data. So a 4 frame window, resulting in 133ms of latency minimum compared to 333ms of retail provides a reasonable lower buffer.
The added advantage of this change is that when a SH client is the host, it can push the runahead below the 10 frames minimum cap for retail clients as well.