Alright, I'm really frustated. I'm working on a game based on physics for 2 months and I have slowdown issues since the beginning. The slowdown is more intensive at the beginning of the layout. Restarting lower the slowdown a bit but can and will increase again. I've read Ashley 's tutorial (https://www.scirra.com/manual/134/performance-tips) and I've made some changes that improved my game a lot, regarding to memory usage and size. It didn't solved my problem though. I know that physics behavior is very cpu intensive. However, my game is really simple and never go more than 27 objects with physics at the same time, actually in the entire layout. So here are some informations that might help you to help me lol
Smarphone: Sony Xperia L.
Fps
Completly unstable, going from 20 to 50 all the time. Frequently around 30 and 40.
CPU utilization
Around 65~83%. Frequently around 75%
Object Count
Never go more than 160
Objects with physics
Rarely ever have more than 27
Colision checks
It's really low. Around 200(7 per tick) and 2000(38 per tick)
Pixel rounding = off
Sampling = Point
Window view: 1280x720
Fullscreen in browser: Scale outer
All images are in power-of-two (32x32, 64x64, 128x128 and 256x256)
[attachment=0:hdp46bxz]3213123123123.jpg[/attachment:hdp46bxz]
Topics from Ashley 's tutorial
Common causes of poor performance
These topics below isn't a problem.
-No hardware acceleration
-Changing Text objects every tick
-Inappropriate usage of the Tilemap object
More important Topics
Make sure WebGL is enabled
It's enabled
Place objects using the same blend modes or effects on the same layer
I'm doing it. However, It didn't had any effect since I'm using 3 or 4 objects with effects, and they are sporadic.
Avoid objects with large areas of transparency
All objects have 100% of opacity
Avoid large areas of overlap between objects
I've changed all my background images to achieve it. Now they are overlapping each other only enough to hide the end of the image.
If you have an opaque background, set Clear background to No in Project Properties
I've already set it to yes.
Too many objects using Physics
"You should design your games to use a few large Physics objects rather than many small Physics objects."
As I've said. I always have 27 physics objects or less. They are in different sizes and angles to follow up the curves.
Example:
[attachment=2:hdp46bxz]fisica objetos111111111.jpg[/attachment:hdp46bxz]
Creating too many objects
Again. Can't be a problem. I'm using less than 160 objects in every layout.
Using too many effects
I'm using almost no effects. This isn't a factor here.
Using too many particles
Particles isn't a problem either. I'm using it in some of my levels just recently and I'm aware of the object count in this situation and yet it's very low.
Using Sprites instead of Tiled Backgrounds
I'm using Tiled background for almost everything. In order to not have a completly square look, I'm using masks.
See:
[attachment=1:hdp46bxz]masks111111111111.jpg[/attachment:hdp46bxz]
Not placing all used objects in the layout
I don't think it's a problem. I have all objects that i'm using in all levels in one layout. On start of layout, I destroy them.
Using too many loops
Certainly not a problem.
----------
I'm sorry for this wall of text, but I'm working on this project for more than 2 months already and I have this f***ing slowdown haunting me forever. Seriously, I don't want to give up on my game (crying face \o/). I followed every single step of these tips and many others that I found. Nothing helps.