While this ensures that game play is responsive, it can lead to clients having different conflicting world states requiring solutions to resolve these conflicts. In this case, the server does not own the world, it just serves to update the world according to views from it’s clients and distribute these views to the other players. This solution results in smooth, responsive gameplay and was first introduced in CounterStrike.Īs a side note, clients can be authorative in that they are allowed to process the players inputs and update the world themselves. Input from other players is basically the only cause for correction, such as the firing of a rocket point blank at the back of the head. If the game play mechanics are reasonably deterministic then corrections will occur rarely as server and client are calculating the same world view. To avoid this, the client would have to first rewind time and then repredict forward in time to reach the current time again. If the client has to revert to the server view resulting from it’s input 400ms ago, it is thus jumping back in time to the time of that input. The client has in the mean time moved forward 400 ms in time using it’s own predictions. To understand this, say that it took 200 ms for the client input to reach the server, and another 200 ms for the resulting world view to come back from the server. Reverting to the server state when a client prediction is off, actually means that the world view of the client jumps back in time. This solution was first introduced in Quakeworld. The world view is then yanked back in line with the server view, often causing a noticeable glitch. Of course, a problem occurs when the server world view comes back and differs from what the client predicted. The resulting game play is much more responsive. This requires the client to know about the game mechanics and game objects, thus the client is no longer dumb. They take the players input and predict what will happen, immediately updating the world view accordingly. To smoothen the game experience, clients no longer wait until they receive a view back from the server. Doom worked like this and if you had a high latency then most chances were you were dead before you had a chance to see what hit you. For players with a high latency, the game quickly become unplayable, the world moving in jarring jumps. The solution works fine for computers with the same low network latency but begins to fall apart when players have higher, differing latency. There is no longer a problem of keeping the game world consistent across computers as there is only one world (on the server). The server then carries out the input and sends back a “picture” of the resulting world. The clients have (almost) no code, they are just dumb terminals sending input (key presses) to the server. The server has the game “world” and the clients just receive a view on this world. To avoid having to wait on the slowest computer, each computer now communicates with a single server. Real Time Strategy games typically use variants of peer to peer lockstep, albeit with better handling of the lag issues. The disadvantage of this networking solution is that each computer has to wait until it has received the move from the last computer, the slowest computer thus determing the pace of the turns (and thus lag). Assuming that all computers started from the same initial game state, this would ensure that all games played out identically across computers. Once all the computers had communicated their next move to all the other computers, each computer carried out the moves after which it was time for the next turn. The game consisted of “turns” and in each turn a computer could choose from a limited number of “moves”. Initially, each computer exchanged game information with each of the other computers in a star topology. A brief history of networkingīefore diving into the networking solution that Unity offers, lets briefly look at the history of multiplayer games and their networking solutions.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |