Tips to make Multiplayer movement smooth

Hi folks,
I am making an infinite runer type multiplayer game where players run away from an NPC. Everything works well, except that sometimes the players see lag spikes with characters lagging behind or “teleporting”.

Does the multiplayer behavior handle this internally?

To solve the issue, I tried to create a hidden dummy object that has the multiplayer behavior. Each dummy object is linked to their corresponding sprite, and moved using “lerp(sprite,dummy,0.2)” so the player sees a smooth character.
This didn’t work somehow and even made my code more intricate as I had to start adding variables in some events to correctly handle other events, such as collisions, etc.

Before continuing on this path I thought of asking here whether there is a better way to ensure a smooth sync of characters online.

Thanks

Hi @mreyes!

Just a question: are they a lot objects (moving) in your game?

A+
Xierra

Hi Xierra
Not really, I have two players, one “NPC” running behind them and the rest are the external layouts of the scenes with few obstacles

Ok, thanks.

I hand over to those who know multiplayer mode.

A+
Xierra

1 Like

Thanks @Amigo54 I hope someone can help with tips to make the multiplayer runners smooth