Any way to programmatically reset leaderboards?
Asked Answered
A

1

9

As I look into documentation of GKScore and GKLeaderboard, there is no way to reset scores reported by player to particular leaderboard in GameCenter. Am I right?

This seems quite inconsistent, since it is possible to reset achievements:

[GKAchievement resetAchievementsWithCompletionHandler:^(NSError *error) { ... }];

Any thoughts?

Apocopate answered 2/9, 2011 at 19:30 Comment(1)
I'm looking for the same thing, but so far nothing. In their GameKit Programming Guide it shows how to reset Achievements, but not Leader Boards. So I guess currently it's not possible...Pizor
C
5

You are correct. There is no way to reset a Game Center leaderboard category or to remove a category once it's been launched in a live app.

Apple did allow a way to reset an achievement.

The only work around that I know of is to just allow old categories to die, resort them to the bottom, change the label associated with the category to be something like "High Score (Archived)" and then create a new one and label it "High Score" and sort it to the top. This will give you a fresh one. But of course there is still a limit of 25 leaderboard categories - so at some point you're sunk unless you just figure out how to reuse old ones. (For example, make all your scores x10 so that everyone rises up above the old scores very quickly)

EDIT... In a recent version I actually did reuse a leaderboard category in a recent app update. The original use of the category was for scores that were fairly low... in the low 1000's. The new use of the category was going to be anywhere from 10x to 1000x that. So I knew that any old scores in that category would be erased within the first couple plays of the game. OF course the category id can't change (com.company.app.category), but the description (english or otherwise) can change. It can become confusing because you're using a category that has an id of one thing when saving scores for something totally different. But with #define kBlahBlahBlah to @"com.company.app.blah" you're code can use whatever name makes it easy to keep things straight. Hope that helps.

Claim answered 21/6, 2012 at 19:32 Comment(3)
Thanks for the answer, but even this workaround does not solve the situation in which I want to reset the score only for a single player (not reset the whole leaderboard category itself).Apocopate
Technically my answer is correct though and I could use the checkmark. You asked if there was a way and there is no way.. correct answer.Claim
I just spent a long time creating my own server based high score system so that I could do what I wanted with my leaderboards, including banning cheaters and removing fake scores. I can now create them dynamically on the fly. I might eventually open my system up to other developers.Claim

© 2022 - 2024 — McMap. All rights reserved.