how can i solve this multiplayer lag

So I am making a small multiplayer game to play with friends online using online subsystem for Steam. But the game always has this laggy/rubberbanding while the ping looks good.

Left is host right is client. ping in this instance was 43 when i play with friends online it is 999

I have tried to increase the maximum bandwidth but that didnt help.

If you know what is going on then please help thank you.

  • Host system specs
  • Host WAN connection quality
  • Server tick rate (hosts FPS in listen server setups)
  • Character class Tick rate
  • Network smoothing

It’s because you are running both instances on the same machine. The window that loses focus it updated at a lower rate. If you were to have two separate machines then you would see that the experience is better.

You can also try packing the game and running two instances without the engine overhead then.

You can also turn off run under one process if you are testing multiplayer. You will get a server console that may give you extra information (if you have anything not loading with assets etc)

The lag can also depend on if the the client machines are of different specs (one may be a lot weaker) & the distance between them.

Are you doing sending any network data on tick? Maybe you are saturating your bandwidth with data choking the network? How does the network transfer look while playing on 2 pc’s?

When I run it on 2 pc’s on the same and different network the host is all fine but the clients are all “lagging”. I think the problem is somewhere with the character replication that for some reason that is the problem.

my first person character:


Why are you replicating all of the sub components?

If you need to change them then use on rep notify. There is usually no need to constantly be replicating these components as their driving parameters should be replicated (like aim angle etc) and then update them locally.

I changed it thanks for the tip