The client is really delayed in contrast to the host - game is unplayable

Hi all,
i was able to build the project and play the game on host and client. But there is a really huge delay when playing on the client side. It seems that the synchronization of the state of the server with the client has a really bad delay. When moving on the client the movement takes place on the server half a second later. That makes it impossible to play the game.
Of course it’s not an big issue in an networking demo, but i have serious doubts now that mirror works as it should.
Is it normal that there is such an huge delay when playing with host+client without a dedicated server? Or is there something i can change, so that the game becomes playable?

Thanks in advance!

Hi there, sorry for the delay in this response.
I would recommend changing some settings in the network manager and transport. You can reduce the KCP Transport update interval to reduce latency. You can also try changing the server tick rate. Let me know if any of that helps.

Hi, first thank you for your response. I tried different values for both paramerters.
I set the Server Tick Rate from 30 to 60 and the KCP Transport interval from 10 to 1.
None of the settings made it really better.

Do you have any other ideas?

Once again I made a screenshot for reference.

The other thing you can check is the Network Transforms of the game objects. They will also have some settings you can play with. I’m not sure what is causing the delay since the default settings should be good enough to get playable performance on pong.

Hi! A couple months ago I had the same problem (maybe my delay is not as drastic as yours), so I started to doubt the capabilities of Mirror and I also stopped the course.
Now I decided to continue it, but the problem still persists. I tried different Unity versions and fiddling with the network settings too.
I wonder how it has such a delay when both the client and the server are on localhost.

Thanks for letting me know. I also tried different Unity versions and network settings, but the result remains the same. I paused the course, because of the same doubts you have.
So at least we have the same problem :slight_smile:

I will continue this time. My hopes are that the problem has something to do with my system setup or bad network quality. I will try it on different devices and networks to make sure.
And I would like to see what the course has to offer in terms of multiplayer development, I might be able to apply it to other networking libraries.
I checked the Unity MLAPI before, but it was still a Preview package in active development and the lack of tutorials or practical examples made it hard to implement.

A quick follow-up after I’ve done the Multiplayer Basics section:
I did the lectures to build the little multiplayer demo with the networked NavMeshAgents and I turned down the Send Interval property in the Network Transform Component to 0.01 and it looks pretty good.
Also I noticed differences between my own and the course component properties, which is probably caused by the version difference.
I checked the other example Mirror scenes and none of them really seemed to work, so I would not be surprised if the Pong example was outdated too.

3 Likes

This was really helpful, thanks! For anybody else who wants to fix the lag in this specific lesson, the game objects to look for in this scene are the Ball and Racket game objects. Update the ‘Send Interval’ on both.

2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms