how do online games work so well

574 views

Especially with a battle royale game with 100-150 players. How does everyone’s input get sent to everyone else at the same exact time. Is internet just THAT fast now?

In: Technology

2 Answers

Anonymous 0 Comments

Input doesn’t get “sent to everyone at the same time”. When you provide input in an online game, you send it to the server. The server does whatever processing necessary to validate your input, then sends your new position back to you and anyone it’s relevant to.

What do I mean by “anyone it’s relevant to”? Anyone who needs to receive your new position – they can see you on screen, or they’re within a general area around you that it’s important that you receive their position, or it’s updating their position on a map, etc. If they can’t see you and are far away, they don’t need that update so the server doesn’t send it as often (and your client uses interpolation to fill in the gaps).

So you are unlikely to constantly receive 100-150 updates at all times.

That said, those updates are pretty small, we’re talking a bytes here….a few kilobytes at most depending on what is sent. So even if the server is sending out thousands of packets (let’s assume a large average of 1KB per packet to 100-150 players) per second, that’s still only a few thousand KB per second. Game servers are likely to have fiber connections (easily capable of hundreds of MB per second).

ELI5 – Yes, internet is just “that fast”…but also the amount of data necessary for position updates is much smaller than you might expect.

Anonymous 0 Comments

No, its called interpolation. The server is taking inputs, and video games still operate in “ticks”. So the server is able to do math to determine which tick an input belongs. It has algorithms to help account for latency and such and “smooth” the differences in connection speeds. But this is how the game can operate at the same speed on a super computer as it does an i5 processor.

Basically, if there were no interpolation, the game would just stack whoever has the fastest connection ahead of everyone else, making it useless to pay unless you have insane speeds