system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How do they synchronize a fast paced multiplayer game?

If I shoot at a moving target, due to lag there will be different perceptions on whether I hit him.  How is this determined?
gpt
Former game dev here,

This is actually a really interesting problem to solve. The easiest way to do it is to have the server be the authority. The console is just the video terminal, displaying the state of the game as the server dictates it is. When you shoot, that happens on the server, and you simply display the results.

Most games are some variation of this. Where things get interesting is that video games are rather predictive in their displays to account for lag. Ever get stuck running forward in WoW because of a dropped connection? Your inputs go to the server and you display the server response, with the connection dropped, that cycle is broken, and you only see the prediction animation until you get a new connection, then the world jaunts to the latest server state.

And how do FPS games do this so fast? Most bullet physics are "ray casts". The game draws a straight line and checks to see if it collides with a target. It's an instant hit, it's cheap to compute, and fast. Games with bullet travel account for time and will draw an arch. It's more expensive and depends on some predictive modeling. Projectiles are actual physical models in the game and run normal collision routines as your avatar bumping into a wall...

---

On this subject, physics and animation are HARD. You have an object with a velocity, and you have gaps in time because you need to render frames. What if a billiard ball is moving so fast toward a wall that it bumps off and moves in a different direction between frames? One moment you saw this thing moving toward the wall, the next moment it's moving away in a different direction; it magically transported!

When performing the physics calculations, we have to conceptually draw the path of all the objects and ask who is colliding first, and is it visible to a player? If a billiard ball collides with the wall, you HAVE TO SHOW the collision. Your mind needs to register the billiard ball hit the wall and bounced off, or the world won't make any sense.

You may be trying to render frames at a regular 1/60 second interval, but this collision happened between frames, so your timing gets skewed! You end up rendering a frame that happened at 1/58 second! If this happens once or twice, no big deal, and you can compensate in the next frame by rendering 1/62 of a second later. But if this happens frequently, the passage of time and reality skews.

This is why billiard ball games are some of the hardest video games to make and among the most under appreciated.