Advanced Godot | Deploying AdMob Ads With Godot 3.2

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi guys this is mitch with fine point cgi and today we're going to talk about admob inside of godot now this is an exciting tutorial because it allows you to monetize your android apps so we're going to do is we're going to go ahead and talk about how to make a banner ad and how to make a reward video and how to get that reward call back to actually fire off your reward so that way you can reward the player for watching your videos so that's what i have in store for you guys so let's go ahead and get started all right so we are sitting here in godot i have a new fresh project built right here ready for us to get started so the first thing that we're going to do is we're going to open up firefox and we're gonna navigate to github and go to the shin nil uh godot android admob plugin and i'm gonna have you guys go ahead and go to the releases tab and i'll leave a link to this in the description below so you guys can go ahead and click it and download it but you just go ahead and click on the version 1. or 4.1.1 and you click on that and you're going to see here this is the version we want to download so if we go ahead and click on this zip file right here click you'll see that it will come up with our admob now we're gonna go ahead and download it you'll see that it's started to download right there and then we're gonna open it up and extract it so i already have done that here let me put this into the correct location here so this is what it's going to look like when we go ahead and extract it and you can see here we have our library and our plugin now well first what we need to do is we need to come into our project in godot and we need to install our android build template now if you haven't done this before i will leave a link in the description below and also i will ping it up in the corner here to go watch my custom exports in godot tutorial which i believe we go over doing notifications in godot so you can just do the first portion of that and then you'll be able to come back here and do this so if you click install it's going to go ahead and compile and uh extract all that so if we actually right click and open in file manager you'll see when it opens it we'll have a little android thing here so if we double click on that and we open up our plugins you'll see that this plugins folder is empty so if we actually go out to our admob and we grab our admob plugin and we copy this and we paste it into here you'll see now that's there and then if we go back and we open up our admob lib folder and we copy that and then we go back into our admob main page so res main page and we paste that in here now when we click on godot you'll see suddenly we have an android folder an admob lib folder with our gd and our icon and you'll see that we have an android with plugins so first what we can do is we can go into our export settings so if we click export we add in our android now that we've opened this what we can do is we can come down here to use custom build and turn on godot admob now what that's going to do is it's going to force or it's going to include i guess admob with your godot when it compiles it and using custom build as i've explained in previous videos is it will tell godot to compile your plugins library into your godot executable so that way you can call out to java code [Music] so we're going to do is we'll scroll down and you'll see here's our unique name now you may want to specify that but right now since we're doing our test application we don't need to worry about that and i'm going to go ahead and make this a portrait app i would prefer it to be portrait app anyway so if i scroll down you'll see that there's a debug keystore user release we don't need any of that what we do need is we need network state because it has to go out to the internet to get the admob and if we scroll down we also need internet which is right here and again the reason why so it can go out to the internet and get the admob data back so what we can do now is we can hit close and we can open up a new user interface now i'm using a user interface in this case but you guys can use whatever you'd like in your project so i'll just use a user interface i'm going to right click add a child node and i will add a add mob and you will see we open up the code here we don't have any compiler errors so that's good news but something that we're going to need to do is we will need to restart godot and the reason why is because godot can be a little finicky on this so i'm going to go ahead and restart godot so go ahead and close it and then reboot it and i'll see about four seconds just as a side note since i created a new scene it's going to go ahead and ask me to save so i'm going to do that so i will call this uh add mob test scene and i will save that and then it'll close it so i'm going to go ahead and reboot this and then we can go from there okay now that godot has been rebooted what we can do is we can open up our admob test scene and you'll see that this has a little icon right here and that's how you know you did good that's how you know it's good to go so what you'll notice over here on the right is there is a banner id a interstitial id and a reward id now normally you would set this to be whatever your actual id is now i can't really show you what that would be but what you can do is you can go out here and you can go to your ad so we're going to do is we'll google search admob test ads we will in will go to enabling test ads and you'll see here that we have different ids now these ids just so happen to correlate with these ids here now i'll show you banner ad paste that in come over here interstitial video we will put an interstitial video and reward ad is right here and i will paste that in as well so now you can see that we have set up our banner ids and our banner ads so what we're going to do is we're going to do a little bit of housekeeping here and we'll go into our project settings we will set our let's see our window size to be 600 by 1024 and the reason why is just because i want it to be that way and i want it to be a keep height so that way it keeps the height of the screen for when i uh export this out to android finally what we need to do is we also need to tell it to orientate to portrait and we will close and now if i change this to be the correct size you can see right here and now i will add in a script and it'll be a gd script and we will call it uh let's see i like to call this scene controller and i will call the scene controller what scene controller is it's the thing that controls the scene and controls how everything operates now what we can do is we can say funk ready so on ready i want this to load so dollar sign admob dot load reward video now i'm not going to show you how to do an interstitial video you can go ahead and do that yourself i don't believe that they're moral or okay to to really use because you don't reward the user by watching you just interrupt them and force them to watch an ad so if you guys want to learn how to do that you can go ahead and just follow this similar similarly but i just don't i don't enjoy those kinds of content and then let's go ahead and create some buttons here so add a child node button [Music] and then let's paste the second button here all right i guess let's let's finish up the first button so we'll drag this in like so and then we will duplicate this button drag it down we'll call this banner add and we'll call this reward video and then what we're going to do is we'll go ahead and add in another child note and we'll add a text label and we'll call this reward amount and we'll put it down here and we'll go ahead and scale this up a little bit now i know there's a way to scale this up by adding a custom font and all of that but to be honest i'm too lazy to do that right off hand so what we'll do is we will apparently not scale this because i don't know how to scale to save my life there we'll just say something like i don't know something like that it's really big let's make that a little smaller like i said it's not ideal but it's just more of a of a demo so i'm just going to show you kind of how it works and we'll move this over here and then we'll duplicate this rich text label we'll drag it over a tiny bit and we'll put the text as zero all right so i know again this is not exactly ideal or perfect but it's not the point of the video of the video the videos to show you guys just how this all operates so what we're going to do is we will hook in a node here on button press down we'll double click that put it in the control node reward video we will go ahead and do on button down go to control and you'll see that here are my two uh banner ads so we'll do here are my two buttons so what we'll do here is we will go dollar sign admob dot load banner and then dollar sign admob dot show banner and the thing about the banners is that they need to load they can load immediately you don't need to load them prior to executing them whereas with reward videos you do so if i go dollar sign admob dot show reward video now this would work but we need to tell the user or tell the program that we have given it um a reward right so we've given them a reward for watching this video so what you need to do is you need to come down to our our uh admob and look at its signals so you can see here in the node signals you can check when it banner fails to load a banner is loaded an institution is closed interstitial failed to load interstitial has been loaded our reward video closed or rewarded our reward failed to load so you can get a lot of really good information from them just from this little bit here so you can actually say rewarded and let's go ahead and connect that to our control node you'll see here's our reward and what we'll do is we will create a variable up here var [Music] rew a rd reward is equal to zero right now right what you'll say is reward plus equals one and then we need to tell the text update so we go dollar sign rich text label two dot text is equal to let's cast this as a string and then do reward all right and what that should do is it should increment it buy that uh text or by that value of one so they get one coin for successfully watching the reward [Music] so now that that's done after all that setup we still have some setup to go unfortunately so we need to do is i know it's it's a lot but promise me it's totally worth it once you get there so what you need to do now that we finally have all of this in place is we need to tell our android manifest to be correct so if we go into our build and we go into our android manifest and we open that up you can see here in firefox or visual studio you can see this is your android manifest now i have a chunk of data that i have to put in here that's my application information and i like to put it here right here but you can put it anywhere in this file and it should work as long as it's inside of this little application bracket here it should be okay i'm going to put it here because i like it to be there now in this case we need to use a um i'm going to use an example id but you guys can put in your actual id here and it will uh build with your id so let me go grab that and i will paste it in so we'll paste that in and i will leave this for you guys but basically this is a test google.com gms ads application id and then the android value now if you go ahead and you look at admob and i'm gonna do a future video later that actually uses a real admob id and everything but this is just the basics on how admob operates and then we'll go from there so now now we have this we go ahead and save this and again you can put your application id here and you can go ahead and put your your android value here now these are like i said the test one same thing with the admob information over here these are all test ones you don't necessarily uh need or you do i guess you do need to put your actual ids here when you create your application so what we're going to do is we are going to export so project export android and make sure that you have this all correct so custom build is on godot admob is on i have this set to portrait and i have network state is on and internet is on so now if i go ahead and export this so let's let's peel up a few to my documents and i will replace my at my previous admob tutorial apk so we're gonna let that export and then i'm gonna go ahead and grab my phone so i'll be right back all right so now that it's done downloading or down how download now it's done compiling what we need to do is we need to turn on or plug in our phone go to file transfer so that file transfers and then we can open up our documents folder and then we can go out to our admob tutorial you'll see that this one was compiled today at uh of 119 so if we copy this and we go to our pixel 3 in my case i have a pixel 3 go to my internal storage and i paste it and replace all right now we're going to go ahead and i'm going to switch over to my phone real quick so that i can show you guys how to do this okay so now that i am in my phone i'm going to swipe up i'm going to go to files into my files and i'm going to scroll down and i'm going to go to internal storage now i'm going to scroll down and i'm going to hit admob tutorial apk so you'll see that's going to go ahead and download and install that and you'll see admob tutorial 2 was installed so if i go ahead and hit home and i flick this up you'll see i already have a previous one here so if i just uninstall that real quick you can see if i click on admob tutorial you'll see that it doesn't work now why doesn't it work well the reason why is because if we switch back over to our computer we never set our project up properly and what i mean by that is if you come over here and you look we never set up our main project if i remember correctly so let me see at least that's what i believe is wrong it's always hard for me to find where that's at so you see here our main scene is empty so if we click that and we choose our so you can see our main scene was never set so i went ahead and set it i hit close now let's go ahead and rebuild this project export export project admob yup letter build all right so now if i go ahead and i click on my documents folder and i open up my internal storage i come over here so i copy it and then i go ahead and i paste it all right now back on the phone if i click on admob tutorial i hit install you'll see it's going to overwrite my previous one i hit open and there we go so now if i click on banner the top one it does show a banner if i click the bottom you'll notice that nothing happens now why is that but if i if i close it and i reopen it you'll notice that if i click this now the reward video starts playing [Music] all right so you can see that after all of that we do have our thing and if we click on x you'll see our reward mount has been incremented hey guys so this is editor mitch uh jumping in here real quick uh something i forgot to cover was if you have a banner and you have a reward video that you want to display you can't display both of them at the same time that's something that i was alluding to earlier but i never actually talked about it but basically what you need to do is you need to hide your banner here before you show your reward video or any interstitial videos or anything like that you need to do it here like this or it doesn't work you need to hide your banner and again if you want to do an interstitial video you just basically do reward video but with interstitial videos so you can just go you know dollar sign admob dot load interstitial video right and then when you want to show it you just do the same thing so you just say like dollar sign admob dot show and if i can spell and that will show interstitial video instead so anyway i just wanted to jump in before the video cut out so that you guys were aware that i did need to add this so that i can do both just to let you guys know all right thanks guys so that's all i really have for you guys is it's that simple all it is is you import in the admob you hook up the stuff you make sure interstitial id reward id and banner id are correct you hook up your metadata here that says what your application's id is so that when it goes and fetches up to google's admob servers it actually tells you what it is and stuff or what i guess who it is so it knows who to credit with the advertisement and you just need to hook up your callbacks your signal callbacks so that way you can reward your player after watching your stuff and finally you go ahead and show banners and reward videos and give them rewards so that is all i have for you guys if you like this video go ahead and hit that like button if you dislike this video go ahead and hit that dislike button because i am here to make content for you guys and i want to know what you guys like so thanks again for watching and i'll see you all next time thanks [Music] [Music] you
Info
Channel: FinePointCGI
Views: 8,144
Rating: undefined out of 5
Keywords: godot, godot engine, godot 3.2, godot tutorial, godot android, godot admob, godot game engine, godot engine tutorial, godot engine admob modül, compile godot, admob godot, godot add admob, Advanced Godot | Deploying AdMob Ads With Godot 3.2
Id: Sv-CFGsHLUA
Channel Id: undefined
Length: 21min 47sec (1307 seconds)
Published: Mon Jan 25 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.