Max latency

For code related discussions and questions
Post Reply
BunkerBlaster
Trained
Trained
Posts: 268
Joined: 21 Feb 2010, 09:56

Max latency

Post by BunkerBlaster »

How much testing was done on the net code and the max latency of one second? Is the one second going to remain a fixed value that cannot be changed?

The reason I ask is because I analyzed over 100 games in ver 2.3.9 in order to be able to host the game. Jitter of 3 seconds is where random explosions happens and lag occurs for the host. And Jitter of 5 seconds is where 2.3.9 will often crash. When I say jitter I don't mean just a little bit of internet jitter, I mean where everyone else is fine and one person exhibits jitter like crazy. What will happen with ver 3.1 if the max latency is raised to say 1.5 seconds?
Cyp
Evitcani
Evitcani
Posts: 784
Joined: 17 Jan 2010, 23:35

Re: Max latency

Post by Cyp »

How much testing — values have been changed only once since first releasing. No experimenting with other values. The 1s can only be changed compile-time (and all clients need the same values to avoid desynch).

The potential problem with increasing max latency is that if one computer is too slow to run the game (not just bad connection), current code will result in the latency being increased to max, so tanks will take 1s (or 1.5s) to respond.

To avoid the Zzz freezes, there should be a reasonably constant ping time (even if ridiculously high, up to max latency), and a not-too-high jitter (as in some packets taking a lot longer than most packets).

If increasing max latency, max memory usage would be a bit higher, but I think not significantly.

So playing with values and/or code might help, since current values were pretty much based on pure guesswork and intuition of network conditions.
BunkerBlaster
Trained
Trained
Posts: 268
Joined: 21 Feb 2010, 09:56

Re: Max latency

Post by BunkerBlaster »

Cyp wrote:How much testing — values have been changed only once since first releasing. No experimenting with other values. The 1s can only be changed compile-time (and all clients need the same values to avoid desynch).
Being its done from the clients or that all clients needing the same value makes it impossible for me to test because I don't think a controlled test would do the trick.
Cyp wrote:The potential problem with increasing max latency is that if one computer is too slow to run the game (not just bad connection), current code will result in the latency being increased to max, so tanks will take 1s (or 1.5s) to respond.
Slow computers is the cause for the slowest of games from what I've seen when I host. I'm looking for a performance boost somewhere in max latency without any slow computers in the equation.
Cyp wrote:To avoid the Zzz freezes, there should be a reasonably constant ping time (even if ridiculously high, up to max latency), and a not-too-high jitter (as in some packets taking a lot longer than most packets).
Should be yes, and I've hosted games were there was no jitter. Constant ping up to high latency with no little jitter is so rare. I've seen that maybe 1 time out of 150 games. But I have seen a few where it looks more like a square wave, like maybe 5 times out of 150 games. The majority of the time its jitter and fluctuating ping. I'm not trying to avoid the Zzz altogether as I don't think a small amount of jitter is slowing the game down as much compared to a slow computer problem.
Cyp wrote:So playing with values and/or code might help, since current values were pretty much based on pure guesswork and intuition of network conditions.
I think 1s is good and your intuition is very good. The thing is when there are no slow computers I don’t notice any difference between a game that stays at say 700ms max latency and one that fluctuates between 900ms and 1s (per the logs). I just wanted to try tweaking say 1.1s then 1.2s etc. I asked using 1.5s because it I thought perhaps that was the area where problems start to occur and I would get a different response. Version 2.3.9 was so laggy sometimes and I actually continued to play the game regardless of the 3 to 5 second jitter, sometimes even more. So I don't think raising the max latency a little in the 1s range is going to hurt, if it could be done that is. When you say packets taking longer are you referring to out of sequence packets? That seems to be a problem because there are a lot of them. Do you think turning on the network cards flow control rx/tx on for the host and all clients that would help reducing out of sequence packets? I suggested this to a couple players but I get asked "whats a network card". If you think it helps maybe it could be turned on during the install or placed in the readme. I have rx/tx on as I think it helps to prioritize packets which should help prevent out of sequence packets if the computer is multitasking on the internet. Be nice if the clients had it on also as many computers have rx/tx off, or only rx on by default. Some sites will tell you there is a big performance impact by turning it on, but from experience I can say it is minimal and the benefit far out ways that.
BunkerBlaster
Trained
Trained
Posts: 268
Joined: 21 Feb 2010, 09:56

Re: Max latency

Post by BunkerBlaster »

Cyp wrote:The potential problem with increasing max latency is that if one computer is too slow to run the game (not just bad connection), current code will result in the latency being increased to max, so tanks will take 1s (or 1.5s) to respond.
If the max latency setting is 1s and if the Zzz wait time happens to also be 1s wouldn't that be 2s? Some of the games I've joined have been incredibly slow, seems much more than 1s

If it's 1s then the measurement of the slow computers bottleneck is 1s minus the actual latency correct? What happens to the slow computer after the client adjusted up to 1s? If it can't keep up It continues past that doesn't it? So the measurement of the slow computer is really the wait time that we do not know plus the 1s minus the actual latency, no? I think it is otherwise the game would desync, and it never has since the desync patch.

from this thread
viewtopic.php?f=4&t=9487
Cyp wrote:If a player runs too fast, only that player sees Zzz, if a player runs too slow, everyone except that player sees Zzz.
That explains why the same players continue to join and slow down games, because neither the host or the game is informing them they are doing so. Perhaps the game can give them a message "you are playing a {x} player game, maybe you want to try less oil or less players next time because your slowing down the game"

Having the ability to change the max latency doesn't seem like a solution even if it was available. What would be really nice is knowing ahead of time, not after the fact. It's really nice when the game plays normally, but it seems to be slow more often than not and it's not enjoyable when it is slow. The netcode is the best thing that has ever happened to this game and it seems the renderer and older computers is holding it back. Perhaps someday someone can program into the game to check if the computers actually meet the system requirements for normal game play per the map and number of players and give the host a button to allow or disallow those that do not meet the system requirements.

A while back there was a vote or poll as to whether to upgrade the game, and it was knowing that it may leave outdated computers behind. I voted yes figuring that was an acceptable trade off. But it seems to me outdated computers were not left behind. It makes more sense to me to play an older version with old computers and play at normal speed every game than to play a newer version with old computers at a slower speed some of the games. The older version has many faults but I can control it to play normally, I have no idea how to control 3.1 to play normally.
Post Reply