Gil_Hamilton wrote:Also, syncing three computers over an unreliable network(which the internet IS, and this is partially by design) is VASTLY more complex than syncing two.
What makes it unreliable and what makes the design like that and why would it be done on purpose? I'm just curious. If you can just link me an article it'd be fine, because I don't really know what to search for.
In part, it goes back to the original design goals, when it was a military project. It's decentralized and intended to be difficult to disable. So to prevent one single system failure from taking the whole network down, data can take multiple paths.
But not all paths are created equal, which brings us to the other part... there's a lot of computers and infrastructure that you have no control over are between you and the other end of the game.
Some paths have more computers to stop at, some stops worse line conditions, some machines aren't working the way they need to, and some machines are just so overloaded they're taking their sweet time to pass your data along.
To make a complicated situation simple...
Under the Internet Protocol, packets are not GUARANTEED to arrive.
If they DO arrive, they are they not guaranteed to arrive in a timely manner, nor are they guaranteed to arrive in the same order they're sent.
They aren't even guaranteed to only arrive once. Duplicate packets happen.
IP makes no assurances, nor does it provide any error-correction, nor proof of success or failure.
Now, IP is only half the story, admittedly.
TCP, among other things, provides for notification and resending of lost or damaged packets. It was explicitly designed to work over IP, and you will commonly see them grouped together in name as TCP/IP because of it.
But that feature actually makes it sub-optimal for gaming, since once the packet is late, you don't care about it anymore because the game has moved on. TCP also takes more time to parse because of this, making real-time gaming more difficult even on a fast and reliable network.
UDP has no such features. The sender doesn't even know you missed the packet. While this is a bitch and a half for significantly-sized data transfers, for gaming being FAST is more important than being RELIABLE. Which makes it commonly used for games.