How do fast paced multiplayer games like shooters and MMORPGs maintain fairly fluid combat when everyone can have differing network connection speeds?

564 views

How do fast paced multiplayer games like shooters and MMORPGs maintain fairly fluid combat when everyone can have differing network connection speeds?

In: Technology

3 Answers

Anonymous 0 Comments

I assume by different connection speeds you mean different latency.

There are multiple approaches to this. In general, the server has definitive say on what happens. Clients tell server what they want to do. Of course there is some delay between your click and server receiving the request. These delays can be different for different players.

Easiest think to do is to target some specific delay, let’s say it’s ok for your game to have 100ms delay (that’s equivalent to 6 frames at 60fps). If my packet takes 60ms to get to the server, it will sit there doing nothing for 40ms. If someone else’s packet takes 80ms to get there, it does nothing only 20ms. This ensures that server had collected inputs of all players from the same point in past and can simulate next step. This ensures no-one has advantage by being closer to server (unless your packets take too long to fit in this window), and small changes in network latency doesn’t cause problems, because you artificially make bit bigger, but constant. This approach is fine for many games, but you wouldn’t want to use this for first person shooter.

If you need quick responses, you can simulate game on server and clients synchronized without any delay. Let’s say receives some input that you stopped walking. It knows that it took the packet let’s say 100ms to get to it, so it looks where you were 100ms ago, and simulate 100ms of staying in place from that point. If the delays are short enough, no-one will notice anything. If the delay is bigger, you’ll see players jumping around a bit as the server receives updated inputs. This has the advantage that what you as an player see is exactly what the server sees, without any delay, unless you do something. This isn’t big deal, for example, in FPS, you are running for few seconds (which equals to hundreds of frames), then few frames have to be recalculated because you stopped. Maybe you are changing the rotation more often than that, but that doesn’t affect the gameplay much if there is some delay or stuttering.

When I write it like this, it looks simple, but IRL, games probably use combination of these approaches and more, plus some game specific tweaks. For example in FPS, it doesn’t matter if sound of you yelling “smoke” is delayed by fraction of second, but if players disagree if someone got shot or not, it’s bigger deal. RPGs might be easier to deal with as there is bigger tolerance for small constant delay and many actions do take some time (for example, when you fire some projectile, it can take longer to hit the target than for packet to travel between client and server).

One important thing is that these times we are talking about are really tiny, almost insignificant. Techniques mentioned above are there just to make the experience even better.

You are viewing 1 out of 3 answers, click here to view all answers.