Hello
I have created simple Multiplayer game with Unity Netcode for GameObjects.
https://vimeo.com/872446894
https://vimeo.com/872444917
While making the game, I focused on the optimization, performance and responsibility of sever and game network system.
A problem came out when I simulate the latency, jittering and packet loss.
There are two videos here.
Actions and movements are smooth in the first video. On the contrast, the actios and movements are not smooth in the second video.
I set the latency = 10 jittering = 10 and packet loss = 1 in second video.
These two videos are about local network test.
So I have some questions now.
#1. If I want to create this game for good network situation clients, what are the proper values for Latency, Jittering and Packet loss of Simulation? I want to make smooth my game in that simmulation.
I know the values are different each other in different situation. What I am saying about is the values of client which is good for online games.
#2. Only some clients are in bad network situation (high latency jittering and packet loss) in my point of view.(The reasons are long distance from server, network communication quality of a bad client…) I want to detect these bad clients and kick them out from my multiplayer system.
How can I detect them and let them leave from my server?
Thank you in advance for your advice.
-
Is easy. Good conditions means there is practically no packet loss, so set drop rate to zero. Delay (latency) is what you can reasonably expect for a player in your game. I would go for 50ms with 10 ms jitter for a desktop game. Double the numbers for mobile.
-
You wouldn‘t kick them! That would be rude! You do warn them though, like with the common turtle or hourglass icon to inform and possibly deter them from playing on this server. The only measurement you need for this is latency because jitter is irrelevant, it will come up as fluctuating latency. And packet loss naturally increases latency. Define a reasonable minimum ping for your game such as 250 ms and show the turtle icon when the connection is above the threshold, on average, for the past 1-2 seconds. You may also show another icon if latency is significantly above threshold for even short bursts to account for high packet loss happening only infrequently and shortlived.
Some games also print ping values in green, yellow, red depending on thresholds determined for the game. Fast paced action games require pings of less than 150 but for less intense games 2-3 times that may still be acceptable.
1 Like
Thank you very much for your quick and clear advice.
That’s really awesome and what I wanted exactly.
1 Like
Hello @CodeSmile
I saw a weird effect simulating the latency.
The FPS value on client went to 1040 fps when I set latency 50ms.
I checked the Quality Setting and Timeline.
Quality Level = Very low (for windows build and for other build targets)
Timeline / Default fps = 60 fps
Is this normal? I turned on the development build for network simulation
When I added this, the problem vanished
Application.targetFrameRate = 60;