Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [BUG] Incremental achievements not working as intended

Author
Message
PSY
Developer
8
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 7th Apr 2017 21:20 Edited at: 16th Nov 2017 18:24
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


PSY LABS Games
Coders don't die, they just gosub without return
tmu
7
Years of Service
User Offline
Joined: 2nd Feb 2017
Location:
Posted: 8th Apr 2017 21:17
Yes I agree it is confusing the way it is implemented in AGK. I had the same problem with my achievements and had to recode the game to track the status by itself and submit the updated full status all the time. This is another reason why it would be very useful to at least be able to read the status of your achievements (and why not leaderboards) for the player from Gamecenter. Also, the way it is in AppGameKit now the progress for incrementals is also lost if you re-install or use another device..

Now, on the Apple system I believe there is no choice but to overwrite the value so in that sense it is consistent. But since we need to write specific code for iOS achievements and Android achievements anyway, it would not really hurt to have some option to use Google's incremental achievements as they are intended. Of course, by now, many games in AppGameKit have been written to specifically circumvent this problem and just changing the method would break these..
PSY
Developer
8
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 8th Apr 2017 21:56 Edited at: 16th Nov 2017 18:24
Quote: "Also, the way it is in AppGameKit now the progress for incrementals is also lost if you re-install or use another device.."

Yeah...


Quote: "Of course, by now, many games in AppGameKit have been written to specifically circumvent this problem and just changing the method would break these.."

Not necessarily.
Paul would just have to add another command for Google Game Center incremental achievements OR a 3rd parameter to GameCenterSubmitAchievement () which would be 0 by default / left out, and 1 when handling incremental achievements.


PSY LABS Games
Coders don't die, they just gosub without return
PSY
Developer
8
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 10th Apr 2017 17:57 Edited at: 16th Nov 2017 18:24
Any chance this is gonna get fixed in the future?

If not, I'll have to store the incremental status locally, which I wouldn't prefer really...


PSY LABS Games
Coders don't die, they just gosub without return
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 11th Apr 2017 14:25
Apple force the achievement to be set this way, so for cross platform compatibility Google is set to behave the same way. I'll see if I can add a command in future that returns the current value, but I think saving the value locally is recommended anyway in case a connection to the game services can't be made at that time.
PSY
Developer
8
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 11th Apr 2017 15:25 Edited at: 16th Nov 2017 18:24
Okay,

thanks for the info Paul


PSY LABS Games
Coders don't die, they just gosub without return

Login to post a reply

Server time is: 2024-11-24 16:48:54
Your offset time is: 2024-11-24 16:48:54