Hi! My game Super Sabers is giving a lot of players high ping. In studios nothing lags and everything works perfectly but in public servers there are lots of delays between actions. How should I locate which script is not optimized and how to reduce lag?
This is the game:
You can check the dev console and scroll through the sections until you realise whats going on but A thats hard if you don’t know what you’re doing and B chances are you’ve got some sort of memory leak or are doing too much/little on the server.
It’s extremely hard to help because such a widespread problem could be located anywhere and everywhere within your game and as such should have been with separately.
What kind of things makes high ping? Iterations or some other thing in the code?
Also, the dev console nothing peculiar is printed and I reduced stuff in the server scripts as much as possible
The slower your game is generally the worst the ping is, however server location is typically more of a factor. However, this doesn’t mean that users should be struggling from the ping and if stuff like using weapons and abilities is laggy then that means you’ve got other problems.
1 Like
So what would be the best solution to solving this?
Solving what? You’re giving me a widespread problem which isn’t solved in 3 steps, but rather 300. At this point you’ll have to sift through all of your scripts to determine cause & relation issues to hopefully increase performance, but that’ll be an extremely hard and tedious process since I assume you have lots of scripts.
If animations, UI, etc are already handled on the client but have slow reactions then that means your game has serious memory leaks and is very different to ping, but if your game only has ping issues then it shouldnt be too big of a problem considering most games tend to have upwards of 100+ ping due to server location.
1 Like
ok, I’ll look into the scripts one by one. One last question, by memory leak you mean an object that hasn’t been destroyed when not in use, right?
Any sort of memory which is left behind once used and isn’t needed again is a memory leak, so yes
1 Like
Open the developer console and go to the different tabs (memory, scripts, serverstats) and then you probably see which scripts take the most power of the server.
(The picture is not from me, so just ignore the red arrow.)
I don’t see a problem. My ping is sitting around the 70 ms range
3 Likes
Hmm, might just be a wifi issue? I still need to look into it thought to make it optimised as possible
Well try to minimize data being sent through the server to client and client to server. Make the client do the hard work to keep it smooth on the server side. Don’t give power to the client though as that allows exploiters to enter the chat if you know what I mean.