I get frequent reports of players attempting and failing to join my game (RoCitizens). Their descriptions of the issue range from freezing on the Roblox map-putting-together camera to being stuck on the custom loading screen for 15+ minutes before they’re kicked (usually with an unhelpful error message). Generally they tell me that they have no problem joining other games, and that they’ve been able to join without issues in the past.
I’ve tried lowering part count, a script that phases out building interiors based on proximity, even commenting out unnecessary prints in my code. These are all shots in the dark because the truth is I have no idea what I’m looking for. Sometimes I’ll think the issue has disappeared only for it to pop back up in a few days or weeks.
The biggest clue I’ve found is that VIP servers and newly created servers - as when the game is freshly updated - have no issues at all.
So if anyone can suggest a method to diagnose/test the issue or just a concrete starting point to focus my attentions, that’d be very helpful. Thanks!
I have a problem similar to this and I’m very confused -players say that the game/chat freezes and sometimes they disconnect but it’s fine in studio and doesn’t happen to everyone
I had this issue for a couple months starting around June. The issue ended up being that the player downloaded a huge amount of data, and for a solid fraction of my userbase it took them minutes to load in and sometimes they just disconnected. I ended up lowering that amount of data(which wasn’t being given to the server pre some roblox update in June) by making all my meshes and unions collision boxes be Boxes. Whenever I inserted a model with unions in it(which I had to) on the server, the client wasn’t getting the unions themselves but was getting all of its collision data. That is an issue roblox may have fixed, Idk. Probably doesnt apply to you.
Do you perform datastore operations when players join the game that need to complete before moving past the custom loading screen? If so, you might need to measure how many reads/writes you are making for each player when they join to make sure you’re not getting throttled.
I had to migrate the game’s data from saving each player value as a separate key into a scheme where there are just three datastore keys storing tables with the actual values. Reduced the number of datastore reads from 25+ per player to 3 on join.
That’s a good theory since throttling could conceivably cause players to get stuck on the loading screen and would explain why it doesn’t happen in new/empty servers, but that wouldn’t explain the freezing or kicking. Also my loading script will display an error message for the player if it fails.
My issue could be caused by a large quantity of data having to download, but I don’t know where to start. How did you determine where the excessive data was coming from and what levels were nominal?
It took a long time and a software engineer’s help twice to figure it out. Check how much you’re downloading when you play your game. I think it was like 20MB when I had problems.
If you’re on Windows 10, you can go to Settings > Network > Data Usage, then click on “View usage details”. It shows the total bandwidth used for each program/app in your PC for the last 30 days. Note the number down for Roblox, load your place, then check how much it increased. There’s also a program called NetMonitor if you’re on other versions of Windows or need more detailed information.
Also, are you certain the users aren’t being matched into long running servers that somehow slowed down over time (accumulating spawned instances, dangling threads eating up CPU time, memory leaks, etc)? That’s another possibility to explore.
Not with the script of which you quoted my description. That simply re-parents existing models. But in general, yes. Most players have a house which they’ll import, and up to a few hundred individual furniture models will be cloned into it. These are deleted once they leave through Destroy().
@KokkuHub Thanks, I’ll give that a try. Is there really no Roblox tool for it? I know there is a readout in performance stats for network usage but that just shows a rate. And no, I’m not certain. In fact I’m becoming relatively certain that IS the case. What steps should I take to hunt that stuff down?
Had to fight a similar problem myself and I’ll start saying it’s not pleasant.
First step is going into a long running server and check the server stats using the F9 developer console. Note down RAM usage, jobs, script execution stats and compare to those from a fresh server with a similar amount of players in it. Numbers that stick out might give you some vague hint of where to start looking. For example, a large increase in Instance memory might indicate things are being spawned and never destroyed while Lua memory might indicate ever growing tables, strings and spinning threads that are never cleaned up.
Then you have to go through your scripts and identify possible culprits: which scripts spawn/clone stuff? Which ones are adding values to tables? Which ones are spawning threads? Go through each one and check if the code that was supposed to dispose of those is doing its job or if you can think up of a possible execution path that can cause it to fail. It’s like detective work.
If you have script errors being reported, even if sporadically, track and fix them! Remember, when a script throws an error its execution stack is aborted right there, leaving whatever work it was supposed to do incomplete (as well as of its caller). Keep watch of functions that can fail sometimes like anything that performs Roblox web API requests under the hood (pretty much every Roblox *async function) and wrap them around pcall() so you can trap and handle the error.
Depending on where an error happens, all sorts of things can happen that might go unnoticed but eventually build up.
For client-side freezes, capturing the loading process with on-screen profiler and pausing the profiler as soon as the freeze is over can help you find out why this is happening. I think I looked at RoCitizens very briefly a few days ago and it seemed like the freeze is in “assemble” profiler section - if this is true then this has to do with building some internal physics tree structures but we haven’t looked into why precisely it causes such a dramatic slowdown on your game. It generally should scale with the amount of welds/joints you have in your game but 10-30 seconds is clearly an anomaly.