Remix.run Logo
xnx 8 hours ago

Is there any reason that transmitted data would be much larger than player inputs (e.g. keystrokes and mouse movement)?

gafferongames 8 hours ago | parent | next [-]

Some games are networked deterministically, so that you can send only the inputs, and the game plays out exactly the same way (down to a checksum matching for all game state in memory across all players).

For example many RTSs are networked this way. They can have thousands or tens of thousands of units, but send only inputs. The classic article on this being 1500 archers on a 28k modem: https://zoo.cs.yale.edu/classes/cs538/readings/papers/terran...

The problem is that as player counts increase, the chance that any one player is late delivering inputs to the server (or to other players, if peer-to-peer) approaches 100%.

A deterministic simulation cannot stay deterministic, unless it has the correct inputs for all players, so the game has to pause and wait for inputs for all players before stepping the authoritative game state forward.

This is why high player count games like MMOs are not usually networked deterministically.

frollogaston 8 hours ago | parent | next [-]

Haha of course it's Age of Empires. The lag was insane because out of 8 players, there'd always be that one guy. AoE2 also had bugs with determinism, causing games to sometimes end because one person went out of sync. Even the HD remake had those issues. The even later DE remake seems to have fixed it, but it still depends on this really finicky math library that doesn't work exactly right in Wine/Proton.

LoganDark 8 hours ago | parent | prev [-]

Oh hey! I sometimes play a game called Cosmoteer that has deterministic lockstep multiplayer. That means in multiplayer every game has to synchronize on the exact same tick, receive all inputs from all other players and apply them on their exact same ticks, etc. The entire session is bottlenecked by the slowest player's machine. But it's very cool.

If any player desynchronizes, their state has to be erased and then completely re-sent from scratch so that they can start processing inputs correctly again.

kridsdale1 8 hours ago | parent | prev [-]

Typically you send state, not inputs. To prevent cheating.

seba_dos1 8 hours ago | parent | next [-]

It's sending inputs that makes preventing cheating easier.

frollogaston 8 hours ago | parent | prev | next [-]

Some genres of games (like RTS) typically do send inputs instead of state. Cheating is indeed possible.

gafferongames 7 hours ago | parent [-]

Cheating in the sense of breaking fog of war, because the client has to actually have the whole game state in memory due to deterministic synchronization. Yes.

LoganDark 8 hours ago | parent | prev [-]

Huh? If the server trusts the client to send state then the client could potentially send invalid or unfair state. If the client merely sends inputs then it can't just decide to manipulate the state that way.

frollogaston 8 hours ago | parent [-]

He means the server sends state to the clients, rather than sending other clients' inputs (or just P2P if no server). There are games that send inputs, which means if it's a game of limited information, clients know more than they should.

LoganDark 8 hours ago | parent [-]

Ah, I get it now. I actually know a game that sends inputs (I commented elsewhere in the thread, the game is Cosmoteer). But yes, most games I'm aware of send state.