Server get lags, but don't have their in studio

Good day. I have a serious problem that makes the gameplay unpleasant. This is the lags, which I do not notice in rolox studio, but when I want to check the game on the server, many lags are visible.

I tried to remove their, tried not to abuse the cycles (while true do…), deleted almost all the delay functions, but I don’t notice much difference.

Lags themselves occur mainly with particles and gui, but many other things are subject to lags.

I prepared two videos where I shoot at a wall in the studio and on the server, logically the trace of the bullet appears due to the “Remote Event” through the local script, is it possible in them?

Server Gameplay:

Studio Gameplay:

Yes, remote event lag greatly differs between studio and live games. If you go to File->Settings->Network->Incoming Replication Lag you can adjust the amount of “lag” you want to simulate in studio. This will be defaulted to 0, which makes sense as in studio you’re running both the server and the client and it should take no time at all to send and receive packets. However, in a live game the server is several hundreds if not thousands of miles away, and replication lag is inevitable. You might fire at one second, but the server will only handle your request a split second later, and a split second is unfortunately a dealbreaker in FPS games.

What I suggest you do is render the bullets and whatnot on the client, and the server should only handle hit detection. Accurate and exploiter proof hit detection is a whole nother monster itself, but I believe for the client bullet tracing this module might help:

(I haven’t actually used this so I don’t know how well it’ll suit your purposes)

2 Likes

Thank you, but the sounds affect the lags, are they also processed by the server?

Sounds, visuals, and animations should be processed on the client unless there is some really obvious evident factor that makes it better suited for the server. All the server should handle is damaging players (but first doing a reliable hit check)

2 Likes

Is it possible to simply create an event and in a script do FireAllClients(), that each client processes the sound, instead of what the server does?

Fire all clients so they can each play the sound on their end, but the shooter should still locally play the sound. Then for the shooter ignore the remote call. This way you can keep it accurate for the client and still have it exist for everyone else

1 Like