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:
- 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
- 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)
- 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?