Hi, I made a test build of my game and tried it on different devices borrowed from friends.
Monitoring fps while playing, gave me an unexpected result:
On galaxy s2, 29/30 fps
On galaxy s4, 21/23 fps
On galaxy w, 21/23 fps
The game plays well on every device, and I can understand the fps drop on galaxy w, since it's not really "powerful" - also I am almost certain I made a mess here and there coding,
but I'm still learning and I was expecting it.
Since this game is turn based I can accept some lag (it just miss displaying some tweens, or freeze a bit computing certain actions, but everything else is there, working).
What I really can't understand is the reason why on the s4 it should run as laggy as on the galaxy w.. actually, it is a bit smoother (still fps display is the same) but I expected to outscore the galaxy s2 with s4.
I have garbage collection happening on 30 mb, about 20 are texture memory.
Do you have any suggestion on how to investigate this further?
Thank you!
P.
Comments
For example, I get faster FPS on an iPad 2 than an iPad Mini Retina. I think this is because iPad 2 has a fraction of pixels to shuffle around as compared to the iPad Mini Retina.
Did you notice some improvement changing the ram limit to garbage collect on different devices? I've got to try, I am just wondering.
Any other ideas to try to get higher fps readings on hd devices?
Thanks
P.
@totebo I was thinking more at the garbage collecting action, on 2gb ram devices it could occur less frequently at a higher "cap", 60/70mb?
Do you know if there is some kind of "suggested value" to call garbagecollect?
@tknoman maybe you're right too, I am moving a 20x20 isometric tile map (128x64px per tile ) composed by different layers in a "camera" object placed on stage.. I assumed that gideros already renders only objects inside screen bounds.. no?
Do you think there is a smart way to clip a tilemap? I can't use visibility since it's a big single object. Actually I can only think to do it with renderTarget but I am afraid that using it continuously could lead to even worse performance.. at least on slower devices.
In the meanwhile I had the chance to test it also on padfone 2: 17/18 fps.
I'm starting to think that this could be related to multicore devices. I need to try it on another high end single core..
I will try something tomorrow, any other suggestion/experience is appreciated
Thank you!
If you "draw" on every frame, with like at least 500x500 single object, it would drop fps greatly.
You need to carefully not to draw on every frame, or if you do use it, you must use it below 100 x 100, and it's just a single object.
Well, i always checking whenever object is out of screen bound and set it to invisible.
(If it bother you whether it's because of this or not, you can make the total of visible tile map only as big as the screen, and check whether the fps increased or not)
Other things (like memory) affect to.
I'm trying to implement this "screen bounds check" at least on the objects placed on map: what bothers me actually is the amount of checks I have to perform (almost on enterframe) since I can drag and zoom the map around with fingers.
However I tried my apk also on:
galaxy nexus - 29/30fps
Tablet nexus7 (The old one single core) - 29/30 fps and everything smoother than ever.
I'll let you know my progress
Thank you
I for example own a Xperia Play, and when developing my first android games I was very annoyed they ran at 25 FPS and did a lot to optimize coding hoping to fix it...
Until I realized that ALL games ran at 25 FPS (or 50 FPS) on my Xperia Play, after some research I found out that this is as intended, my Xperia Play is a European Version (although I bought it from USA, its carrier was Telecom Italia when I bought it, and its default language is Italian), and in Italy PAL console games, and PAL videos play at 24/25 FPS, or 50 FPS.
Probably to emulate Playstation games correctly, and to play videos there correctly, it forces that refresh rate.
iPhone on the other hand forces multiples of 15, if you game has enough power it will run at 60, otherwise 30, otherwise 15, otherwise half of 15 and so on.
This is something that people that entered games development recently rarely know, forced refresh rates was something of a issue back in SNES days... (and those are a artifact of the power grid rate... for example in countries where the power grid is 60Hz the TV sets tended to be 60Hz too, so they can refresh in sync with the power grid, and thus games for those countries ran at 60, or 30 FPS...)
[edit]: I couldn't find anything about this fps-limit, I think it was just the Xperia Play for the sake of compatibility with psGames. In addition, every device I tried was from the same country: there shouldn't be any reason for setting different fps-limit (and don't write it somewhere).
I have to admit that applying the "mod" GTween by troysandal helped A LOT on visible gtween lags on older devices ( https://github.com/troysandal/GTween )
[edit]: Every performance improvement I tried, made the game to work better ONLY on older devices: galaxyW, galaxyS2 and nexus7(old).
The problem still exists, any enlightment or suggestion of test to run to understand why this behaviour occurs is really appreciated.
thank you
I was missing something from my eclipse/ADT environment from android 4.1 to 4.4:
I made an update bringing in "almost everything" from the repository and everything went out well.
My bad, I was just looking in the wrong direction.
L-)
Thank you all