Why mobile games are stuttering

Why is it happening? Seems like the FPS is always ranging with no reason… the game looks great, I have a camera attached to a ball, but the background and everything in range stutters some times, no matter what I do, it keeps happening.
In the editor mobile preview everything is fine, all smooth and beatiful
I can´t record the game from my device screen to show you, but maybe someone knows what is happening. Thanks!

Anybody???

you could take a screen shot so people know wat you mean
i use Snip Tool

Hey

Sorry about the video quality, but it was the best I could here: - YouTube

But you can see in the video what I mean, thanks

anyone pls?

Yes, the game is procedural, so the track appears as the ball move forward and then the objects are all destroyed…

Everything is very simple and small. It is very strange this behavior. I can´t find a solution. But thanks anyway!

I noticed that whenever something new appears in the current level for the first time, it is loaded and the game stutters. I guess thats happening when you reach the first checkpoint/pickup in your video.

The solution would be to place everything (meshes, textures, particle emitters, sounds, …) that can appear in a level somewhere hidden, so that everything is loaded on level start and does not have to loaded on demand while the level is running.

But I don’t know what is happening at the end in the video (~30s), since I cannot make out any special occurences.

Hey Filipe,

So Procedurally generating a level on a mobile device is going to be costly in memory, especially if you are destroying and adding actors during runtime. As slarti said, having everything loaded into memory instead of procedurally generating will be your best bet to having an optimized game. It almost appears your game hitches when it is trying to create new tiles and destroy the old ones.

Could also be the garbage collector getting into action and pausing the game to clean up removed objects.

You could try to use a pooling solution, so instead of always creating/removing the map building blocks, cache them in a pool and reuse them. The one-time creation of the building blocks could happen on demand or at level start - say 10-100 blocks of every type created up front. Thus loading will happen at level start, not while the level is running.

Maybe this will also help, to see if the GC is really the culprit?