LATENCY.GG
Lag is killing games
Tim Armstrong shows off Latency.GG, an open-source global internet measurement system for reducing lag and jitter in multiplayer games.
Part Two!
Did you miss part one? See page 64 to get hold of it
OUR EXPERT
Tim Armstrong is a former lead engineer turned developer advocate specialising in networking, software development and security.
QUICK TIP
If you want to get into game development for Linux then Unity is a great place to start. You don’t even need to know how to code!
Latency is the biggest problem affecting online games today, from the biggest AAA titles to the smallest of indie games. A problem is that most games programmers, while being experts at graphics and physics programming, know comparatively little about the internet and the black-box that’s commonly referred to as “net code”. This, in turn, leads to poorly optimised game servers that are incredibly susceptible to fluctuations in latency, being deployed on hosting providers that oversell the quality of their networks while vastly under-delivering.
In a 2021 study completed by Plaintextnerds on behalf of Gameye (a provider-agnostic managed game hosting solution), it was discovered that seven of the 11 hosting providers included in the study (including one owned by a games publisher) suffered from jitter so extreme that it hit the upper limit of the test at more than one second of peak latency. Which, needless to say, would result in a terrible online gaming experience.
Jitter and latency
So how do you go about fixing this? First, you need to understand a few fundamentals about the sources of jitter and latency. You’ll probably have read somewhere that the primary root cause of latency is distance, and while that statement is true, it’s also misleading because they aren’t talking about physical distance not so much as digital distance.
For example, if the game you’re playing is hosted in London and you live in Edinburgh then based on the distance you’d expect a latency of 1-2msec, but that’s not even close to the 15-30msec you’ll actually see. So what’s going on here?
Depending on which ISP, it could be caused by the ISP’s poorly managed network of daisy-chained pointsof-presence, or because your traffic goes on a brief holiday to the Netherlands before London (as is the case for clients of Virgin Media at the time of writing).
Rather than being a linear structure, the internet is a complicated, ever-changing web of “transit” (ISP A allows traffic from ISP B to cross its network to get to ISP C) and “peering” (ISP A and ISP B agree not to charge each other for traffic from each other’s clients) connections between routers that dynamically update paths based on everything from avoiding intermittent faults (such as a power outage) to contract negotiations between ISPs. This can mean that traffic from you to the server goes via one path, while the response goes via a different one – this is more common than you’d think.