Very low fps on mobile build

For unknown reasons, the game began to freeze terribly. Very low fps 2-5. Perhaps this happened after one of the recent updates.

I tried to recreate a simple scene
If you build and run on android, you can see the result

At first this was due to the use of mesh colliders. Now it is not clear what exactly is connected with it.

There is a physicslayers file that is used to separate the collision layers. If you remove it, then the fps will normalize, but it is needed.

There could be many reasons why your Playcanvas game is experiencing low FPS on mobile devices. Here are some possible causes and solutions:

  1. High Poly Count - One of the most common causes of low FPS in games is a high polygon count. If your game has a lot of detailed models, try simplifying them or reducing their poly count.

  2. Large Textures - Large textures can also slow down your game. Try reducing the size of textures or compressing them.

  3. Inefficient Code - Poorly optimized or inefficient code can also cause low FPS. Try reviewing your code and looking for any areas that could be optimized.

  4. Hardware Limitations - Mobile devices have limited hardware resources compared to desktops, so it’s possible that the device you’re testing on simply doesn’t have enough processing power to run your game smoothly. Try testing your game on a variety of devices to see if the issue is device-specific.

  5. Playcanvas Engine - Another possibility is that the latest Playcanvas engine update has introduced performance issues. Try rolling back to an older version of the engine to see if that solves the problem.

  6. Network Issues - If your game is networked, slow network speeds or high latency can also cause low FPS. Try testing your game on a local network to see if the issue persists.

  7. Other Applications - Lastly, it’s possible that other applications running on the device are consuming too much resources, causing your game to run slowly. Try closing other applications and testing your game again.

I hope these suggestions help you diagnose and solve the problem!

1 Like
  1. No
  2. No
  3. No
  4. No
  5. Maybe
  6. No
  7. No

The game was mostly tested on PC, and more recently tested on smartphones. Therefore, there could be more than one update.
Versions 1.61.3 and 1.62.0 give the same result. Previous versions are no longer available, so there is no way to know exactly when the game started to freeze.

Hi @SARJ! I can confirm I also get the same low frame rate on my Android device (Galaxy Tab A8). On my iOS device (iPhone 14 Pro) I get a frame rate of 60. I personally have no idea what could be causing this huge difference. Hopefully someone can figure this out.


Please note that the iPhone 14 Pro is a much more powerful device compared to the Galaxy Tab A8. Unfortunately I don’t have another Android device. Which Android device do you use yourself?

1 Like

Samsung S20FE, but it happens also on other android devices.

1 Like

Albertos: Please note that the iPhone 14 Pro is a much more powerful device compared to the Galaxy Tab A8.

@Albertos, I think the reason why it runs better on the iPhone 14 is because of the relatively new hardware. Also Playcanvas has done a lot of optimization updates to make it work better on devices as such. I have the normal iPhone 14, not the pro or pro max. So all in all it should run better on newer devices with relatively new hardware. I am able to get the same frame rate on my 14, even my old android tablet was able to reach at least 35 FPS. So it mainly depends on the date of your hardware. Of course though there could be other reasons, This is just my opinion.

I think that’s an expected result on an older tablet. So the question is why am I only getting 3 FPS on a newer tablet?

Did you generate this answer with ChatGPT?

No this is based off experience. I played games from playcanvas since 2019, I started developing in 2020

1 Like

@SARJ I looked at your application. First when running on a PC I see the following.

I also see that you are preloading some scripts of which I have not gone through thoroughly yet. Did you happen to change your project from the above link? I see that some are able to load on Android and iPhone. It sounded like you have run this on a PC.

Also, I see that you have the FPS script as a different entity in your hierarchy. I usually add a component of type script in root and throw that script there. Not sure that this matters but have a look.

No. I didn’t change the project. This scene is specially made for a forum question.
I don’t get this error when I run the project.

Perhaps the “length” error occurs due to the fact that on some files, including glb, the “Preload” checkbox is unchecked.

I checked this box for desert. But it didn’t affect the FPS in any way.

Looks like it is related more with Ammo, than PlayCanvas looking at the code. The cost is deep in the WASM of Ammo

1 Like

I’m not entirely sure why Ammo is taken so much frame time for just having more physics layers (@LeXXik may know more here)

My guess is because the ground box collision is so large and is in the same space as the terrain mesh (which has a high poly count), it has to do extra logic on a per triangle basis where the ground and terrain overlap (because the terrain collision is mesh based).

Making the ground box collision size smaller so it only occupies a few polys on the terrain also doesn’t reduce the framerate.

1 Like

I don’t really know, but it should be something with the collision solving of a high poly trimesh. You can make it tile based, and test with smaller pieces and lower resolution. Huge trimeshes likes that don’t usually work well. Collision mesh is also usually lower resolution than visual mesh.

1 Like

@LeXXik I have created a test project to demonstrate the problem. The goal was not to find workarounds but to make the developers aware of this serious error and fix it.

Its a third party library issue/limitation. You can try asking the maintainer but they are likely to give you the same workarounds GitHub - kripken/ammo.js: Direct port of the Bullet physics engine to JavaScript using Emscripten

Is Bullet a better physics engine than Ammo, or is that what it is?

Ammo.js is a port of the Bullet C++ physics engine for use in the web.