Frame rate issue (game getting slow sometimes)

Hi,

I have a game that run at 60 fps and requires moving object and sometimes it gets slow. One thing for sure is that when my phone battery is low (about 20%) it always get slow. But at other occasions, it seems intermittent. I look at my memory usage and it seems fine to me. Here is the log from android Monitor tool.

08-31 17:57:08.616: I/Corona(11645): MEMORY = 403.521 KB TEXTURE = 0.58008193969727 MAX TEXTURE = 4096

08-31 17:57:09.616: I/Corona(11645): MEMORY = 403.521 KB TEXTURE = 0.58008193969727 MAX TEXTURE = 4096

08-31 17:57:10.636: I/Corona(11645): MEMORY = 403.521 KB TEXTURE = 0.58008193969727 MAX TEXTURE = 4096

08-31 17:57:11.646: I/Corona(11645): MEMORY = 403.521 KB TEXTURE = 0.58008193969727 MAX TEXTURE = 4096

08-31 17:57:12.646: I/Corona(11645): MEMORY = 403.521 KB TEXTURE = 0.58008193969727 MAX TEXTURE = 4096

No matter how long I play the memory will never go above 420KB and the texture stay stable too. I try to eliminate possible cause one by one, so from your experience, could this be memory problem?

Thanks,

So Lin

Hi there,

It’s not unexpected that a modern OS will throttle certain parts of the OS if the battery gets low - I certain hope that iOS does this, because I don’t want to lose out on the capacity to call someone just because some games or apps are open in the background.

It’s good that you’re memory usage is constant, and I don’t think this is the problem. Most likely your issue will be in enterFrame functions. What happens in your app / game?

Also, do you use the gyroscope or accelerometers for input?

Hi,

I don’t have gyroscope or accelerometers. I have enterFrame to move the background around my actor that use setLinearVelocity. I also have admob.

Thanks,

So Lin

Anyone?

Hi So Lin,

We really need more information to give a decent answer.

Does this also happen on other devices?

Which phone are  you using?

Could the phone be running a lot of other apps or services that might cause this?

How heavy is your game? Can you show us a video or screenshots?

Hi, generally it is always a good idea to Google your questions before posting on the forum. A quick Google search for “android phone gets slower when battery is low” resulted in plenty of reasons why this could be happening.

Hi Thomas,

I’ve replaced setLinearVelocity with delta time and it seems fine now. Being slow when the battery is low is fine. Seem like many people who run their game at 60fps face same issue.

Thanks,

So Lin

I had this issue several months ago, when you get animated ads (flash like animation) from Admob. When these banner ads run, yes my app slowed down dramatically. Once the animation stops, it’s all back to normal. 

Lately, I’ve not been seeing these ads while testing. 

I don’t show ads during gameplay. I load it at game main menu and gameover.

So Lin

Hi there,

It’s not unexpected that a modern OS will throttle certain parts of the OS if the battery gets low - I certain hope that iOS does this, because I don’t want to lose out on the capacity to call someone just because some games or apps are open in the background.

It’s good that you’re memory usage is constant, and I don’t think this is the problem. Most likely your issue will be in enterFrame functions. What happens in your app / game?

Also, do you use the gyroscope or accelerometers for input?

Hi,

I don’t have gyroscope or accelerometers. I have enterFrame to move the background around my actor that use setLinearVelocity. I also have admob.

Thanks,

So Lin

Anyone?

Hi So Lin,

We really need more information to give a decent answer.

Does this also happen on other devices?

Which phone are  you using?

Could the phone be running a lot of other apps or services that might cause this?

How heavy is your game? Can you show us a video or screenshots?

Hi, generally it is always a good idea to Google your questions before posting on the forum. A quick Google search for “android phone gets slower when battery is low” resulted in plenty of reasons why this could be happening.

Hi Thomas,

I’ve replaced setLinearVelocity with delta time and it seems fine now. Being slow when the battery is low is fine. Seem like many people who run their game at 60fps face same issue.

Thanks,

So Lin

I had this issue several months ago, when you get animated ads (flash like animation) from Admob. When these banner ads run, yes my app slowed down dramatically. Once the animation stops, it’s all back to normal. 

Lately, I’ve not been seeing these ads while testing. 

I don’t show ads during gameplay. I load it at game main menu and gameover.

So Lin