The list of "What to do"s for a perfect performance in a Mobile Game

Hi all,
The things that really increase the performance of a mobile build that I found until now are below.
But before start, I should add this. "DON’T let any gameobject (which has complex components on it) showing in Editor Inspector before pressing the Play button. Because it may cause unbelievingly slow performance that you couldn’t even solve the reason. Editor try’s to update its information in Play mode and honestly sucks to do it.

Could you add yours, please?
1- Instead of Mono using IL2CPP as compiler and Use Incremental GC
7578046--938971--upload_2021-10-16_22-1-35.png

3- Fixed DPI
7578046--938962--upload_2021-10-16_21-57-29.png

4- Just having OpenGLES3 and usage of Linear as Color Space, on the otherhand if you don’t check “Auto Graphics API” game may crash in some devices and you really really don’t want it
7578046--938968--upload_2021-10-16_21-58-55.png

5- Being carefull with Layer interaction for Physics calculations
7578046--938974--upload_2021-10-16_22-4-29.png

and also low Default solver iterations.

6- Usage of a higher value for Fixed time steps (instead of 0.02)
7578046--938983--upload_2021-10-16_22-8-28.png

7- Baked Lightning, being careful with Shadow distance and/or completely ignore shadows

8- Camera Culling.

9- Sacrificing Post Processing and Anti-Alising :face_with_spiral_eyes::sunglasses::hushed::(:(:frowning:

10- Texture compression ASTC

11- 2k bitrate 15 FPS videos

12- Choosing shader. Yes Unlit is very performancy but it is also under my quality level. But with a right approach starting from the artist who makes the materials it can be a great choice.

13- GPU instancing and get rid of specular highlight from material options. If it doesn’t mess your model

14- Mesh compressing. Be sure that rewrite enable is unchecked (unless you know what to do)

15- Texture Compressing and resizing (512 or lowest acceptable) and actually producing textures not so much bigger than their usage size in game.

16- Refactoring. After messing your game in the learning process with a lot of unnecessary stuff you put under assets folder, starting the project from the beginning with your new level of knowledge (if you dare :smile:)

17- A Magical Word: OnDemandRendering.renderFrameInterval = 3; The result is unbelievable… but be careful your videos my flicker in that case you should back it to 0.

18- Be sure to have right import settings for mp3 files. Example picture below messages.

19- If you don’t click something in UI be sure it is not “Raycast target”

20- The amazing “Enter play mode options” check box…

21- Just to increase working speed don’t forget to use Preset manager which gives you a huge time because instead of changing imported picture audio fbx etc. settings every time, you just change the default preset (the picture of the menu is at the picture following messages).

22- Usage of URP for mobile. For me it is inevitable because graphics are awesome and even post-processing is not needed.

23- Burst compiler, really increase the performance

and Constantly disturbing Unity team to make them aware that "Unity’s Android Performance could be much much much better, why don’t you also do some upgrades that other game engines do

I would be very careful when messing with FixedUpdate time step.
Your physics might not be very stable, and frames of your moving bodies might start to be noticeable, in that case you might also reconsider interpolation of rigid bodies.

I can imagine but you should also notice that the performance increase is huge…

This is why I have not say not to do this, but to be careful.
Also performance gain depends on how much dynamic bodies collisions you are doing.

it is a tower defense game with lots of bullets and their effects…

Default Solver Iterations.
7578193--939025--upload_2021-10-16_23-37-2.png

.Net 2.0 - why? It’s old version.
C++ Master - is more profit
Graphics API : OpenGL 3.0 - you will lost 10-15% users

I didn’t say net 2.0 besides I am using net 4.0 now. But have no idea what do those mean :slight_smile:
C++ Master? What is it? I don’t think I am willing to change my language from C#
“OpenGL 3.0 - you will lost 10-15% users” if you say OpenGL 2.0 I think it is ok because if someone is using OpenGL 2.0 that means he is already not able to pay for my game.:stuck_out_tongue:

And the 5. element OnDemandRendering.renderFrameInterval = 3; The result is unbelievable.

7595002--942094--upload_2021-10-22_22-38-19.png
Be sure to have right import settings for mp3 files.

thanks for sharing such an amazing article and helpfull.


important notice this caused problem with Playfab (ha ha but true)

21- [BurstCompile] (each function instead of whole script (as far as I saw))

Why incremental GC? That causes bad performance. Incremental GC is in cases where you fucked up and have a lot of Garbage generated, but the way to fix this issue is the avoid garbage.

In fact, I think I have issues with most of the suggestions in this thread.

It is best if avoided, but if you do have garbage, it is better to have it spread over several frames than have a performance spike.

Yes, but you are paying a cost every frame to be able to do that regardless of whether your performance issues are related to Garbage piling up.

If you don’t have spikes caused the from garbage collector often enough for them to be a problem, you are making your game perform worse by enabling incremental GC.

It’s a checkbox that is really situational. It may be very beneficial in the exact situation it was designed for (which is, you have the garbage situation that is completely out of control), and it harms performance in every other situation.

I don’t see how it can belong in a list that presents itself as “here are a bunch of no brainers to do, to get good performance on mobile”. Most of the items in this list have this issue in some extend, but I think this is the worst offender.

hater.

Challenging your list makes me a hater?

Okay. I guess I can stop biting my tongue.

To any newbie that wants to make mobile game:

This list fucking sucks, don’t follow any of the points blindly, there aren’t significant performance benefits to be found here and there are multiple ways these can have weird side effects to your project you’ll have a hard time debugging.

that is completely wrong.
Even one of the simple recommendations, Fixed DPI returns as a huge FPS increase.
and ondemandrendering increases the performance 3x
What do you except more?
what you have done is only being smart pants.