Hey guys,
I created a bunch of achievements for my game, all non-incremental. These are Google Game Center achievements !
I unlock them with
GameCenterSubmitAchievement ( achievement.ID, 100 ), which works just fine.
When I try to use incremental achievements, they do not work as intended.
Let's say I set up an incremental achievement in Google Play Dev Console. 5 steps are needed to unlock it.
If I use
GameCenterSubmitAchievement ( achievement[06].ID, 4 ) to unlock 4 of 5 steps, 80% are unlocked. So far so good.
But when I use another
GameCenterSubmitAchievement ( achievement[06].ID, x ), where x >0 and < 5, the achievement isn't unlocked.
Actually, the value in Google Game Center is overwritten. That's not the way incremental achievements are supposed to work. They are supposed to be incremented by the value I pass with
GameCenterSubmitAchievement.
Let's say 10 steps are needed to unlock. Each time I use GameCenterSubmitAchievement ( achievement[06].ID, 1 ), the total achievement progress should be increased by 10%.
That's what Google Play Games Services says:
Quote: "When creating an incremental achievement, you must define the total number of steps required to unlock it (this must be a number between 2 and 10,000). As the user makes progress towards unlocking the achievement, you should report the number of additional steps the user has made to the Google Play games services. Once the total number of steps reaches the unlock value, the achievement is unlocked (even if it was hidden). There's no need for you to store the user's cumulative progress."
P.S. I use TIER 1 only!
(edit) In Google Game Center, 2 different achievements are accepted:
1. Achievements that are either locked or unlocked. These can be unlocked by GameCenterSubmitAchievement ( szAchievementID, iPercentageComplete ), where iPercentageComplete
must be 100. The command is sent ONCE! After they are unlocked, any further submitting will have no effect.
2. Achievements that are incremental and unlock when a given number of steps is reached. These can be incremented by GameCenterSubmitAchievement ( szAchievementID, iNumberOfSteps ). As soon as the total number of steps the developer has set up in Google Play Dev Console is reached, they will be automatically unlocked. Any further submitting will have no effect.
@Paul
As I understand it, this function should be used to unlock standard achievements. Any value ( iPercentageComplete ) should be ignored by AppGameKit as these achievements are either locked or unlocked:
void Unlock(
std::string const & achievement_id
)
This function should be used to submit steps to incremental achievements, where iPercentageComplete should be the number of steps.
void Increment(
std::string const & achievement_id,
uint32_t steps
)
Cheers,
PSY