Achievements work like a charm in GameSalad

birdboybirdboy Member Posts: 284
edited November 2015 in Working with GS (Mac)

Hey everybody!

This was a thread about a problem with achievements unlocking repeatedly in Game Center even though they were set to non-repeatbale (is this a word?). Now it's just a thread about me being highly irritated but happy.

Thank you to everybody who took the time to write me possible solutions!

Comments

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    You could block out the code that shows the achievement is reached in the game. Then have background code that keeps reporting to gamecenter.

  • birdboybirdboy Member Posts: 284
    edited November 2015

    Maybe I'm misunderstanding you but the message that is shown in the game isn't something I made. That's Game Center telling the player that an achievement was unlocked. That's the problem - there's no way to block out the message/report to Game Center in the background, the message will always appear if an achievement is unlocked.

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276
    edited November 2015

    @Hoodloc said:
    there's no way to block out the message/report to Game Center in the background, the message will always appear if an achievement is unlocked.

    Isn´t that how it´s supposed to work?

    If you want to show / unlock the achievements, for example, at the end of a level, then set the rules so that the achievments update only at the end of the level.

    Or did i not understand the problem?

    Mental Donkey Games
    Website - Facebook - Twitter

  • birdboybirdboy Member Posts: 284
    edited November 2015

    @NipaDidIt said:
    Isn´t that how it´s supposed to work?

    If you want to show / unlock the achievements, for example, at the end of a level, then set the rules so that the achievments update only at the end of the level.

    Or did i not understand the problem?

    You're right, that's how it's supposed to work the first time you complete the level (in your example). The problem lies in the subsequent playthroughs of this level. Without any additional logic the achievement will be unlocked every time you complete this level again (for example to achieve a better score or whatever). In your example that might be tolerable but let's say you have no levels (e.g. an endless runner): every time you play there will be an increasing number of Game Center messages because you'll complete more and more achievements. The only way to fix this is by using attributes to block achievements after the first time we update their percentage to 100. But we have no callback so we have no clue if the achievement was really unlocked in Game Center.
    The player is offline while completing the achievement -> it doesn't unlock in Game Center but the game thinks it was unlocked and now blocks it from unlocking again -> the player won't be able to unlock it in Game Center at all.

  • birdboybirdboy Member Posts: 284
    edited November 2015

    To clarify my problem here's an actual example out of my game!

    There are actors on the menu screen that jump if you tap them. After tapping 42 of these actors the player unlocks the achievement 'Don't Panic, just hop!'. To track this I have one attribute that counts up to 42 and I then use the 'Update Achievement' behavior to unlock it in Game Center.

    Case 1:
    I just leave it like this.

    Problem:
    Whenever the player restarts the game and taps 42 actors the message will appear again even if the achievement was already completed in Game Center.

    Case 2:
    I add an integer (x) to my save game table and embed the 'Update Achievement' behavior in the rule 'If x = 0'. After the 'Update Achievement' behavior I change x to 1 and save the table. The behavior will not be triggered again from here on out.

    Problem:
    If this happens while the player is offline, the achievement is now blocked but wasn't unlocked in Game Center.

  • app_sauceapp_sauce Member, PRO Posts: 206

    You set that up on apple's side. When filling out the achievements on apple's dev site you can make it so the achievement can only be achieved once(i think that is the default setting). GameCenter is very simple to get working correctly from my experience. Achievements and leaderboards work very well.

    SocializeTwitter , **My Site ** **Play Loop Zen Free **iOS HERE, Google Play HERE

  • FrantoFranto Member Posts: 779
    edited November 2015

    @Hoodloc I see what your saying, and although I haven't tried out achievements yet, wouldn't you just have two booleans, one to check if your online, and the other for checking if the achievement was unlocked?

    Then even if they are offline and unlock the achievement, it will be recorded in-game. Then when you do connect online, both attributes will be true, and the in-game data will show Game center that the achievement was already unlocked, and update it as soon as you get online.

    Which means you just need an in-game system keeping track of achievements, and the data from this system is what game center will check, rather than waiting to check when the player actually gets the achievement.

    And if they are online, their achievement will be recorded in the in-game system, and then uploaded.

    But you do hint at an in-game system with your "without further logic" comment and are trying to avoid it maybe? I think playing with rules and building these systems is actually fun. B)

    Or perhaps you want to minimize the amount of rules you use though?

  • birdboybirdboy Member Posts: 284
    edited November 2015

    Okay, this is super weird. I pushed a new adhoc version to my device and now the achievements don't unlock repeatedly and I have no idea why because I didn't touch the unlocking logic at all.

    @app_sauce Like you said, that's the default setting and I didn't change that, just looked it up. For some reason they were still unlocked multiple times and now in a new adhoc version they are working perfectly fine.

    @Franto For some reason it's working now but nonetheless thank you for your advice!
    What you're saying makes perfect sense to me but I don't know a solution for checking if the user is online. That's what i meant in the opening post with no callback ... I don't know of any behavior or device attribute or anything except the new 'Request Purchase Data' one to check the user's connection. And I don't know if Apple would tolerate an app that talks to the in app purchase system if the player taps on a leaderboard button (even if this is just to test his connection status).

Sign In or Register to comment.