Hi guys,
I've been busy until Christmas and couldn't replace my Gideros framework with the latest one. Now i replaced it from 2012.09.2 to 2012.09.5. There is significant performance difference and i need an idea where to find the problem. I have no compilation errors or any kind of warning messages. Everything is loaded properly and the only thing i turned off /commented in the code/ is the new sound loop method. I have both IOS players installed on my device and when i start the project it runs perfectly well on 09.2 and very shaky on the new one 09.5. The frame rate is unstable going up and down. Any suggestions which of the new features might have something related to this performance difference are welcome.
Comments
I've developed a simple shoot-em up game to see if there is performance difference between 09.2 and 09.5. Up to now, I cannot see any noticeable difference. But I'm digging more.
I'm sharing the code because it contains some useful tricks that may help others such as:
- pooling to efficiently create/delete lots of bullets (~300) and explosions
- box2d for collision tests
- simple sound manager
It also contains another project (v2) that displays all bullets with a single mesh.
And if you catch anything, that'll help me a lot.
Here is a video:
Likes: plamen, fxone
Reference: http://www.giderosmobile.com/forum/discussion/comment/16919#Comment_16919
P.S Found a bug, the monster does not die, no matter how long I shoot at him )
Likes: gorkem, OZApps
Ok tested both on Android LG P500
Used Gideros Player from 9.2 version and exported apk from 9.4 and 9.5 version
Minimal fps I could get (when there are a lots of bullets both ways and I was constantly moving finger on screen) from with v1 project
So I don't know if it's coincidence that 9.5 fps dropped a little lower (I think it is coincidence, because it can't be different from 9.4 version, can it? )
All in all, visually all project seemed to run similarly and it seems to be very efficiently written, will definitely learn something from it
On Samsung S 2, v1 and v2 runs at 60 fps. On iPod touch 4th gen, v1 runs at 40 fps and v2 runs at 60 fps.
LG P500 is an armv6 device, right? damn armv6!
And yes LG P500 is armv6 device and actually it was quite playable, considering other games I've tried to play on it )
version 9.2 was 18
version 9.4 was 18
version 9.5 was 12
this is huge difference from 18 to 12 fps. I am still testing.
Yes I've rechecked on Android I have 9.2 version and could launch it from 9.4 studio
checked on 2012.2.2.2, 2012.9.2 and 2012.9.5 on iPhone 4s, and iPod touch 4. I tried with and without touching.
to get 2012.2.2.2 to run, I commented out the textureRegion methods (line 51, 52) in bulletlayer.lua. I tested against the other versions with the same code (the lines commented out).
iPhone ran at steady 60fps so I used 9 times the player bullets to bring it down to 30-ish fps, I then ran the same on the iPod touch.
iPod touch ran at variable frame rate between 14 and 35 with 2012.2.2.2 having the worst performance of the three (down to 14 fps on the Touch for 2.2.2, vs 16fps on 9.2 and 9.5). Touch events took another 2 fps on average.
So whatever problem there is, it doesn't seem to be in the example, or at least in the textureregion stuff?
It's interesting that you set the body to inactive and then nil out the body so it gets collected later by the garbage collector. Is this much more efficient than using the destroyBody function?
It would be nice to see that develop into a game... looks good
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
When you have time, can you try your game with collectgarbage("stop")?