Question

Edit 2. Added screenshot of logcat. If I reduce the number of sprites to 1, I still get this intermittent 'stop/starting' - so I don't think it's my code, as with 1 sprite my frame rate hovers around 85-90 fps. I'm guessing it's something on the phone, there are lots of things being logged by logcat so I'm assuming lots of things running in the background. Is there any way to give me app some kind of priority over other services while it's running?

Edit 1. Please see edit details at the end of the question

I've created a sprite test in which I render aprox 290 sprites.

The frames per second with 1 sprites was around 80 and with 288 it is still at about 30, the problem is that the sprites stop and start every now and then, it's not the frame rate obviously, so does anyone have idea what may be causing this? (Just to be clear it's not slow down, but rather, smooth movement for a while, then everything kind of stops for a fraction of a second, then it's back to smooth).

This also happens with one sprite on the screen - but only intermittently and every 5 seconds or so - the more sprites I add, the more it happens, but the frame rate is never dropping below 30 fps, (which I understand should be OK for smooth movement), so I'm just trying to understand what this could be.

My sprites are created out of a custom class, but there are only 3 actual objects created (the background, a sprite that moves across the screen (so I can gauge smoothness) and then 288 sprites (which are actually the same object re-used) which are rendered in batches of 6.

Thanks for any help.

The hardware is a Samsung Galaxy Ace phone.

Edit OK, so I altered by batching routine and now I'm rendering 24 sprites per call (14 calls = 336 quads + moving sprite + background = 338 quads) and am getting around 47 FPS, so I'm left wondering what could cause this 'jerky' movement apart from the GC or the frame-rate dropping too far?

enter image description here

Was it helpful?

Solution

Sounds like the garbage collector running. To verify this, just look at logcat... do the jerky moments correlate to lines tagged "dalvikvm" and lead with "GC_"?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top