Tuesday, September 29, 2015

Lag Reduction FTW, literally

Some time ago I was chatting in a CS:GO stream and made a reference to Fatal1ty. No one caught it which made me kind of sad because Fatal1ty was the first big name in PC eSports. Well I suppose there was Thresh, but e-sports as we know them weren't quite a thing when he was dominant.

Johnathan Wendel

Wendel is retired because, like crime, the competitive First Person Shooter scene is a young man's game. He is in his early thirties, like me. There is no doubt he can get better at the game through practice:

Practice

Malcolm Gladwell says as much with his findings that masters of their field have at least 10,000 hours of attentive practice. That's six hours a day for ten years. But there's also the problem of declining reflexes as we age, and reflex times are key to twitchy games like CS:GO.

So what can we old-timers do? Well, one of the advantages old people have is more disposable income - at least if you are single. This means we can buy things to give us an advantage*

Since all but the highest levels of competitive play take place online, having a better computer can translate to advantages in game. This is particularly true with regard to latency. Let's imagine a peeking situation in CS:GO.

A typical player might have a regular locked CPU, 24" 1080p monitor that came with the computer, and a normal mouse. Imagine they connect to a server with 70ms ping and are heading around a corner where an enemy player is also approaching. For simplicity sake we will assume the enemy player has the same ping and reaction time; the only difference is that the enemy player has better hardware.

The server receives the positions of both players in 35ms, their locked CPU processes that data in 10ms, the monitor input lag introduces another 20ms, the monitor displays at 60Hz which is 16.7ms. So they see the enemy player up to 81ms after the data is actually sent.

The enemy player gets the positional data in 35ms, their faster CPU processes the data in 3.33ms, their monitor has 1ms input lag and is 120Hz which translates to 8.33ms. So they see the player up to 47ms after the data is actually sent. That is, they can see the player for up to 30ms without the other player seeing them.

The player hits the button and the mouse reacts in 15ms, the actual signal is sent in 8ms, and that gameplay data is sent in 35ms. So from click to server receipt can be up to 58ms.

The enemy player hits the button and the mouse reacts in 1ms, the signal is sent in 1ms, and that gameplay data is sent in 35ms. Only 37ms from click to server receipt. That is, the enemy player can afford to react up to 20ms slower and still prevail.**

Based on the stats from the human benchmark website, I think these are decent improvements. With regard to straight up reaction time, I'd estimate one sigma.***

There are a number of in-game settings that can help but there are many guides for that. I'm focusing on hardware here which generally doesn't get the same comprehensive treatment.

The Lag Chain


This is simplified but basically when you play, your computer sends information about positioning to the server and receives information about the positions of other players. In a situation, say peeking around a corner, the player computer with the lower ping will get information about the enemy player first. Then the computer attempts to render the scene, the monitor displays it, the player reacts by moving and clicking the mouse, and that event gets sent to the server. All of these events take time so anything that can reduce that time can theoretically help you get a fraction of a second jump on the enemy.


  1. Ping
  2. Rendering setup time
  3. Draw time
  4. Human Reaction Time
  5. Click time
  6. Event sent to server (ping time)
  7. Server calculation

Ping


The best thing you can do is use the CS:GO game settings to limit the server ping to the minimum (which in the browser is 50ms). It isn't exact but it will tend to place you in games with lower ping.

There's very little else you can do on your side to lower ping. Switching from wired to wireless doesn't reduce ping times appreciably unless it's a really bad wireless card or router. It's still an advantage to use wired just for the reliability.

Switching ISPs can the overall ping situations since larger ISPs tend to have better peering arrangements which means that for a given server, their traffic might be given priority and/or a shorter route.

There are services which purport to send your network traffic through shorter lines but I haven't seen any evidence that they work.

If you are using DSL, getting your provider to switch to non-interleaved can improve ping. The downsides are that the connection might not be as reliable which can sometimes require a speed downgrade.

If you are using Fiber, my connection of choice, check to see if you are using MoCA. This can introduce a latency penalty over using a straight ethernet connection to the router. Unlike the interleaving change, this one will require a technician unless you are good with networking.


Rendering Setup Time


Technically this is broken into many steps, some of which are done by the CPU and some of which are done by the GPU. I'm considering all the work done by the computer here once the gameplay packets from the server are received. 

CS:GO is one of the few games that is largely CPU bound, i.e., the speed of the CPU is the limit to how many frames per second the engine can render. There is a cap of 300fps so trying to achieve gains higher than that isn't that helpful though as frame rate varies depending on map and gameplay complexity, it pays to bump up the CPU horsepower to compensate. 

Overclocking can definitely help in this case so buy an overclockable CPU and overclock it. A lower end processor might get, say 100fps which is enough for singleplayer and 60Hz monitors, but it isn't optimal. 100fps translates to 10ms of latency versus 3.33ms for someone playing at 300fps.

It's possible, if the GPU is weak enough, that CS:GO is unable to hit 300fps. In that case, buy a better GPU. But CS:GO isn't particularly taxing GPU wise.

Draw



For this section, I'm examining the monitor side of things. Here, a 144/120Hz monitor offers a good advantage over a 60Hz monitor. 120Hz is 8.33ms of latency compared to 16.7ms for a typical 60Hz monitor. 144Hz is even faster but the reason I single out 120Hz is because Lightboost technology is only available at 120Hz, sadly.

Lightboost


Lightboost (strobing) basically gives CRT levels of clarity to LCDs. The advantage is that motion is much more clear. When you scroll down a webpage, the text gets hard to read for a number of reasons. But when using lightboost (combined with V-Sync), it is literally like sliding a piece of paper around. It's that clear.

The disadvantages are that it lowers screen brightness quite a bit and increased screen brightness helps reaction time. It also looks best with V-Sync but V-Sync adds a lot of lag which is a killer in competitive games. It cannot work with G-Sync technologies, and probably won't for a long time. It adds a tiny bit of lag since each frame is displayed nearly instantaneously as a whole instead of gradually in parts.

I love the motion clarity personally so I use it but it could very well be the case that 144Hz's lag advantage is better.

On top of Hz differences in latency, there's the phenomenon of pixel response time and input lag. Monitors intended for graphics use like IPS tend to have slower response times. There are, as of September 2015, no IPS monitors with a pixel response time fast enough for strobing to work. 

Input lag is the monitor's own processing time. Gaming monitors and gaming modes generally have much less input lag but that can be checked on review sites. There's a lot of "gaming" marketing snake-oil out there but gaming monitors are the real deal.

Unfortunately measuring input lag is a bit of an art so the results you see from TFTCentral and prad.de (my favorite monitor review site) will vary. Prad.de is German and English but to find the input lag for TFTCentral, it is the "signal processing" time. Ignore the Class designation on that site since it allows a huge 16ms variance for the highest rating. 

What you don't want is for the monitor to do upscaling if you are playing at non-native resolution. It's much faster for the GPU to handle that.

Human Reaction Time


Not much to say here, be well rested, maybe a bit of caffeine, warm up. Maximum brightness is useful but there's not much hardware can do to speed that up. A larger monitor means a larger target which should help reaction time so that might help although larger monitors are dimmer so there's a tradeoff. I play using the 4:3 stretched resolutions relatively close to the monitor so that does give some of that larger target advantage. Maybe glasses with mild magnification could help there as well.

Senses typically respond faster to auditory stimuli but who isn't playing with sound? Playing with positional sound can help you react better, though it isn't directly related to the latency question.

Click Time


I'm indebted to the work done by a pair of Japanese bloggers Utmalesoldiers and systema, who have, by far, the most scientific inquiry into CSGO/FPS gaming hardware and settings that I've ever seen.


Click the image for more detail


This graph is essentially a measure of the time between a click is pressed to the time it is registered. There's a lot more to mouse quality than mouse click lag time, but it is one factor to look at if you are trying to reduce total latency.

Mice also suffer from polling latency. I think the Windows default is 125Hz or 8ms whereas gaming mice can reduce that to 1ms (with a 1000Hz polling rate) or 2ms (500Hz which can be required for some iffy mice). There are noticeable differences that Mark Rejhon of Blurbusters has written about, but I would prioritize click latency over polling rate since the former can introduce unnecessary lag an order of magnitude above the latter.

Well that's it for now and don't forget, PRACTICE! I don't use optimal settings myself since I'm a casual player but I do like to understand the factors that affect gameplay.

* Wealthy young people, or young people with wealthy parents can further extend their reflex advantage with these tips as well.

** These advantages are insignificant compared to team strategy, aiming proficiency, map knowledge, etc. but as the other abilities reach maximum, latency plays a more important role.

*** I'd like to do a formal statistical calculation but I'd need more data. What is the typical spread for the individual? A 50ms advantage can essentially become practically worthless if the spread is very high whereas it is an automatic win every time if the spread is small enough.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.