Why is my Mobile UI Based game so slow?

The game is very simple, and is done entirely in the UI, using VERY basic sprites, and the gameplay is simple as well. Its a puzzle game that involves sliding pieces around, like Candy Crush or 2048.

Mobile Preview is fine, but when I launch it on my phone, it is incredibly slow, and not functioning properly.

All of the other answers on how to optimize mobile games involve rendering graphics, lighting, shaders, etc. How is my simple game lagging so much?

In case you’re wondering, I built it in the UI because I needed the uniform grid, as the dimensions of the board can change, so I needed its auto size feature.

Even stuff like opening animations are slow.

If you have variables being shown on screen as text, like how many points you have and such. Every such output of text is using Tick unless built using events and fired only when needed. Documentation on this As for ui textures and sprites, every additional texture added to ui, adds draw call. Mobile devices can have hard time dealing with lots of draw calls. You should try combining ui textures in one or more sprite atlases. That way for one sprite atlas, you get only one draw calll, but atlas can hold many sprites. You would need to do a search on this, as I don’t really know how atlas thing is being done. You can start by looking into Paper 2D plugin documentation.

Thanks for the quick reply!

Right now, I’m actually not using sprites, just colored images. I’ll look into that, but would rebuilding it in actors instead of widgets be easier to do? The way it seems now seems like desperately trying to patch a sinking ship, instead of just buying a new one. What do you think?

Also, do you know if setting widgets to “hit test invisible” saves on performance? I would think so seeing as now it is not waiting on user input.

I’ts hard to say, I don’t know how your project is built, so I don’t know how to optimize it. I’m currently working on Android game myself, and I have a lot more stuff going one in my game. But this far my games fps is fairly ok. Granted I’m testing it on rather weak phone. On the Paper 2d, I found this in engine 4.13 release notes “You can now use Paper2D Sprites as Brush inputs for UMG and Slate Widgets. In addition to allowing users to reference UI art that may have been developed as a sprite sheet, it permits users to more efficiently render widgets on platforms where the draw call count budget is tight. Sprites that are part of the same texture atlas can be batched together in Slate, provided they all share the same layer when rendered.” So you maybe could try to use this trick to combine at least some of the textures into one atlas.

I don’t think that’s going to help, it just disables collision detection for that ui element. Here is documentation for optimizing mobile devices Performance Guidelines

Right now, the sprites I’m using are as simple as you can get; just a white square, and I’m using it multiple times. Does the complexity of the sprite matter? I feel like using a texture atlas to grab the same blank texture can’t make much of a difference, but correct me if I’m wrong.

Yes, in that case it probably won’t make a noticeable difference. Unreal has powerful profiling tools built in. You can capture performance data on your mobile device, transfer to pc and view in Unreal’s profiler. If you hold down four fingers on your mobile device while it’s running the game, you can access the console. Type in stat fps and it will show you the framerate and time it took to render last frame. You need to find what’s eating up the performance and then try to find a fix. Otherwise you are just shooting in the dark. Documentation on profiler

Okay, thanks, I’ve given that ago and can see the actual game is only at 15 fps. I’ll look into this more later, but even with this alone, its nice to be able to measure the progress of the tweaks that I make to try and speed it up. Thanks, again!

In case you don’t know about this. If you go to Project settings → Rendering and disable Mobile HDR, MobileMSAA. Under Default settings untick everything and disable Anti-Aliasing. This might improve frame rate and responsiveness.