game-programming-patterns icon indicating copy to clipboard operation
game-programming-patterns copied to clipboard

Variable time loop slander! :)

Open SmatchyLaPaglia opened this issue 8 years ago • 0 comments

In the section on game loops you talk about variable time loops as something most professional game developers frowned upon, but as far as I know variable time loops are the preferred method of writing massively multiplayer games. The issue that you bring up, of the simulation running incredibly differently on different peoples machines, is solved by assigning an “authority”. In cases with a central server, i.e. most cases, that server is the authority, and it informs all of the different machines of what has actually happened. So the machines can run as differently as they will, but they all are referencing the same game loop when determining what to display.

You touch on a sort-of similar thing when you describe the rendering loop as guessing where to render things if the update loop hasn’t caught up with it, because in essence that’s what the client game loops do in the absence of updates from the server; they take their best guess, and then correct themselves if the server’s next update conflicts with what they guessed.

Anyway, I understand that the point of the chapter is game loops and not client/server mechanics, but I think it may be a bit misleading if you thoroughly deride the industry-standard method of keeping time in massively multiplayer games.

And I should mention that I could be completely wrong about all this, I am only going off of what I have read in other places!

SmatchyLaPaglia avatar Nov 07 '17 19:11 SmatchyLaPaglia