Server-client comunication

Hi there, I’m developing my multiplayer game, and I’ve the following problem.

My game has lifts that are controlled by the server, they rise and fall from time to time, and I’ve two ways to do it.



First, the server sends a message with the position of the lift for each update loop, but is it inefficient?. Since if the fps of the server are 60, it is sending 60 messages for each loop to each client.



The other way to do is the server sends a message with the final position, and so the client must move the lift, but, what happens with the different fps of the clients?



Greetings to all!! Thanks

Neither way is wrong. It just depends on what you can get away with.



And it’s not really the size of the messages that you should worry about but the latency. If the server sends a message to a client then the client may not see it until 250-500 ms later on a a slow-ish connection.



If you are curious how complicated this conversation can get, read these:

Source Multiplayer Networking - Valve Developer Community

Latency Compensating Methods in Client/Server In-game Protocol Design and Optimization - Valve Developer Community



They explain all of the aspects and issues of real time networking pretty well. It may take four or five reads to really understand it, though.