Google Play Games - Score submit not working


#1

Hello,

I’m using C2 and I’m trying to submit scores to Google Play Games.

Submitting achievements works so far, which shows that I’ve set up IDs correctly. However, when I try to submit a score to a leaderboard, the trigger ‘On score submit success’ fires, but when I open the leaderboard, there is no score shown at all. That’s very odd.

I’m sure that I’ve set up the leaderboard IDs correctly, too. I also disabled tamper protection.
I also use CocoonAds, CocoonFacebook and CordovaVibration by Cranberrygames.

I’ve been working for hours now and it’s simply not working. Any ideas? Providing capx examples would be a lot work to do.


#2

Hi @jg_development

I use the Google Play plugin in my latest game and it works fine for me.
So I assume there is just a small issue in the submission code.
Did you try to log the score you want to submit to the leaderboard right befor you call “Submit Score to Leaderboard”?

Even if it’s a lot of work, but providing a test case helps me/us the most.

Thank you!

Regards
Andy


#3

Hi,

what I do is:

  • LocalStorage: Get Item
  • On item get: Submit score to leaderboard
  • Wait 1 sec
  • Open leaderboard

So it could be an issue of local storage in combination with CocoonGooglePlayGames. I will do a few more tests and if none of them works, I’ll send a test case to you.


#4

Can you test following:

  1. Check item exists
  2. if exists, get item
  3. on get item -> submit score
  4. on submitted score succeeded-> open leaderboard

Wait timers can be the issue.

Regards
Andy


#5

I managed to solve the problem. It was due to misleading design of the Google Play Games Console.

For those who are interested:
You can set up the amount of decimal places of your score in the Google Play Games Console. I chose “4” and then submitted the score in the format “0.1802”, using 4 decimal places. This is WRONG.

You need to submit scores as integers, which are then being transformed according to the decimal places you’ve set up in the Google Play Developer Console.

Maybe this hint could be mentioned in your tutorial, Andy, so others won’t make this mistake.


#6

Hi @jg_development

Thanks for letting us know :slight_smile: I’ll add a note to my tutorial :slight_smile:
Thank you!

Edit: I did add a note at the bottom :wink:
https://shatter-box.com/knowledgebase/cocoonio-how-to-build-a-game-using-construct-2/#document-12

Regards
Andy


#7