The War on Lag Begins with Lag

Lag can ruin gameplay by causing teleportation, missed shots, and frustration. Understand latency and how to leverage it for fairer matches.

You load up your favorite game, ready to blast some aliens or hide in a closet for thirty minutes, only to find your player keeps mysteriously teleporting around the map. One moment you’re hugging a wall, the next you’re hovering fifty feet above a chasm. You try to strike down the enemies rushing at you, but your bullets seem to only strike air.

Unfortunately, this isn’t some magical ability. It’s lag. And it can ruin gameplay and the player experience. Bullets don’t register. Characters constantly jitter. And your players get more and more frustrated.

Who’s to blame? Lag. Or, more precisely, poor latency. But what is latency? Why does it matter so much? And what can you do to improve it?

What Is Latency?

If you want to understand what latency is—and why it matters—you also need to understand what bandwidth is.

  • Latency measures time. It’s how long it takes for a data packet to travel from one computer to another—measured in milliseconds. The higher the number, the longer it takes.
  • Bandwidth measures size. It’s how much data you can squeeze through at one moment. The higher the number, the more data you get at once.

Think of it like a pipe. Bandwidth is the width of the pipe—how much water it can hold. Latency is the speed at which the water moves through it.

Typically, when you’re browsing the web or downloading an especially large file, latency isn’t that critical. If you can pull in 100 megabits per second—bandwidth—it doesn’t matter how long each packet takes: 1 millisecond or 100. You won’t notice the difference.

In extreme cases, bandwidth matters far more than latency. Like if you need to move a truly massive amount of data. If you literally grab a hard drive, walk next door, and plug it into your neighbor’s computer, it’ll be much faster. It’ll have extremely high bandwidth, but also very high (slow) latency. (Fun fact, it’s called a sneakernet.)

But in a multiplayer game, you’re not sending huge files. You’re sending lots of tiny ones. So those milliseconds matter. You need low latency.

Low Latency Leads to Fairer Games

When everyone is on an even playing field, nobody gets an unfair advantage. Imagine two players in a match: Alice and Bob. Alice has much higher latency than Bob. If they round a corner and start shooting at each other, the advantage is with Alice:

  • Alice will see Bob before Bob sees her (giving her a chance to react first).
  • Alice’s shot will register before Bob’s.

There are ways to avoid this problem. You can register the hit on the player’s side, not the server’s. But this can result in poor Alice taking a bullet even though on her screen she’d already ducked behind cover. Not ideal.

When players have roughly the same latency, neither gets an unfair edge.

But why does some players’ latency get so bad?

Physical Distance Matters

So why might Alice have very low latency and Bob very high? It usually comes down to how far they are from the server. Light is fast, but it isn’t magic. It still takes time. And the Earth is massive. To get from North America to Africa, light takes about 40 milliseconds. Which means that’s the very best latency you can get.

But that’s not the whole story. The route the data takes matters too. Imagine you’re planning a road trip. One route might use expressways and fly as the crow flies. Another might cut through the backcountry, forcing you onto dirt roads, twisting and turning. The same goes for data: if it travels a direct route, it’ll simply be faster.

Their Local Network Might Be Terrible

The type of network matters too. If they’re on public wifi—with a hundred other people clogging the airwaves—it’ll take quite a while for data to get through.

Just like in our route-planning example, the traffic on each road matters too. Even if you’re on a direct path, everyone else can slow you down.

This often happens on a player’s local network. There are other people in the house hogging the line and generally slowing things down. And that’s one area you can’t control.

Add Latency to Matchmaking

To keep your game running as smoothly and fairly as possible, you’ll want to try to reduce latency.

If you want your game to be truly effective, we recommend adding a way to check a player’s latency during the matchmaking process. Add the check and only connect players if they fall within a certain threshold of each other.