Add Android Achievements in Godot!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

I try not to self-promote too often -- it's been a few months so here's the latest. Last week I released a tutorial on adding Achievements to your android applications. In previous entries, we added basic Google Play Integration and Leaderboards. I'll be doing Admob next!

👍︎︎ 2 👤︎︎ u/ozzadar 📅︎︎ Jul 12 2021 🗫︎ replies
Captions
hey what's up guys welcome to this newest lesson on uh google play services in the godoto game engine today we're going to be going over achievements including hidden achievements incremental achievements unlocking achievements and all of that jazz and showing the achievement list so if you're interested in learning more about the google play services be sure to subscribe and also check out my other lesson series on c plus and game engine development they're very fun uh i think so anyway so without further ado let's jump into it and as always like subscribe all that crap all right so we're going to start off by uh creating our achievements in the google play console so on the left side of the screen once you choose your application so if you go to your dashboard not here you go to your google play console you'll have all your apps uh choose the one you're interested in and then on the left side go down to achievements and that's where we're gonna start so first thing we do we're just going to create some achievements first achievement we are going to say new slime welcome to the game we aren't i'm not gonna put icons for it now but just so you know you can make icons um actually i'll i'll make one for now it's gonna be terrible but we'll we'll do it for now so we'll resize this to be 512 by 512 and let's say our icon will be i don't think icons are necessary but we'll do one just so we can see what it looks like so we are going to put it in solo might slime well put them all together new folder achievements a new player okay so we got our new new player achievement icon so assets achievements new player oh pretty okay um it's not going to be incremental it's going to be a one you can see um number of points each game can have a maximum of a thousand achievement points so this one is going to be let's get let's give it five and list order it's going to be the first one all right so that'll be our first achievement boom welcome to the game beautiful now um we want more achievements right we can create more achievements yeah so there's a new slime um let's create another new achievement all right um that's good enough i'm going to see if we can uh not require an icon uh let's see it's going to be also revealed and this one's actually going to be uh 20 and it's gonna be the second one on the list so we've got two achievements right so we don't need an icon that you can leave them but you probably want to make icons eventually we're going to create a [Music] then we're going to make one hidden achievement and it's going to be incremental i believe and this one's going to be a no life the no life achievement oops achievements okay [Music] and this is going to be the no lifer it's going to be an incremental achievement and it's going to say we're going to put it 500 and we're going to make a hidden achievement and this one's going to be a full 200 points see if it's trapped okay now let's see what it looks like oh so i need to give an icon for it to be able to publish to everyone let's quickly let's quickly create some icons [Music] all right so we have all of our achievements and they're all ready to publish i believe i can i can access them now okay so the next thing we're going to do is we're going to start handling the achievements now this is going to get fairly long if i do it in here probably inside this google play and that's fine it's fine i'll just i'll just do it all down here achievements so first we need the ids so we've got a total of how many achievements we have five achievements so uh var uh newsline achievement equal and we'll fill in the blanks in a minute do this one two three four five we'll call this better advanced professional and no life all right so now i need the ids let's grab these ids so you can find the ids if you look here you can find your ids in the your achievement list itself once they're created so whoops [Music] and no life all right so those are achievement ids and in theory we don't need this page anymore so what we do need to do so first thing we need to do is we need to unlock achievements as high scores are are reached right so it should be fairly simple for most of the achievements we're going to make a couple changes to the achievements first though i think because i realized that we're not going to be able to test in the life achievement because i'm not very good so we'll try advanced juggling and what we're going to do is we're going to make this one we're going to make this one an incremental achievement and we're going to say 20 right actually you know what we can we can make them all incremental achievements right and we can we can make them all hidden too yeah well except for the first one we'll make them all hidden um so incremental this one's five and it's hidden and then so the first thing we're going to be able to test is we're going to show our achievement list which should um have one visible achievement which is just basically the first one and then a bunch of hidden achievements that are all incremental so we should be able to increment them like one by one and we'll we'll test that throughout the process and we can reset progress here so that uh that'll be good okay so that's uh done for real this time so the first thing we're going to do is we're going to show the achievement list that's going to be how we're going to do it first so where's our show leaderboard so show achievements is very very similar to the show leaderboard but this is going to be called show achievements obviously achievements and it should be show uh comments and without any idea why is it just achievements it should be show achievements okay so that will show our achievements let's go and modify um this here so uh this is our main menu our start menu and we are going to add another button let's duplicate this let's take our label let's actually move our label move that up we'll take button three and we'll actually rename this now achievement and we will move this up and we'll put a show achievements button achievements and we can probably center that better it's fine let's duplicate that and put that inside our loose menu uh will that work and we just need to move our label up you lose there we go good enough now achievements note on press we don't want to show leaderboard we want to show achievements connect and in this one here it'll be the same thing node disconnect this and change this to show achievements right and play services dot show achievements okay all right so that should work let's move this okay so let's try running that and see what happens when we try to show our achievements hopefully it works as i expected to all right so it logs in that's working okay and i don't have a show because i didn't um i didn't show the start menu again so let's restart that again and that this time it should show the start menu good now let's show achievements and what does that show boom new slime and a bunch of secrets perfect now what does this say welcome to the game so um we are going to implement some achievements now actually we're going to put one more achievement just for kicks wow so many bunks and this will be a double no life achievement [Music] there we go all right so we've we've got another achievement so the first thing we're going to do is every time we [Music] finish a round so there should be a submit score set high score label so we are doing a submit score here right so in our submit score every time we submit a score we're going to do a few things first we are going to um check if achievement unlocked right or at least should be unlocked but i think we can always uh set it and it should be fine and we are also going to do increment the double no life double no life achievement okay so first we are going to say should unlock achievement with score and increment double no life by score and we'll go down here and we will implement these functions so it's going to be funk function unlock achievement and [Music] score pass and similar thing increment double note and pass so for we'll do these one at a time or at least we'll do the first couple one at a time just so we don't uh unlock everything on the first go so the first thing we're going to do if we have if it's bigger than one then it gets a new slime achievement so if score is bigger than one here if it's bigger than one we are going to unlock the achievement so we are going to do play game play services dot unlock achievement achieve print and then new slime achievement right now in theory i believe that should work let's just make sure i typed that properly i think i did good so that should unlock our first achievement when we bonk at least one so let's uh let's try that and see what happens [Music] so we've got our achievements got a total of uh why am i missing what did i not say i did say [Music] whatever so uh let's start this we bonked once achievement unlocked new slime zero xp beautiful weird that is zero xp but it's probably because it's practice all right so that's how you unlock one achievement and now if we do it again uh we unlock one you see it submitted it again but it's not unlocking the achievement again so that worked just as intended now what we also want to do with the rest of them is we're actually going to increment everything right so what we're going to do so what we're going to do now is with one we don't need to do this but all of the rest of them if you remember we set them as uh incremental as having steps right so with steps you can either increment them or set the specific set i'm just curious what's going to happen with hidden achievements that you set steps on whether it's going to show the progress so what we're going to do is with for everything other than score one we are going to set the steps on them and i will see if setting the steps to above what above max steps unlocks the achievement so let's let's let's see what happens all right so to do that we're going to do play services so set achievement steps and here we are going to put score and we can need the achievement id and for this we are going to say better achievement and score so in theory what this is going to do is it's going to set the steps for the achievement uh if i only get one block it'll set it to one out of five if i get two it'll go to two out of five if i get more than five i it'll set it to like more than five and i think it should unlock the achievement but but let's see if not we can we can program that in so let's run that and see what happens and we'll we'll see what all the behavior does together okay so we've logged in now if we show achievements see we've unlocked one and the rest are all secret now let's start the game bonk once and lose so that should have set the steps now let's check the achievements it doesn't show it doesn't show the steps inside here okay so what we're going to do then is we are going to unsecret one so i can show you what the steps do so now we know uh steps cannot be um yeah step steps cannot be hidden so let's show achievements again uh now that i've changed it uh let's look for here we'll click detail so it refreshes the page okay um let's assume that this is going to fix itself in a bit um we'll we'll take our temporary incrementer and we will add that to the list bar temporary incrementer this and we will um set achievement steps for that one as well all right so for now let's assume that that's going to fix itself and we'll be able to see it we're never going to get to 500 or 50 so that's not an issue so what we're going to do now is we're going to try to get past five and see if it unlocks our our achievement for five i would expect that it would let's check this one more time nope nothing there so i would expect that it would so two three four five bam all right so as soon as the achievement steps reaches its goal it unlocks the achievement so you'll see here now oh look i've got there we go everything's updated now so you see here you're getting better 10 buck that's impressive so this was supposed to be 10 but it's five okay and you'll see here now that we have here we got here temporary incrementer it shows zero percent right now let's see what happens uh let's let's play some more it should be incrementing [Music] all right so now we're at nine that should show achievements now high score went to nine and our temporary incrementer went to 18 and that's what an incrementing achievement looks like and luckily it doesn't show it doesn't show the it doesn't show the icon that's excellent actually so you can give them names and but you can hide the icons which is great so i fixed that and our temporary incrementor is working fine so now that we know that we know that for all of the rest we can keep them as hidden achievements they won't see the progress but by having the steps we can do everything at once so we've got oh you're getting better is good now advanced juggling uh it's 20 steps but we can just do this advanced juggling professional and no life and that is pretty much um that's pretty much everything you need to know about achievements and we actually don't even need this increment no life because it will oh we do um because this is not go no life is not um based on high score double no life is based on total number of bonks lifetime bonds um so what this is going to be is every time you get a score it's going to add that many to your increment so i've made double no life um off screen a incrementing non-hidden achievement so you can keep track of it and we will use a different function called increment achievements which is basically the exact same thing [Music] it's the exact same function but instead of set achievement steps we are going to do increment achievement and that's it and that's going to be all of our so that's going to be all of our achievements no life it should still be incrementing um oh no it's hidden the one that we're doing is hidden so what i actually did um is i'm incrementing the the wrong friend thing so far so many bunks so that that was my problem i'm pretty sure is that i don't want to do no life i want to put no life in here [Music] and we are going to increment so many bugs uh and this is not going to be set achievement it's going to increment it's going to be a cheap okay logging in i got my data this time i show my achievements so many boxes at the top no secret everything else is fine now let's do this so many bunks and now we want need to get to 100 again so let's uh start doing that once it's released and it has all the stuff hopefully you guys will support it with a couple of downloads some good reviews some oh my god this game is so stupid i hate it so much because it's so jank like look at that that was super jack all right all right all right okay what's it showing me now one percent and that's exactly what we want so that is achievement in a nutshell now let's go over the few things i didn't go over yet so if you look at the um readme of the plugin itself you'll see there's an achievement section so we've gone over unlocked achievements but you can also obviously get the callbacks for them i don't know if there's real value in receiving these callbacks because if it's already unlocked it won't unlock again as we've been seeing increment achievements we've gone over that uh that will increment your achievement by the certain amount you've done so you for example my so many bonks achievement uh seen there is set to ten thousand so every time we play it adds a little bit more to it and once it gets to 10 000 it will unlock the achievement set achievement steps is similar to increment achievement but it sets the absolute value of them and from what i saw it doesn't go down um when we were playing with uh the temporary incrementer it wasn't going down when i got one it didn't go back down to one so uh it can go up but it can't go down uh from what i saw um you might want to test that out but again there's callback functions for all of this which are uh we'll go there reveal achievement so let's say you don't want to reveal the next achievement until you get to the next level i don't have levels so there's no real value there but let's say you have a bunch of secrets like this and the first one is level is world one and once you beat world one um you get an achievement for beating world one and you see the achievement available in world two right uh that way you don't um you can not spoil stuff you can keep spoilers behind but you can still hint at stuff i don't know how much people are looking at you at achievement lists but that's what you could do and finally if you want to make a much more stylized in-game [Music] achievement list descriptor you could call your load achievement info uh which what this will do it'll give you the current uh information as well i believe force reload here will like basically invalidate the cache and make a hard hit on the server so that's what this will do and you can get the id name description from doing that and with that finally we are done everything we want to do with achievements um i've got everything i want inside my little project here maybe i'll add some more and make them hidden and you guys can figure out what they are but as it is um yeah this is achievements in google play services as always if you enjoy this series you think that it's informative it's going to get you going where you want to go hit like subscribe all that crap and i'll see you next time
Info
Channel: Ozzadar
Views: 476
Rating: undefined out of 5
Keywords: android achievements godot, android acheivements godot, android, google play, godot, android google play, android achievements, godot achievements, godot mobile, godot android, google play godot, google play android, godot 2d, slime volleyball, android 2d, mobile achievements, mobile game development, indie game development, indie dev, game dev, gamedev, godot android game tutorial, godot android game, godot android tutorial, google play games, godot mobile app
Id: QtIZwvWBlHA
Channel Id: undefined
Length: 27min 13sec (1633 seconds)
Published: Fri Jul 09 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.