Hi,
I’ve written a simple game and am relatively new to the profiler but have been learning it the past couple of weeks. My game is a basic 2D mobile game, not graphically intense at all e.g. plain black background simple colour objects and a few shaders nothing major. There is a little bit of 2D physics going on as there are up to 60 balls that can collide and effect balance but other than that nothing much going on.
Currently testing on Android and it runs perfect on a modern phone e.g. Motorola G10 and I am hoping for a budget of 32ms or 30fps.
I wanted to bench mark on an older phone though so dug out my old Samsung Galaxy S4, I would say it is passable and playable but not nicely smooth.
On digging into the profiler and reading around what I have learned I think it may be an issue caused by having a single Canvas with everything on it, the canvas has two count down timers which are constantly updating in game and hidden panels \ buttons that appear at specific intervals e.g. end of level. There is also a score that gets updated.
Really I’m just seeking some clarification if I am reading the profiler correctly or going down a dead end, what I think is causing the spikes and framerate drop when playing is the DrawTransparentObjects method which will spike from about 1/2ms right up to near 20ms on a spike pushing my game way up to 60+ ms.
I’m thinking that if I reworked the canvas and split the constantly updating parts out like the timers and left the more static elements together e.g. pre-level notifications, end of level summary that I could bring this time down significantly.
Am I on the right track here?
*Also I have ran through and optimised a lot of other things I was doing wrong also e.g. referencing yield returns, avoiding over coding in update method, using object pools. I feel I have optimised a lot of the code and certainly noticed improvements from the reworks, but its just not enough for the older phone.
Thanks in advance!
LS