FPS reduces when touch screen

Hey Guys,

I’m trying to figure out why the Frames Per Second drops from 40 to 20ish as soon as I begin to use the touch device on my android tablet…I’ve been researching any workarounds, and from another thread, I noticed a quote:

PlayCanvas touch implementation seems to trigger garbage collection quite frequently

Just wondering if there is possible solutions/optimizations to this touch problem.

Can you share the project where this is happening please?

I use a cheap $50 Android tablet for each of my students (age 4-12)

At the moment it runs around 24FPS which is the minimum I want as a benchmark to teach kids how to import Classical Animated Cartoons they create into the game…

(Note: don’t touch the Blue Button)

Once a student uses draging gestures on the touch device, the fps reduces to 12-19fps

I use cheap android because the kids will take it home with them and keep it. And also, it doesn’t cost allot if it gets damaged.

Any help would be appreciated…as of now, I have an Alert message that says ‘don’t do any dragging gestures’, but only use press/tap gestures to keep fps above 24fps

  • Anton

Can you share the source project? It’s much harder to debug fully without the source unfortunately.

Does anything happen in the test scene when the user starts dragging? I can’t seem to make anything happen when I drag my finger around.

Edit: The other thing to consider is whether tablet hardware is at fault. Does this happen with any other game/app that uses a different engine/framework?

What happens when you remove all the logic in the touch callbacks? (ie is the logic in the callbacks the cause of the slowdown? Are you doing anything expensive in the callbacks?)

I’m getting a very odd display with lots of simple rectangular boxes in addition to the characters. I can drag on translucent white box in the lower left, and that controls the movement of bearded character with a sword. When I do this, the fps stays at about 60 fps. I have a relatively low powered Moto G5+ that I’m trying this on. On an older Lenovo tablet I never get to 12 fps, so can’t test the drag on that device.

BTW, on our little snowglobe app I found that dragging actually tended to improve frame rate on marginal devices (my Moto G5+). This is probably because the biggest drain on resources is the physics simulation of the snowflakes.

Getting exception errors on the current version of the published app:

I will consider sharing the source file…

As of now I have added the gamePad add-on in the settings and am using the buttons of my iPega controller that is attached via bluetooth. This is why you couldn’t see the joystick controlling on the screen as wturber clearly explained on this thread because after adding the gamePad I have disabled the 2d Screen that contains the joystick image. When I do this, the frame rate doesn’t get affected because I’m using another hardware for input into the game…for now that is a quick fix to my real world problem

Please don’t close this thread because I will still want to fix this issue without the gamePad