What affects server average ping?

I’ve been working on optimizing my game recently, I have everything nailed down; low parts, efficient scripts with no running loops but still my game for some reason has anomaly in the average ping.

Average ping is around 100ms and can spike up to 900 easily but I’m not even sure how to test what does this. Any ideas on what could affect it?

2 Likes

Just because a script has no loops doesn’t mean it wont cause lag. You could be firing too many remotes, or what I suspect is doing too much on the server. You should offload everything you can to the client thats visual.

If you’re making a gun, do the hit detection on the server, and the sounds, parts/beams, or anything else on the client.

If you’re making a tycoon that tweens models in, only position the model on the server, while doing all the tweens on the client.

Whatever you do, never edit any UI on the server. Always use a RemoteEvent to edit any UI, even if it seems more laggy, firing a remote will be much less laggy than changing lots of UI.

But we won’t really know what the cause is without more info/scripts.

3 Likes

Normally looking from the statistics on the F9 panel I see a spike when user loads into the game after they press a deploy button, but all the button does is tween some UI from client side and fire a remote to server to load in the user’s nametag and morphs on server side