The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates. | Twitter

0 votes

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?

Godot version 3.2.3
in Engine by (1,514 points)

1 Answer

0 votes

I think that the fastest way is the NetworkedMultiplayerENet.

by (353 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.