GameCenter issues

Hey everyone,

I’m currently working on a new game for kids, and for the first time I’m including the game center functionality into my app. So far I was able to implement the highscore functionality (it was pretty easy actually), but I’m facing some issues when displaying the high scores with my own UI, calling the “loadScores” request method.

My problem goes the following, when the user wins a new stage I call a new setHighSocre always!, and then I don’t know how to calculate if the new value is a high score for the user or not.

Then after submitting the highscore I call the loadScores api to download the top 5 users and compare it to the current user score on the board. The issue here is that this call is not updated with the highscore right from the beginning, is like there is some kind of delay before the score gets updated, so I don’t know the new rank of the user. Does this happen to anyone? How did you fix it?

Thanks for your help, I’ll really appreciate it, I’m stuck with this issue now and scoring is the missing part one my game before test for relasing.

Hi there,

Out of curiosity, in addition to sending the new score to GameCenter, do you saved a copy of it locally on the device, i.e., in a file or database?  If you did that, then it should solve both your issues.  On the first point, you’d know whether the new score is a high score, because you can compare it to the existing high score you saved.  And on the second point, when you download the latest high scores from GameCenter, you can make sure that it has the right value for your player if it hasn’t updated yet by using the local copy you saved.

  • Andrew

Hi, I understand, I can save the hiighscore locally and compare it to the information provided by the gamecenter so everytime I can get the right information even though the game center is outdated for a couple of minutes.

I can workaround my issues as you said, then the only issue I might found is the raking for the users, if a user sets a new highscore that put him on the top, I wouldn’t know unless I keep track of all highscores on my own db, and I was hoping to use the GC to avoid duplicated functionality.

Thanks for your help, I’ll build some class that keeps track of this automatically and syncs the best scores for the user locally and I’ll share the core in the code exchange, maybe that will help someone in the future.

If anyone has any other experiences or ideas on how to workaround this issues, I’ll review them and add them to the class.

Juan Cruz

In my limited experience, the sandbox is slow.  Though loadLeaderboards always returned accurate data.  Though personally I would track that player’s personal high score locally and treat GameCenter as a destination to send scores (and don’t assume there isn’t some caching going on).    In other words your app needs to work like GameCenter isn’t there and you just send info off to GC to record it for others to see.

Hi there,

Out of curiosity, in addition to sending the new score to GameCenter, do you saved a copy of it locally on the device, i.e., in a file or database?  If you did that, then it should solve both your issues.  On the first point, you’d know whether the new score is a high score, because you can compare it to the existing high score you saved.  And on the second point, when you download the latest high scores from GameCenter, you can make sure that it has the right value for your player if it hasn’t updated yet by using the local copy you saved.

  • Andrew

Hi, I understand, I can save the hiighscore locally and compare it to the information provided by the gamecenter so everytime I can get the right information even though the game center is outdated for a couple of minutes.

I can workaround my issues as you said, then the only issue I might found is the raking for the users, if a user sets a new highscore that put him on the top, I wouldn’t know unless I keep track of all highscores on my own db, and I was hoping to use the GC to avoid duplicated functionality.

Thanks for your help, I’ll build some class that keeps track of this automatically and syncs the best scores for the user locally and I’ll share the core in the code exchange, maybe that will help someone in the future.

If anyone has any other experiences or ideas on how to workaround this issues, I’ll review them and add them to the class.

Juan Cruz

In my limited experience, the sandbox is slow.  Though loadLeaderboards always returned accurate data.  Though personally I would track that player’s personal high score locally and treat GameCenter as a destination to send scores (and don’t assume there isn’t some caching going on).    In other words your app needs to work like GameCenter isn’t there and you just send info off to GC to record it for others to see.

I’m gonna post here another Game Center issue:

I’m able to unlock same achievements unlimited times and every time the banner appears.

It should appear just for the first time, right? I set it in iTunes connect as one time achievement.

Or is it just in sandbox for testing, and on live app the unlock banner would appear only for the first time?

I’m gonna post here another Game Center issue:

I’m able to unlock same achievements unlimited times and every time the banner appears.

It should appear just for the first time, right? I set it in iTunes connect as one time achievement.

Or is it just in sandbox for testing, and on live app the unlock banner would appear only for the first time?