fastest way to arrange server-client communication

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Andrea

Hello, i’m creating a 2d multiplayer shooter, and i’m testing it through hamachi (which is undeniably the worst case scenario) but i can’t find a solution to properly handle lag.
I tried 3 options:

  1. Unreliable rpc at every frame for position of both character and bullets. It works but the lag creates a stuttering effect due to missing packets on some frame. Really ugly to play with
  2. Reliable rpc everytime a player press a key, to communicate the starting point and motion direction of the character to the peers. After the motion direction is communicated, the character/projectiles moves without further rpc. It does not work: the signal takes way to much to be communicated (probably due to the share amount of data, i noticed my bandwidth was completely used by the game)
  3. Unreliable rpc everytime a player press a key: similar to above solution, but the signal is only sent once, therefore much faster. However when the signal does not go through it creates serious desync between peers, because the character new remote procedure is called only after the player press/release a key for a second time.

I’m not an expert of multiplayer, and I’m short of ideas, do you have any better solution?

:bust_in_silhouette: Reply From: Mxt08

I think that the fastest way is the NetworkedMultiplayerENet.