1
Network / Need help with simple UDP game
« on: October 23, 2011, 06:57:09 pm »
Ok, so if i smooth the positions that could give me a fluid game at 60 fps for instance while my networking is only running at 10 fps, it's indeed a wise thing to do...
But what about the latency between client and server...
For instance when the client press a key, the input is sent to the server, the server update the game state and then send the new game state to the client so he could display the new position.
When using the code above I have sometime a delay between the moment the client press the key and the moment the caracter start moving....
Do you think using another library will reduce this latency ??
Thank you for your explications with the packet that is quite useful...but what do you mean by "using sf::Socket to serialize your data" with enet, and why and how do you use it ?
If indeed using another library like enet would reduce the latency, is it too much to ask you to show me your implementation using enet ?
Thanks again,
Mat.
But what about the latency between client and server...
For instance when the client press a key, the input is sent to the server, the server update the game state and then send the new game state to the client so he could display the new position.
When using the code above I have sometime a delay between the moment the client press the key and the moment the caracter start moving....
Do you think using another library will reduce this latency ??
Thank you for your explications with the packet that is quite useful...but what do you mean by "using sf::Socket to serialize your data" with enet, and why and how do you use it ?
If indeed using another library like enet would reduce the latency, is it too much to ask you to show me your implementation using enet ?
Thanks again,
Mat.