Roblox game crashes for mobile users?

For some odd reason mobile players have been crashing when they join my game and its lowering my average playtime severly and I have NO idea why.

This is affecting my play count and revenue severely as I have had to shut down as mobile players where leaving dislikes due to not being able to play.

The game is a tycoon but there is only 1 set of purchases that only load in when you buy a tycoon so it cant be the models loading in. So thus I have no idea. Any help is greatly appricated.

This just begun after I updated and I have tried changing multiple scripts to no avail. I have also enabled streaming enabled and disabled multiple scripts to see what could be causing it but I have no idea.

I looked in the micro-profiler and saw this:

After doing some searching around apparently this is on roblox’s end. But why would roblox be causing a 2 second frame? The frames after it caused by me are only around the 1 second range and then slowly going down to 15ms from there…

3 Likes

Sending us a game link without any scripts isn’t helpful, do you know if any scripts that could be causing this? If so can you please paste it here?

Opening the Developer Console (F9) and checking the memory should give you an insight into what’s using the most memory. I’ve got the feeling it’s using way too much memory for phones to be able to handle.

1 Like

Without any scripts, it’s hard to debug the issue. However, I can recommend to use Streaming Enabled, which will significantly reduce lag on lower end devices.

Using @ReturnedTrue 's method to check for memory leakage is also a good idea, especially if the problem happens over time.

2 Likes

Hello, I work together with outlook on this game.

I’ve looked into the console and memory seems fine to me. A thing to mention is that this isn’t a direct crash but rather an incredibly long lag spike. Only 2 of these happen right after eachother.
You can join the game but a few frames after you joined an lag spike happens, once that is over another few frames pass by and another lag spike happens. The rest of the game runs pretty smoothly with no such lag spikes. Now I’ve noticed that these spikes also happens on PC but alot less noticeable (max 2s). Compared to mobile with took about 20 seconds.

Using the mircoprofiler I’ve also found 2 frames which took incredibly long to complete. I’ve tried searching which scripts caused this but to be honest, I have no idea how to exactly use the microprofiler.

Regarding streaming enabled. It completely skipped my head. We’ll try enabling it and see if helps. Thank you guys for the replies so far!

1 Like

Do you have anything that you’d perhaps say resource heavy that runs straight away in a LocalScript?
If so, try making it procedural by integrating intervals into it.

Is this client sided or server sided? Does the game lag for everyone synchronously?

We have located the lag to client side and not the server side.

I’ll take a look through the scripts now.

Regarding streaming enabled, the map and builds themselves are not complicated in any way.

And you’ve made sure that the memory isn’t unusually high (above 1000mb)? If it is, what parts of memory are causing it to be so high?

While it may not be high, you mentioned it occurs on low end devices, such as phones and tablets. It will help greatly to any devices as well.

The only negative to streaming enabled is if you want a custom rendering system, which is not common.

1 Like

Ill go ahead and test this and let you know if this works.

I have enabled both streaming enabled and spaced things out on the client and things still dont work…

Try decreasing the streaming radius in Workspace

With your code, we can help you much more than suggesting broad solutions. If you don’t want to give you’re code, that’s fine, but then we can’t help you very well.

If it’s a problem with your code: The above solutions won’t help much.

Its just i’m not sure which script it is, that’s the problem. If I did I would be happy to share it.

We don’t know either; Unless you give us scripts. That’s the barrier here.

If you are trying to figure them out, you can go through and disable the scripts one by one until the issue gets better. That’s the easiest option as of now.

Things that can cause issues like this can include for loops with large amounts of things to iterate through (usually with GetChildren or GetDescendants), a lot of instances being spawned at once (this is not limited to BaseParts), a lot of CFrames being set at once (including SetPrimaryPartCFrame), or just long threads of code in general. One thing that used to cause a similar problem in one of my games was actually part of the player initialization stage, where a ton of values and folders were cloned into the player when loading, not to mention the massive amounts of objects spawned to represent inventories.

So how would I even this out? Spawn a few in every second?