When we talk about games, of course it relates to technology because the media for playing games is using technology. So, it demands you to understand about it so that if there is a problem with it you will be able to fix it easily without having to call an expert. And now, what about game server and client configuration in Sync?
When we tried to search information about it, here is the information that we got. And hopefully, the explanation below will be able to help you in finding the answer of how you do the game server and client configuration in Sync.
According to the Dev site, articles about game client server synchronization usually refers to player client and host server as a dumb client and smart server. Have you ever played a Werewolf game or can call it a Mafia game? If so, you will see that the moderator or usually referred to as host or god is the server and the players are the clients. On that game, during the night, god asks the player their moves and the player decides what to do in their mind.
We are able to make an analogy that the night phase is when clients send their data to the server and the start of day is when they get the feedback of what happens from the server and day time is when they provide the game. The game architecture which valve refers to at the beginning of their article uses a similar concept. What are they?
- It is that client sends input to the server.
- The server validates and calculates results.
- Server sends results to clients.
- The clients provide or render the context in graphics.
Valve mentioned that it is dumb for client to not predict its move. You are able to imagine you headshot a camper and then wait for the server response to see whether he is dead or not. Well, that’s how you should design a game context. It is a context which is able to predict the result unless something else happens.
If we talk about real-time games, the first thing that you have to remember is the network latency. Latency will depend on how urgent a data needs to reach each client. Imagine that you play a chess game and then your opponent’s response reaches you 10 minutes late. Of course, you do not expect to experience it. Chess is a turn based game and it is not a real time game. Then, you can also imagine if you summon a unit in a battlefield for defence but then you see that actually they spawn 1 minute late cause response because response did not reach the server on time. And even the worse thing is that you spawn the unit and then predict it defend and after 1 minute, the server corrects your command and you see the fact that everything has been damaged.
So, as a solution for that problem, you have to bundle the commands with clock time. Somehow, clock synchronization is an advanced concept. It is able to be learnt in the Distributed Operating Systems book by Tanenbaum.
True synchronization is not possible even if your packet moves at the speed of light. It is called Einstein’s Synchronization. To make this synchronization bearable, you are able to use some techniques.
If you access the Medium site, there is an article which discusses how multiplayer games sync their state. In that article, it is written that one of the most complex issues is to keep all the player’s state in sync with the server state. In addition, it is also written that usually a program of a game needs to simulate this: the changes in an environment with respect to time players input. Game is a program which is stateful. So, it will depend on time. Let’s take an example. PACMAN is simulating an environment where ghosts will move around continuously. A multiplayer game is no exception, but the complexity is higher because of the interaction between a lot of players.
If you want to make sure that all the clients are in sync, the thing that you have to do is to let the client send updates to the server in a fixed interval. In the Medium site, you are able to see a picture which demonstrates how a client interacts with the server. Then, you are able to see in the picture on that site that it is more complicated where it shows multi-client interaction with the server. There, you are able to see that client B has a slower network connection and even though both A and B send input to the server at T0, the update from B gets the server at T2 instead of T1. So, from this we can say that the server only proceeds if it has got all of the updates which is T2. What does it mean? It means that the latency of the game is the latency of the most lagged player.
In Quora, there is a discussion related to client and server. The title of this discussion is How Do I Fix The Client and Server If They Have An Out-Of-Sync Error On A Game Hacker. Then, a user named Thu han Myo Lwin answers that the client and server out of sync error is commonly caused by trying to edit the value of a memory in the game which is temporarily saved in your device or client. And then, constantly syncing with the value saved in the server of the game. Basically, you are not able to modify the value on the server so whenever you try to modify it, it will go out of sync.
Then, another user named Jason Yeaman answers that a non-sync or error syncing means that the last session is terminated because the time specific data being compared to what is on the server is not copacetic. To fix it, you have to figure out how the files of the game are saved. If the file attributes change when it is modified, without a mechanism to put the values that the server is hoping for, you are not getting over.
That’s the information that we give to you related to the game server and client. If you need more information about it, you can visit some forums.
On my daily job, I am a software engineer, programmer & computer technician. My passion is assembling PC hardware, studying Operating System and all things related to computers technology. I also love to make short films for YouTube as a producer. More at about me…