W
Wamtu
Guest
I'm trying to release my first game on Android, and I've been trying to give it Google Play Services achievements. The game in question is one of those types of games where you play as a fish and eat other fish to get bigger. During testing, I've gotten most of the achievements working, but I'm having trouble with my incremental achievements. Namely, on most of them, the progress seems to be going up twice as fast as it should be.
So far, only one of them has worked as expected. I have one for eating a total of 10,000 fish across all games. To minimize the calls to Google Play Services, I keep track of this in a local variable and just dump it into the achievement at the end of the game, like so:
After testing it, the achievement's progress went up at the rate I was expecting it to.
However, my other incremental achievements are incremented immediately, since they happen far less often. One in particular involves allowing a special enemy to escape at the end of a level 25 times (Now that I think about it...that's not a very good achievement. I really ought to replace it. Oh well. For now, it's good for testing this problem).
Here's how the code for this achievement works:
The achievement should only be going up by 4% each time (1/25 = 0.04), but instead it's going up by 8%, twice as much. There are a few other achievements which seem to have the same problem of incrementing twice as much as I want them to. What really stumps me is why the one tracking the total fish works. I even tried sending 2 instead of 1, but then it just incremented by 16%. RRGGHH!!!
Anyway, trying to figure this out has been a real pain in the neck. For all I know, it could be a problem with me, with GameMaker, or with Google Play Services. Has anyone here had experience working with incremental achievements on Google Play Services?
So far, only one of them has worked as expected. I have one for eating a total of 10,000 fish across all games. To minimize the calls to Google Play Services, I keep track of this in a local variable and just dump it into the achievement at the end of the game, like so:
Code:
achievement_increment(gp_ach_hogfish,FishEaten_Total);//Add to total amount of fish eaten.
However, my other incremental achievements are incremented immediately, since they happen far less often. One in particular involves allowing a special enemy to escape at the end of a level 25 times (Now that I think about it...that's not a very good achievement. I really ought to replace it. Oh well. For now, it's good for testing this problem).
Here's how the code for this achievement works:
Code:
///Detect successful retreat
if((x<-abs(sprite_width)&&image_index==1)
||(x>room_width+abs(sprite_width)&&image_index==1)
||(y<-abs(sprite_width)&&image_index==1)
||(y>room_height+abs(sprite_width)&&image_index==1))//Check if shark has left the playing field.
{
if(!NextLevel)
{
NextLevel=true;//Time to go to the next level.
audio_play_sound(mus_win,0,false);//Play victory jingle.
if(os_type==os_android && achievement_available())
achievement_increment(gp_ach_sharkescape,1);//Increment shark escaping achievement by one.
}
}
Anyway, trying to figure this out has been a real pain in the neck. For all I know, it could be a problem with me, with GameMaker, or with Google Play Services. Has anyone here had experience working with incremental achievements on Google Play Services?