What causes game related ping issues?

Hey everyone.
Recently, my game started to gain more people playing them, normally it’d stay around 8/20 playing in a server, but this time it went to about 16-18/20, which at this point issues with ping started to kick in, players were explaining how their ping was constantly spiking.

I’ve been looking into it, however I’m a bit confused on either it’s the server scripts or client scripts causing this.

1 Like

Im pretty sure those issues arent a result of physical network latency but a result of server sided lag
Unoptimized server code, tons of remote events, unanchored parts, enormous maps being streamed to clients, etc can all be major factors in killing the roblox server

I think the Unoptimized code is something pretty big, the main game code is ran through a while true do loop of 1 second which includes spawn functions as well as a coroutine.

Apart from that, I have really added Vars for everything, and just retype it such as:

game.Players:FindFirstChild("evocul")
etc than
local Players = game:GetService("Players") Players:FindFirstChild("evocul")

Do you think setting up Vars would be benefitable?

Something as small as variables is mostly just for code reliability and ease of reading/fixing/writing

Loops are also something really big I forgot to mention
RunService loops, while true do loops, etc etc and especially part movement on the server (while safer) causes so much lag its crazy

Hmm gotchu, so I’ll most likely need to recode the entire segment and have it work without a loop.
Do you think .Changed/:GetPropertyChangedSignal will cause less latency issues?

1 Like

If its instead of checking a value every frame or in a while true do end loop yeah probably