Low Fps On Android Hd Devices

Hello eveybody,

 

I have a low frame rate problem when I run my app on HD Android devices with resolutions equal or higher than 1280x720. In my game the background has several layers which are constantly moving with enterFrame events. It work perfect on iOS devices and Android devices with a resolution of 800x480. The background has around 6 different enterframes working at the same time.

 

In HD Android devices I get a frame rate around 17, while in Android SD devices and iOS I get around 30 fps.

 

The background images has this resolution ( 570 x 360 ) for low resolution devices, and (1140*720 ) HD devices. This is my config.lua:

 

application = { content = { width = 320, height = 480, scale = "letterBox", xAlign = "center", yAlign = "center", imageSuffix = { ["@2x"] = 2.0 } } }

 

This is the enterFrame event I use to move the images:

 local enterFrame = function (self, event) local tDelta = event.time - self.tPrevious tDelta = tDelta \* self.speed self.tPrevious = event.time local xOffset = ( 0.1 \* tDelta ) ground1.x = ground1.x - xOffset if ground1.x \< - sizeImage - correctionX then ground1:translate( self.size , 0) end ground2.x = ground2.x - xOffset if ground2.x \< - sizeImage - correctionX then ground2:translate( self.size , 0) end end

All images of the backGround are in a Texture created with Texture Packer. 

 

Does anybody know how to get higher frame rate on HD android devices?. Is a Corona limitation?. When I increase background speed movement, the game works even worse.

 

Regards

@vfranco10, on which device are you seeing this?  

 

I also noticed that on Nexus 10, my game appears to slow down a bit, while it runs smoothly on Nexus 7.  Nexus 10 uses @4x images, while Nexus 7 uses @2x images, so I’m thinking, perhaps, Nexus 10 doesn’t have enough power to handle the higher resolution graphics…  The game runs smoothly on iPad 2 & iPad 3.  It also runs fine on android smart phones like  Galaxy SII, Galaxy SIII & Nexus 4.

 

Naomi

It happens on SG3, Galaxy Note II, and Galaxy Tab. In my case, even if it is a high resolution device, I use @2x textures ( 1140x 720 ), so the devices should have enough resources to run the game. Initially, I though the resize corona process was too expensive, because it had to convert images from 1140 x720 to 1280 x 720. However, I tried to run the game with textures of 1280 x 720, and I still have low FPS.

 

I think this problem appears in function of how much action and movement has your game. My game has a lot of action and movement. While in iOS devices it works perfect, in HD Android devices does not work smoothly. Probably is a Corona limitation, because it happened to me with other game I created. When a game is faster and plenty of action, the fps in Android goes down. 

 

@Naomi, if you have any idea about the problem, please let me know. Thank you for your answer :wink:

My latest game is a word game, and it’s not a heavy duty action oriented type game.  I do have lots of elements on screen at times (particle effects, etc.), and that perhaps, coupled with higher resolution graphics, is why Nexus 10 slows down a bit.  

 

By the way, my game uses letterbox setting.  Do you use zoom stretch? 

 

Unfortunately, I don’t have access to SG3, Galaxy Note II or Galaxy Tab, so I won’t be able to check how mine would perform on these devices…

 

Naomi

Hi @vfranco10,

This might be an issue of texture memory. If you’re using textures of 1140 x 720, that actually rounds up to a 2048 x 1024 block of texture memory, which is 4 times the amount required by the “next PoT down” of 1024 x 512. If you add in a lot of these size images, you’ll chew up texture memory rapidly, and that drags performance down to a crawl on some devices. To test this, I once tried using “@4x” images on an iPod Touch 4th-gen (which would normally use “@2x” images by my configuration), and while the app didn’t crash, the performance was unacceptable simply because I was using 4 times the texture memory that I should have been using.

 

For reference, see #8 in the blog post I recently posted, about conserving texture memory.

http://www.coronalabs.com/blog/2013/03/12/performance-optimizations/

 

Brent

@Naomi, no, I don’t use ZoomStretch, I use letterbox.

@Brent, hi Brent. First of all, thank you for your answer. Later I will read you article at the blog.

I will explain in detail my case. I am using a big texture ( 1532 x  1970 ) for HD devices  with all images of the background. I used texture packer app to pack all images in a big texture. As far as I know, in my case, when I load the texture in memory, it should use at maximum the space of 2048 x 2048, isn’t it?. Every time I load an image of the big texture, it doesn’t require an additional space because it is already loaded in memory. Please, correct me if I am wrong. Furthermore, I tried to load the low resolution textures in the Samsung galaxy III, and it still has a low FPS, that is ridiculous. I have to be doing something wrong. 

Anyway, tomorrow I will do more test. I will keep you informed.

Thanks for the answers.

@vfranco10, on which device are you seeing this?  

 

I also noticed that on Nexus 10, my game appears to slow down a bit, while it runs smoothly on Nexus 7.  Nexus 10 uses @4x images, while Nexus 7 uses @2x images, so I’m thinking, perhaps, Nexus 10 doesn’t have enough power to handle the higher resolution graphics…  The game runs smoothly on iPad 2 & iPad 3.  It also runs fine on android smart phones like  Galaxy SII, Galaxy SIII & Nexus 4.

 

Naomi

It happens on SG3, Galaxy Note II, and Galaxy Tab. In my case, even if it is a high resolution device, I use @2x textures ( 1140x 720 ), so the devices should have enough resources to run the game. Initially, I though the resize corona process was too expensive, because it had to convert images from 1140 x720 to 1280 x 720. However, I tried to run the game with textures of 1280 x 720, and I still have low FPS.

 

I think this problem appears in function of how much action and movement has your game. My game has a lot of action and movement. While in iOS devices it works perfect, in HD Android devices does not work smoothly. Probably is a Corona limitation, because it happened to me with other game I created. When a game is faster and plenty of action, the fps in Android goes down. 

 

@Naomi, if you have any idea about the problem, please let me know. Thank you for your answer :wink:

My latest game is a word game, and it’s not a heavy duty action oriented type game.  I do have lots of elements on screen at times (particle effects, etc.), and that perhaps, coupled with higher resolution graphics, is why Nexus 10 slows down a bit.  

 

By the way, my game uses letterbox setting.  Do you use zoom stretch? 

 

Unfortunately, I don’t have access to SG3, Galaxy Note II or Galaxy Tab, so I won’t be able to check how mine would perform on these devices…

 

Naomi

Hi @vfranco10,

This might be an issue of texture memory. If you’re using textures of 1140 x 720, that actually rounds up to a 2048 x 1024 block of texture memory, which is 4 times the amount required by the “next PoT down” of 1024 x 512. If you add in a lot of these size images, you’ll chew up texture memory rapidly, and that drags performance down to a crawl on some devices. To test this, I once tried using “@4x” images on an iPod Touch 4th-gen (which would normally use “@2x” images by my configuration), and while the app didn’t crash, the performance was unacceptable simply because I was using 4 times the texture memory that I should have been using.

 

For reference, see #8 in the blog post I recently posted, about conserving texture memory.

http://www.coronalabs.com/blog/2013/03/12/performance-optimizations/

 

Brent

@Naomi, no, I don’t use ZoomStretch, I use letterbox.

@Brent, hi Brent. First of all, thank you for your answer. Later I will read you article at the blog.

I will explain in detail my case. I am using a big texture ( 1532 x  1970 ) for HD devices  with all images of the background. I used texture packer app to pack all images in a big texture. As far as I know, in my case, when I load the texture in memory, it should use at maximum the space of 2048 x 2048, isn’t it?. Every time I load an image of the big texture, it doesn’t require an additional space because it is already loaded in memory. Please, correct me if I am wrong. Furthermore, I tried to load the low resolution textures in the Samsung galaxy III, and it still has a low FPS, that is ridiculous. I have to be doing something wrong. 

Anyway, tomorrow I will do more test. I will keep you informed.

Thanks for the answers.