x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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.

Product Version: UE 4.15
Tags:
more ▼

asked Apr 01 '17 at 06:03 AM in Packaging & Deployment

avatar image

Willard720
328 17 27 57

avatar image Willard720 Apr 01 '17 at 06:13 AM

Even stuff like opening animations are slow.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

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.

more ▼

answered Apr 01 '17 at 07:04 AM

avatar image

PlainBane
206 5 14 16

avatar image Willard720 Apr 01 '17 at 07:11 AM

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?

avatar image PlainBane Apr 01 '17 at 07:22 AM

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.

avatar image Willard720 Apr 02 '17 at 06:22 AM

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.

avatar image PlainBane Apr 02 '17 at 07:38 AM

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

avatar image Willard720 Apr 03 '17 at 12:44 PM

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!

avatar image PlainBane Apr 07 '17 at 02:50 PM

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.

avatar image Willard720 Apr 01 '17 at 07:21 AM

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.

avatar image PlainBane Apr 01 '17 at 07:29 AM

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

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question