Achievements Awarded Multiple Times

allornothingallornothing Member, PRO Posts: 126
edited June 2013 in Working with GS (Mac)
*** SORRY, GS Forum Spluttered and posted twice - mods please delete the dupe! :) ***]

Hi folks

The GS Cookbook states:

"Once an achievement is unlocked and awarded via Game Center it cannot be awarded again. Even if you continue to update an achievement past 100% it will be ignored by Game Center so there is no need to add extra SAVE logic for the achievement itself."


However in my app I update an achievement at the end of each game, tallying the amount of games played. An Achievement is awarded when this value gets to 10. The progress was working fine (i.e. 4 games = 40%), and on hitting 10, the achievement popped. However, now it is awarded at the end of every game after 10 plays - every single game! Is this just a bug in the Ad Hoc builds with Sandbox mode or is this something I'm doing wrong?

Comments

  • DeadlySeriousMediaDeadlySeriousMedia ArizonaMember Posts: 838
    Also, if you earned an achievement and you change scenes, be prepared to have GC display those achievements again.

    It's a terrible bug.
  • allornothingallornothing Member, PRO Posts: 126
    edited June 2013
    Hmm, maybe this is related to that bug. Is that in final build or ad hoc/preview only?

    EDIT:

    Also some of my testers are reporting that if they don't sign in with GameCenter, the app crashes when it should be posting scores etc. This is on a change of scene, but all posting is handled on an actor spawned after the scene is loading (as per best practice I read somewhere)

    Any ideas?
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    edited June 2013
    I used GameCenter achievements in my game puck and published out of 10.3 with no issues. Something is wrong with your code. Who the heck told you to do it via a spawned actor? That is crazy. make sure you get your info from reliable veterans on the forum. Don't do that post that at end of level or whatever before change scene. Just delay the change scene by .3 seconds.
  • allornothingallornothing Member, PRO Posts: 126
    http://forums.gamesalad.com/discussion/23101/game-center-leaderboard-best-practices

    I thought this was from Dev Team? The Spawned Actor I read somewhere else, which I now can't find but I'm pretty sure it was an official source.

    Also, various sources say you shouldn't post multiple leader boards/achievements at the same time - is the solution just to delay each with a timer? If so, what kind of timing would be required? My game has several progress achievements based on accumulative attributes that need to be updated at the end of each game.
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Here is the general rule. The code is scanned in an actor every .02 seconds. So If I had say four things reporting I would use timers and report like this sequence. .02,.04,.06,.08

    I've been on GS for years and I've never seen or heard that though official documents. It may be one of those wives tales that gets passed around. I would never rely on a spawned actor to report important data as spawning is unreliable as to timing.
  • allornothingallornothing Member, PRO Posts: 126
    Thanks for the advice, very helpful - had no idea about the 0.02 second code scan!

    A slightly related question if you don't mind - I'm storing a lot of the progression values in a 'save file' table, but am I right in saying that you can't access tablecellvalue from achievement/leader board behaviors like 'Post Attribute' in GC Post Score? It has to be an attribute only/no expression?

    Currently I'm having to change a local attribute to match the saved table value, then post that local attribute to gamecenter instead - seems convoluted to me, I'd much rather my achievements just referred directly to the table row/col and cut down a bunch of middle-men-behaviours...
  • allornothingallornothing Member, PRO Posts: 126
    An update. I've published a new ad hoc build with simplified Achievement rules and having the exact same issue - I really dont thikn this is my code as I've followed things to the letter and still having the problem.

    I have an update achievement that posts a percentage (10% every game played). The progress updates correctly every game, and on 100%, the achievement pops correctly. Then every game afterwards, it pops again as if I just made 100%.

    I've read that gamecenter handles the pop ups and gifting of achievements and can't gift the same achievement twice, so I can't see how this is my code. Is it a bug with Ad Hoc? Has anyone else ever had this?

    I literally have a test button that gifts an achievement when pressed, as basic a rule as possible, and I can hit that over and over again with the same result. That shouldn't be happening!
  • DeadlySeriousMediaDeadlySeriousMedia ArizonaMember Posts: 838
    edited June 2013
    I think the problem lies in the Update Achievement behavior. Technically it's doing it's job great. It's updating the achievements. The only problem is I don't think it has anything in it telling it to disregard achievements already at 100%.

    Perhaps somethings for @codewizard and his team to look into.

    This is the main reason Flip Runner! doesn't have achievements even though I spent days putting in over 30 of them, each with custom icons.
  • allornothingallornothing Member, PRO Posts: 126
    Was there any indication that this would happen in the non-sandbox mode though? I'm in the same boat where a lot of work has went into it (and the main reason for going Pro!) and would like to ship with the features
  • KevinCrossKevinCross London, UKMember Posts: 1,894
    edited July 2013
    I don't mean to dig up old posts but I'm experiencing the same problem with one of my percentage achievements. Now that it's at a 100% it's repeating the alert every time I start a new life (which isn't a scene change). Did you find a solution?

    I was going to set up a table that stored whether or not the achievement has been achieved and skip sending an update if it has but then that would mean that if they were offline when achieving it, it'll never get updated in Game Centre.

    I suppose I could set it that if it's over 101 or 102% stop sending it to Game Centre and hope that the player would have been online before then for it to register properly.

    I was going to send my game over to Apple this week too >.<

    Edit: Closing the game completely on the phone and re-opening seems to have stopped the continuous alert. It was only the one achievement repeating, it wasn't repeating all of them. I might stick to the plan and send it over to Apple this week.
  • allornothingallornothing Member, PRO Posts: 126
    App has went live today, so i'm working through to gain the big percentage achievement and see if it happens outside of sandbox mode. Got no reply from GS on the issue, so not sure if it is one or not!
  • KevinCrossKevinCross London, UKMember Posts: 1,894
    Thanks @allornothing. Good luck with the app!
  • KevinCrossKevinCross London, UKMember Posts: 1,894
    It would appear that closing the app completely only fixed it then, it's popping back up again. It's all a bit random!

    Fingers crossed it's only a sandbox issue, along with the other issue I'm seeing where only some of them are showing an icon/image, even though on iTunes Connect they've all got the same image loaded. Might mention the image problem to Apple when I submit the binary, if there's a place to do so.
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Apple's sandbox for GameCenter is not the most reliable thing. Make sure you set the achievement to only be awarded once in iTunes connect.
Sign In or Register to comment.