Eruanna wrote:I've had bad experiences with running GZDoom multiplayer over the internet. I was in the United States, my partner was in Italy. We were testing Stronghold multiplayer at the time, trying to make sure that the game functioned properly. Everything went well until - well, a lag spike, and the clients were out of sync. The more we played, the more lag spikes and desyncs there were, and it ended up that we just couldn't play it at all.
That's sort of the problem: Impossible was not a suggestion, it's impossible as eating the sun. The input framework functions on a reverse acknowledgement concept, where all data is confirmed delivered until asked otherwise. This works because a node will not run any gametics when absent of any input for that gametic, which is where latency is introduced. This affects singleplayer in just the same way. The core concept of this is if you miss a packet, the game will not run and will ask for a retransmit. If you're running gametics faster than the network buffer wants to build them, the game will also not run, which is exactly how the interpolation functions (tryruntics just freeruns without delay, letting the renderer and the network figure out the rest). Your own input is treated just the same as other nodes, so the game cannot physically advance until the input for the next gametic has been successfully received for all nodes. The buffer itself will physically stop building gametics if it has too much before it gets a chance to overrun old tics (incase they need resending).
This is how it has been since vanilla, so nothing about any kind of lagspike at all can cause a desync.
Eruanna wrote:On point two, I am fairly certain I am not confusing P2P and C/S. When I say P2P I am referring to a technology where only player movements are broadcast and the games are kept in sync by running their own copies of the simulation and AI using a shared random number seed so that all results of random calculations will be the same. When I say C/S I am referring to a technology by which actor and game positions and states are forcefully replicated from a server to all its clients, thus allowing the clients to run their own game sims that get updated by the server. Player movement commands are often not replicated in C/S, rather the actors and environment objects that players control are, instead.
So you are confusing the two.

Peer-to-peer is a communication framework in which no server exists to maintain as a central endpoint or exist as a point of failure. This is commonly used when you need a set of data to be transferred independent of a 3rd party, which you may notice sounds exactly like how a torrent works. That's exactly the communication torrenting uses to make sure a file can exist and be transferred regardless of the state of anybody who originally hosted the file. Doom uses it to make sure the state of any one datagram or stream can't be backlogged by other nodes, although still uses an arbitrator to dictate the speed of the game (however they only host their own input). It also makes it incidentally compatible with the concept of
supernodes, which in a way is also how torrents work.
Client Server is pretty much the opposite. A centralized system or host maintains all connections and communication between all connected clients. A lower bandwidth footprint overall, while introducing an added delay in communication between any two clients. It also makes re-establishing connections a problem if the host vanishes, which now would either need to migrate to a new host (if one could exist), or discard the session entirely.
Funny thing about both of those explanations is that neither of them actually properly explain how Doom, ZDoom or Zandro works. The concepts are actually interchangeable. Notably, you explanation of P2P actually has nothing to do with P2P, but rather what's called a
Deterministic Model. While indeed also what G/Z/Doom use, actually has nothing to do with P2P at all, other than it just so happens that's how player inputs are routed. The two otherwise to rely on each other, especially for demos which are just a file stream containing inputs piped into each gametic, allowing them to be played back at any speed regardless of the speed of the original recording (which isn't kept either, as demos are notably timeless other than their number of inputs overall.)
It's also what allows Doom to frameskip without changing the physics. Frame took too long to render? 5 inputs constructed during the time? It just runs 5 gametics at one cycle.
The more you know:
Peer to Peer is actually still used these days for racing games, typically Kart racers (It's also used in Elite Dangerous to keep server costs down via instancing which would be fine if the instancing wasn't trash). Each node sends the current state of their vehicle including speed, position, state, damage model, if they fire their weapon, who they attempt to hit... Basically everything about their own actions and what state they are in. Still Peer to peer, and notably not even remotely deterministic. It's done this way to combat the latency-to-laptime problem by providing the best possible average for all players. And considering the typically low number of players per race, it's very efficient.