Search

Google Leaderboards

Since we last spoke, I've been working on the mobile app-specific parts of my mobile app, namely integrating Unity Ads and Google Play Store features. Unity Ads were pretty easy to set up and use, but I'll talk more about those after I've found a fix for one very specific issue I'm dealing with regarding them. As for Google Play, I got lucky and found a fantastic step-by-step video tutorial, which I'm just going to link right here rather than trying to reiterate any of the process to you myself. And trust me, you're going to want to follow something for this, because there are a lot of hidden settings, confusing verbiage, and bouncing all over the Google Dev Console to find what you're looking for: https://www.youtube.com/watch?v=M6nwu00-VR4


One thing I do want to mention is that Google makes a distinction between "games" and normal "apps". My current understanding is that you have to set up an "app" for anything you plan to release, then go and set up a "game" as well if you want to use game features like leaderboards or achievements. Then you link the two together. The advantage of this is that you can set up the "game" stuff and have all the information available to implement and test it without actually having to upload a build to the "app" section, which only makes sense...otherwise you'd be uploading builds without those features just so you could get access to them!


Setting up leaderboards is just as easy as it was with Steam's API: you define the different ones online, then use the unique ID that's generated to make callbacks in your game for posting and retrieving scores. Google even provides a function that just directly displays the leaderboards, bringing up their own overlay UI frame and everything, if you want to be spared the hassle. But it's just as easy to customize using the specific callbacks, if you're like me and want everything to fit within your own theme. One small caveat is that, when requesting scores, you need to do a second callback within the first to be able to get your players' display names, since the scores are only stored natively with a gibberish user ID string. The second step uses that ID to get the player's actual name. The only other problem I faced in this process was that my scores weren't being uploaded originally, even though I'd followed the walkthrough to a T and even the callbacks were returning successfully. The issue turned out to be on my end: my specific Google Play account settings were set to not let other users see my activity...which apparently includes any high scores I set! Once I had toggled that off, everything worked like a charm.


The last thing to note is that all of the settings in both Google and Unity will need to be changed from their "test" values to "release" values instead. These are mostly to do with legal reasons, like officially signing the app or turning on real ads to start making money from them. I've read about a lot of problems people have had caused by trying to upload release builds but forgetting to make those changes. As always, the documentation could be better, but I've already got my own checklist set up for when the time comes.