Finally got the Android SDK up and running again, so I decided to give Cocos2d-x a try on Android
My first experience was with the cocos2dx-test.apk from the performance tests page. Here’s a bunch of notes to go along with it:
- As you can see, the Adreno 200 GPU really hates blending - this is a known “feature”, so that’s okay
- Adreno 200 is very slow at rendering large polygons - also known as a “feature”
- The tilemap demo contains flickering sprites on the Desire. Tiles are wobbly when moving around.
- Effect Advanced Test contains artifacts along the edges of the screen
- Render Texture Test outputs garbage, no healthy results visible here, only odd colored rectangles
- Not completely fluid, everything stutters every half a second
- When device locks while running the Cocos2d-x app, the app won’t be running again after unlocking (no good, but not important for now)
Unit tests on device: HTC Desire, Android: 2.2, cocos2dx-test.apk (0.7.1?)
Main menu 59
Process action 59
Click and move 59
Rotate world 59
Ease action 59
Motion streak 59
Draw primitives 59
Action manager 59
Tilemap 30 (iso) - 45 (ortho)
Box2d 59 (50 boxes: 54, 100 boxes: 30)
Box2d Testbed 3-59 (pyramid test was slowest)
CCTexture atlas 52-58
Label atlas 59
Sprite 59 (50 sprites: 42 fps)
Spritesheet 59 (50 sprites: 45 fps)
Sprite vs. Spritesheet animation 59
Sprite anchor point 59
Spritesheet offset + anchor + scale 59
(you may republish these results @ the performance test page if you wish, even though they may be a bit boring to look at with all the high frame counts =)
After running those tests, I was about to try a fresh build of Cosos2d-x_git (latest, built using Crystax NDK r4 + MingW patch). It ran all right on the emulator (using the ARMv5 library because it doesn’t support ARMv7), so I was being all excited about trying the ARMv7 version instead (should be faster). But the enthusiasm got tempered quickly when I discovered that even the main menu would only show up with a max of 33 frames per second. And everything looked… well, really weird.
That’s a bit odd, but hey… perhaps there was some weird agressive optimization going on, right? So, I took out the ARMv7 library and started using the ARMv5 instruction set again, like the test apk from the performance page. Should be better, right?
Each and every demo shows as if there’s a black screen between every frame update, like it’s rendering twice per frame with one good and one bad frame. Also, all sprites show up with a trail behind them. It’s quite horrible to look at. And what about smoothness? Err… let’s not go there
So now I’ve got a nice build of Cocos2d-x for Android which can only display about 30 frames per second, clears the screen with every frame and stutters while showing trails of all the sprites on screen.
My question is: is this normal behavior?
I noticed you were working on “fps control” for Android the other day, all these issues seem to have been introduced since those changes were made. Could that have anything to do with it?