Admob banner significant drop in frame rate

Hi to all. I’m experiencing drop on frame rate while testing the new paid admob plugin banner ads. It occurs on cycles and app starting. I set a 60 second refresh rate, but the loading cycles seem to be more frequent and longer. I suspect that it is also affecting phone heating and battery usage.
It depends, of course, on which device I’m testing. The thing is the game is pretty lightweight, and runs perfectly without the ads. It affects gameplay in my galaxy note 10 2014.
The banner is causing this, not the interstitial. Why?? I expected the opposite.

Luis

Hi Luis,

I think we’ll need to see some code before we can help. Maybe there’s some process you’re accidentally repeating in a loop or something. We haven’t received any reports similar to this before.

Thanks,

Brent

local admob = require "plugin.admob" local appID\_banner\_android = "xxx" local appID\_interstitial\_android = "xxx" local appID\_banner\_ios = "xxx" local appID\_interstitial\_ios = "xxx" local appID\_banner = appID\_banner\_ios local appID\_interstitial = appID\_interstitial\_ios if K.targetOS == "android" then appID\_banner = appID\_banner\_android appID\_interstitial = appID\_interstitial\_android end local ad = {} local testMode = false local function getY( pos ) local isTop if pos then isTop = ( pos == "top" ) else local sceneName = composer.getSceneName( "current" ) if sceneName == "scene.game" then isTop = true else isTop = false end end local y = "bottom" ad.bannerPos = "bottom" local yPos = 10000 if isTop then yPos = K.statusBarH y = K.statusBarH ad.bannerPos = "top" end return y end local function adsListener( event ) if event.phase == "init" then print( "\>AdMob event: initialization successful" ) ad.load() elseif event.phase == "displayed" then print( "\>AdMob event: " .. tostring(event.type) .. " ad displayed successfully" ) if event.type == "banner" then elseif event.type == "interstitial" then end elseif event.phase == "loaded" then print( "\>AdMob event: " .. tostring(event.type) .. " ad loaded successfully" ) if event.type == "banner" then ad.showBanner() elseif event.type == "interstitial" then end elseif event.phase == "refreshed" then print "\>AdMob event: Refreshed banner ad" elseif event.phase == "clicked" then print( "\>AdMob event: " .. tostring(event.type) .. " ad clicked/tapped by user" ) elseif event.phase == "closed" then print( "\>AdMob event: " .. tostring(event.type) .. " ad closed by user" ) ad.load() elseif event.phase == "failed" then print( "\>AdMob event: " .. tostring(event.type) .. " ad failed to load" ) end if event.isError then print( "\>\>AdMob ERROR\<\<", event.response ) end end ad.initialize = function() if K.hasAds then admob.init( adsListener, {testMode=testMode, appId=appID\_banner} ) admob.init( adsListener, {testMode=testMode, appId=appID\_interstitial} ) --Default height on simulator if K.environment=="simulator" then K.adHeight = scale.ad end end end ad.showBanner = function( pos ) if K.hasAds then print( "Showing banner" ) if admob.isLoaded( "banner" ) then local y = getY( pos ) admob.show( "banner", { y=y } ) if K.environment == "device" then ad.getHeight() else K.adHeight = scale.ad end else admob.load( "banner", { adUnitId =appID\_banner } ) end end end ad.getHeight = function() local adHeight = admob.height() K.adHeight = adHeight end ad.showInterstitial = function() if K.hasAds then if admob.isLoaded( "interstitial" ) then admob.show( "interstitial" ) else ad.load() end end end ad.load = function() if K.hasAds then if admob.isLoaded( "interstitial" ) then print( "Loading intertitial: already loaded" ) else print( "Loading intertitial" ) admob.load( "interstitial", { adUnitId =appID\_interstitial } ) end if admob.isLoaded( "banner" ) then print( "Loading banner: already loaded" ) else print( "Loading banner" ) admob.load( "banner", { adUnitId =appID\_banner } ) end end end ad.moveTo = function( pos ) if K.hasAds then admob.hide() ad.showBanner( pos ) end end return ad

I trigger the initialize function on start

 local adMob = require "lib.adMob" --Library above adMob.initialize()

The banner is displayed after it is loaded

The banner is on top on the game scene and bottom on the menu scene

There are a few things wrong with your setup.

  1. appId is not the same thing as the adUnitId. Every app has only one appId. Each app can have multiple adUnitIds. You can find the appId on the main page for your app on the AdMob dashboard. There’s a text-link near the top “View setup instructions”. Click it an you’ll see the appId for the app.
  2. You should only call admob.init() once with the appId (not the adUnitId)

Thanks for the corrections. But performance is still sluggish

Regardless of ad vendor, ads have to be downloaded from some network server. This is a CPU activity (not our GPU graphics pipeline). many factors impact the download and rendering speed of the ad and all of this is on the CPU. I can’t find the link, but Google recommends not showing banner ads when frame rate matters.

There is a second part of this that you should consider. You get paid for people tapping on banner ads. You make almost nothing from showing a banner ad. Ask your self, how often are your players going to stop, interact with a banner ad in the middle of game play?  For some games, for instance Angry Birds, Word with Friends, etc. there is time when the game isn’t doing anything (waiting to launch your bird, trying to find the right letters to use, etc.). In these type games, there is time for the player to look at the banner ad and interact with it. These are also games where loading times don’t affect game play. But if you’re building an endless runner, a platformer, a shooter of some sort, your player’s eyes are not going to look at the ads and if they do and tap on an add, they will end up with a level over/failed situation because they lost attention.  And these types of games are more CPU intensive and you’re going to feel the banner ad.

So what you end up with is an app that burns through the ad provider’s fill. It’s not helping them, it’s not helping you. You’re much better off showing an interstitial ad between levels and banners on menu screens, high score screens etc. when the game is paused and the banner ad can be effective.

Rob

Fortunately, is not an action game. It already exists, I’ll post the link. About my monetization strategy: Like you said for words with friends, it’s a game where players stare at the screen for long periods thinking about their move, and banners are being particulary effective. I also introduced interstitials, but banners are still generating more income. I’m aware that I could be getting more money than what I am getting, therefore I’m studying ways to harness the effect of the interstitial ads. The multiplayer feature I produced but not yet released will open space for that. The ads are also a way to direct the users to the paid version. But right now the banner is doing 3x of what the sells do, believe it or not. I started noting this performance issue this week while preparing the new update. I couldn’t understand how a simple banner could do more operations than the rest of the entire app. It makes me think about what kind of activities they are doing on the background and if they are all of my interest. When I browse facebook, for example, there are no lags, and it has a huge load of information to constantly get. I hoped it is somehow my mistake and fixable.https://play.google.com/store/apps/details?id=jaguargames.wordmaster2

I played and didn’t notice any lag. I’m sure if an ad pops in at the exact time you are dragging a letter or doing animations, it could stutter. It seems fine to me. That said I have really good network speeds and I was testing on a Google Nexus 9 tablet which is pretty a pretty good performer.

Rob

Update: The problem still persists, but I noticed something important: 

The frame rate drops only when the image in the banner is moving. It moves up and down during the first 20 seconds of an impression (I set 60 seconds refresh time). 

When it stops, everything goes to normal. It doesn’t occur during the loading process, I checked the events in the listener function. Even for video ads.

Another thing is that I set text only banners 48h ago but it is still showing image banners in my device. Might it be something in my code?

I’m using build 2016.3012

Luis

Animated banners can have a negative effect on frame-rate, however there’s not much that can be done about it except to do as you’ve done: Set banners to text-only. However doing so will most likely affect revenue as image banners usually pay more.

The time it takes to switch from image to text banners is out of our hands as it’s up to AdMob to make the switch. There’s nothing you need to do in your code.

Hi Luis,

I think we’ll need to see some code before we can help. Maybe there’s some process you’re accidentally repeating in a loop or something. We haven’t received any reports similar to this before.

Thanks,

Brent

local admob = require "plugin.admob" local appID\_banner\_android = "xxx" local appID\_interstitial\_android = "xxx" local appID\_banner\_ios = "xxx" local appID\_interstitial\_ios = "xxx" local appID\_banner = appID\_banner\_ios local appID\_interstitial = appID\_interstitial\_ios if K.targetOS == "android" then appID\_banner = appID\_banner\_android appID\_interstitial = appID\_interstitial\_android end local ad = {} local testMode = false local function getY( pos ) local isTop if pos then isTop = ( pos == "top" ) else local sceneName = composer.getSceneName( "current" ) if sceneName == "scene.game" then isTop = true else isTop = false end end local y = "bottom" ad.bannerPos = "bottom" local yPos = 10000 if isTop then yPos = K.statusBarH y = K.statusBarH ad.bannerPos = "top" end return y end local function adsListener( event ) if event.phase == "init" then print( "\>AdMob event: initialization successful" ) ad.load() elseif event.phase == "displayed" then print( "\>AdMob event: " .. tostring(event.type) .. " ad displayed successfully" ) if event.type == "banner" then elseif event.type == "interstitial" then end elseif event.phase == "loaded" then print( "\>AdMob event: " .. tostring(event.type) .. " ad loaded successfully" ) if event.type == "banner" then ad.showBanner() elseif event.type == "interstitial" then end elseif event.phase == "refreshed" then print "\>AdMob event: Refreshed banner ad" elseif event.phase == "clicked" then print( "\>AdMob event: " .. tostring(event.type) .. " ad clicked/tapped by user" ) elseif event.phase == "closed" then print( "\>AdMob event: " .. tostring(event.type) .. " ad closed by user" ) ad.load() elseif event.phase == "failed" then print( "\>AdMob event: " .. tostring(event.type) .. " ad failed to load" ) end if event.isError then print( "\>\>AdMob ERROR\<\<", event.response ) end end ad.initialize = function() if K.hasAds then admob.init( adsListener, {testMode=testMode, appId=appID\_banner} ) admob.init( adsListener, {testMode=testMode, appId=appID\_interstitial} ) --Default height on simulator if K.environment=="simulator" then K.adHeight = scale.ad end end end ad.showBanner = function( pos ) if K.hasAds then print( "Showing banner" ) if admob.isLoaded( "banner" ) then local y = getY( pos ) admob.show( "banner", { y=y } ) if K.environment == "device" then ad.getHeight() else K.adHeight = scale.ad end else admob.load( "banner", { adUnitId =appID\_banner } ) end end end ad.getHeight = function() local adHeight = admob.height() K.adHeight = adHeight end ad.showInterstitial = function() if K.hasAds then if admob.isLoaded( "interstitial" ) then admob.show( "interstitial" ) else ad.load() end end end ad.load = function() if K.hasAds then if admob.isLoaded( "interstitial" ) then print( "Loading intertitial: already loaded" ) else print( "Loading intertitial" ) admob.load( "interstitial", { adUnitId =appID\_interstitial } ) end if admob.isLoaded( "banner" ) then print( "Loading banner: already loaded" ) else print( "Loading banner" ) admob.load( "banner", { adUnitId =appID\_banner } ) end end end ad.moveTo = function( pos ) if K.hasAds then admob.hide() ad.showBanner( pos ) end end return ad

I trigger the initialize function on start

 local adMob = require "lib.adMob" --Library above adMob.initialize()

The banner is displayed after it is loaded

The banner is on top on the game scene and bottom on the menu scene

There are a few things wrong with your setup.

  1. appId is not the same thing as the adUnitId. Every app has only one appId. Each app can have multiple adUnitIds. You can find the appId on the main page for your app on the AdMob dashboard. There’s a text-link near the top “View setup instructions”. Click it an you’ll see the appId for the app.
  2. You should only call admob.init() once with the appId (not the adUnitId)

Thanks for the corrections. But performance is still sluggish

Regardless of ad vendor, ads have to be downloaded from some network server. This is a CPU activity (not our GPU graphics pipeline). many factors impact the download and rendering speed of the ad and all of this is on the CPU. I can’t find the link, but Google recommends not showing banner ads when frame rate matters.

There is a second part of this that you should consider. You get paid for people tapping on banner ads. You make almost nothing from showing a banner ad. Ask your self, how often are your players going to stop, interact with a banner ad in the middle of game play?  For some games, for instance Angry Birds, Word with Friends, etc. there is time when the game isn’t doing anything (waiting to launch your bird, trying to find the right letters to use, etc.). In these type games, there is time for the player to look at the banner ad and interact with it. These are also games where loading times don’t affect game play. But if you’re building an endless runner, a platformer, a shooter of some sort, your player’s eyes are not going to look at the ads and if they do and tap on an add, they will end up with a level over/failed situation because they lost attention.  And these types of games are more CPU intensive and you’re going to feel the banner ad.

So what you end up with is an app that burns through the ad provider’s fill. It’s not helping them, it’s not helping you. You’re much better off showing an interstitial ad between levels and banners on menu screens, high score screens etc. when the game is paused and the banner ad can be effective.

Rob

Fortunately, is not an action game. It already exists, I’ll post the link. About my monetization strategy: Like you said for words with friends, it’s a game where players stare at the screen for long periods thinking about their move, and banners are being particulary effective. I also introduced interstitials, but banners are still generating more income. I’m aware that I could be getting more money than what I am getting, therefore I’m studying ways to harness the effect of the interstitial ads. The multiplayer feature I produced but not yet released will open space for that. The ads are also a way to direct the users to the paid version. But right now the banner is doing 3x of what the sells do, believe it or not. I started noting this performance issue this week while preparing the new update. I couldn’t understand how a simple banner could do more operations than the rest of the entire app. It makes me think about what kind of activities they are doing on the background and if they are all of my interest. When I browse facebook, for example, there are no lags, and it has a huge load of information to constantly get. I hoped it is somehow my mistake and fixable.https://play.google.com/store/apps/details?id=jaguargames.wordmaster2