Call of Duty: Modern Warfare makes use of a variety of techniques to mitigate the effects of different types of network latency across all the players in a given match. Infinity Ward offered a brief overview of how its netcode works in a video ahead of the launch of Modern Warfare, and during this week’s digital Game Developers Conference, the studio has provided a more detailed breakdown of its approach to networking – and how that approach was affected by some high-profile YouTube videos.
The issue any competitive game runs into is how best to synchronise the state of the server with the state of the game client on your home machine. If things get out of sync, you’ll jump around the environment, or see other players do the same, until the server and the client can start agreeing with each other again.
Modern Warfare runs on dedicated servers, as Infinity Ward’s director of online engineering, Mitchell Sanborn explains during his GDC talk, so data from the game on your machine at home gets sent to the server, gets processed alongside the data from every other player in a match, and then the server sends the results back to your client. So whatever’s on the server is the ‘real’ version of the match, and the game you’re playing at home is just a visualisation of it.
When connection issues occur, both the game clients and the server will try to smartly guess at the missing information. So if the data you’re sending to the server gets interrupted, the server will extrapolate your position – meaning that it will continue to assume you’re moving in the same direction as your last input, then correct itself when the connection is restored. In other cases, the server might force you to line up where it thinks you’re supposed to be through prediction.
On the client side, the game starts building up a buffer of inputs before sending them to the server in an effort to avoid forcing the server to extrapolate or predict where you’re going to be. That means that the server will have more accurate information about where you are on the map.
But input buffering comes at a cost: latency. It takes time for that buffer of inputs to build up, and in more extreme cases, that means you’re going to experience latency between your game and the server. In the original version of Modern Warfare – the one that was part of the public beta – the game heavily favoured the buffer, prioritising an accurate representation of your movements over reduced latency.
During the beta, the game would throttle up the demands of the buffer during periods of poor network performance. That’s why, Sanborn explains, a YouTube breakdown of the network performance for the Modern Warfare beta found it so much more latent than other Call of Duty titles, and many other FPS games.
Sanborn says there were two possibilities for why this “zealous YouTube fan” found the issues they did. One would have been if the algorithms designed to manage those natural network problems were mistuned. The other other would have been if there was something wrong with the connection. The devs could only figure out what the problem was if they had data on that YouTuber’s connection to the game – which they did.
The data showed that the YouTuber’s client was suffering from a worse connection than other players within the same matches. “For certain matches, this player certainly experienced extreme network conditions, which were not ideal. The latency would have been bad for this client, I have no doubt. It’s just that it seems – from this graph, anyway – that it would have been a connection-related issue.”
But while the network issues for this one user were extreme, the devs also found that most clients were putting far more time into buffering than they expected. And, following the backlash after that YouTuber’s breakdown of their latency experience, players were vocal about wanting an experience as free from latency as possible.
So for the final game, Infinity Ward reversed the throttle for buffering. Where previously the algorithm was tuned to eliminate errors between the server and client through buffering, now it was tuned to eliminate buffering by accepting a certain amount of desynchronisation between client and server.
The final Modern Warfare servers have ended up with a balance that favours reducing latency over pure synchronisation between clients and servers – after all, that’s what players ultimately ended up wanting. The algorithms are still tuned to provide a balance between all those mitigation techniques, and provide the best experience for as many players as possible – at least, as much as possible within the limitations of the current tech.