Reputation: 71
I am writing my thesis about different game architectures and I have not found an answer to this one question I have. I have googled for hours but have not found an answer.
I was reading this article: https://gafferongames.com/post/what_every_programmer_needs_to_know_about_game_networking/
And there is this paragraph talking about p2p limitations for games :
The final limitation occurs because of the way the game synchronizes by sending just the command messages which change the state. In order for this to work it is necessary for all players to start from the same initial state. Typically this means that each player must join up in a lobby before commencing play, although it is technically possible to support late join, this is not common due to the difficulty of capturing and transmitting a completely deterministic starting point in the middle of a live game.
As stated by the author that when having a p2p connection, then players should join a lobby before starting a game, not joining an ongoing game. He says that it is because it is hard transmitting a completely deterministic starting point in the middle of a live game.
Can someone please tell me why is that? Is it because there might be too much data to transfer and it might create some latency problems or is there another problem?
Upvotes: 3
Views: 401
Reputation: 42
The amount of data to be transferred is not really the biggest problem, but can definitely have an impact.
To make things a little simpler, I will give you an example on what should be done in a client/server model, i.e. players connect to a central server, which runs the game engine and sends the state of the game to the players' computers. The server's task, is to keep the clients view of the game as consistent as possible, i.e. player health/position, position of objects in the map, etc.
Let's assume that you have 7 players in the match, with an 8th looking to join the in-progress game. The server needs to ensure that the new player receive the current state of the game in a timely manner, which requires processing/network resources on the server. Not only this is challenging from a programming perspective, but it results in a spike in resource usage on the server, which can theoretically impact other processes as well as the current match itself.
In the case of a P2P game model, where the server is one of the players' machines, the issue regarding the network amplifies, as usually servers have better Internet connections compared to your average household. The above still stands.
In the case of a pure P2P model, where each machine communicates with each other directly (I don't think there are modern games that actually do this), this becomes a very challenging problem of maintaining consistency in a fully meshed distributed system.
Upvotes: 1