Poor performance on Android

Godot Version

4.5.1

Question

Hello,

I have a very simple game prototype which I exported to Android on my Fire Tablet 8, 2022 model. And the performance is very strange: When I enter a level, it runs at a buttery-smooth framerate. Then after some time, it drops to 30fps. And after waiting even longer, the game just freezes.

There is not much in terms of physics objects, just a rigidbody player and a couple of areas. It is especially strange that the performance starts fine and then drops, despite the fact that, looking at the profiler and monitor, not a lot else is being loaded in.

Has anyone else had this problem? Do I need to switch from Vulkan to OpenGL? Do I need to downgrade to Godot 3? Let me know if you have an answer!


Maybe you are making a lots of orphan nodes.You can see them in the profiler or use

print_orphan_nodes()
2 Likes

Alternately, you may be creating a bunch of nodes that aren’t orphaned but just hanging off the tree. You can see that in the editor by going to the Remote tab in the scene tree when the game is running.

Before blaming the Android export I would recommend trying it in the editor and exporting to your development OS (Windows/Linux/Mac) and seeing if the same thing happens there.

1 Like

Hi,

I checked, and it does not seem to be creating any more nodes.

EDIT: I just tested it on my PC. Problem is, my PC is very beefy, so there aren’t any frame drops, and my Android tablet is pretty weak. I want it to be a game that can run at 60FPS on low-end devices.

Other things to check:

  1. Are you running in Mobile or Compatibility mode? Try the other one. Compatibility mode is useful in particular for older Android devices.
  2. If you are using any GPUParticles2D/3D nodes, convert them to CPUParticles2D/3D. They GPU ones don’t work well on older mobile devices.
  3. Remove all shaders. Shaders require a GPU to run. If you’re having performance problems remove them all and add them in one-by-one like an elimination diet.
1 Like

I am using compatibility render, any particles are GPU, and I do not believe there are any shaders (this is a 2D game).

Try Mobile just in case.

Ok, so that’s likely your problem. They need to be CPU.

2D games can use canvas (2D) shaders. But if you didn’t add any to your objects you’re not using any. Unless you are using CanvasGroup nodes.

Sorry, I meant to say the particles are CPU. :person_facepalming:

The next step is to setup remote debugging so you can monitor what’s going on inside your device.

1 Like

Can you show a screenshot of the profiler?

I just did Remote Debugging. And I saw that the framerate just continues to get lower and lower. I looked through the Monitor and could not find anything that could be causing it.

And the craziest part? I decided to just load in a completely empty scene with nothing in it, and I got the SAME gradually decreasing framerate!

1 Like

60 FPS on low end Android devices will be hard and also kill battery life, FYI

2 Likes

Alright, so I decided to make a truly empty scene with nothing in it, not even a camera. And guess what? No dropping framerate. But then I added in a camera. And that caused the performance to start tanking.

This is all really good information. Nice debugging!

So my next suggestion would be to go into the Project Settings and lower the framerate from 60 to 30 and see what happens.

However the next step would be to go back and try Godot 3.6.2, the latest version of Godot 3.x - if you still want your game to run on this hardware.

3 Likes