by reitzensteinm · 3y ago · 0 comments
You'd generally want an authoritative server to accomplish this. Having it also execute the inputs prevents most cheating, too.
I've built and licensed a time traveling variant of this model (GGPO style) and spent years with thousands of concurrent users playing my games. And they operated just as I describe.
Company of Heroes is more of a traditional AoE style and will happily queue up unit orders for a minute or more while it attempts to reconnect or catch up.
Yes it relies on the players trusting each other a little to avoid extreme lag, but there are plenty of ways to ruin this kind of game besides lagging. It's not like CoD where a few useless teammates won't make a big difference, while it didn't have automated ranked play like Csgo. (but the recent DE remake does, and yes it needs better netcode)
Time-traveling netcode... I know Slippi does this, and it works great.
There just aren't many modern multiplayer games where slow players can negatively impact the experience of others, and that's because the industry has learned how terrible the experience is.
And that's for players playing in good faith on bad connections - abuse by inducing latency was a big thing in the past. Think a player that runs out the clock when they're a move away from being checkmated.
Basically the only time you'd ever want to operate the system to pause if a player fell behind is during a tournament, where fairness is more important than player experience and they know that going in. And even that, IMO, is questionable.
That makes it very different from this model in my eyes. You wouldn't have every client running the game in sync. The AoE devs had this dilemma and chose the other path.
It wouldn't surprise me if the AoE remakes do this to work out who won the game.
Definitive and HD Edition both seem to use nearly the same netcode as the original game. And the whole thing lags if one player lags. Yes it handles situations where all players leave, so there's a server doing something, but the glitches in Elo changes hint to some weird edge cases. I even found an easily triggered bug in HD Edition where both players would gain Elo at the end of a ranked game.
The netcode was written so that players only send their inputs along with a timestamp (The "timestamp" actually being a frame counter). The server would then relay those inputs with the timestamp to other players. The client maintains snapshots of the game state and would then re-run the game logic from that timestamp given the new input.
I handled clients falling behind by making the server reject any inputs that were more than 500ms (Really, 30 frames) behind the current time. The server would send a message to the client that essentially said "You're lagging, here's the current frame counter and current state of the game"
Granted, this approach really only worked for my game because the entire game state could be squished to ~300 bytes. But it had the added benefit that it prevented players from cheating using a lag switch. They couldn't have a malicious client that sat and listened to what other players were doing and then send a bunch of back-dated inputs to put itself in an advantageous position.
But you could keep it strictly as cheat prevention, which keeps it very close to the AoE model.
I wouldn't start a game in 2023 trusting any input from players, including win reporting - but I understand if their hands are tied by a legacy system, and the players vote on outcomes.