Gamecenter crashing game when posting score.

Hey,

Has anyone had this issue and fixed it?

When my game logs in to gamecenter and tries to post a score to the leaderboard it crashes. I have the post score set to update with a bunch of other attributes when the scene changes. It's worth noting that I have chartboost interstitials enabled and the crash occurs when I press the "x" on the ad.

Any advice is welcome :)

Gareth

Website » Twitter » Facebook » Loaded Arts - Fun for thumbs.

Developer Blog » 08/01/2015 - Week 72 – Apple, the great dictator…

Comments

  • LoadedLoaded Member Posts: 240

    Anyone?

    I've uploaded another version and moved the post_score to another scene and it only crashes when that scene is loaded and gamecenter is logged in now.

    I'll post the rule tonight when I am home from work.

    Website » Twitter » Facebook » Loaded Arts - Fun for thumbs.

    Developer Blog » 08/01/2015 - Week 72 – Apple, the great dictator…

  • LoadedLoaded Member Posts: 240

    Just found this via google back to the forum lol...

    http://forums.gamesalad.com/discussion/23101/game-center-leaderboard-best-practices

    Will give the timer thing a go and confirm that it works later.

    Website » Twitter » Facebook » Loaded Arts - Fun for thumbs.

    Developer Blog » 08/01/2015 - Week 72 – Apple, the great dictator…

  • LoadedLoaded Member Posts: 240
    edited February 2015

    Hey everyone (infact @The_Gamesalad_Guru might be the best bloke for the job :wink: ), still have a problem with gamecenter in my game.

    The new version with the post score wrapped in a timer as mentioned in the best leaderboard practices discussion still crashes my game.

    Here is my ITC and rule in the game, @The_Gamesalad_Guru or anyone have any idea where I am going wrong?

    Would really appreciated any help :smile:

    Gareth.

    Website » Twitter » Facebook » Loaded Arts - Fun for thumbs.

    Developer Blog » 08/01/2015 - Week 72 – Apple, the great dictator…

  • LumpAppsLumpApps Member Posts: 2,881

    Hm, I can't see why a timer is needed. I never did and it always works. The only thing I can think of is to make sure the post score fires but then it should be an for timer and with Run to completion ticked.
    Are you sure this is what crashes your game? I suggest making a new project with just a button and that behaviour. If it works then I'm pretty sure something else is going on in your app causing a crash.

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    I agree. Are you sure this is what's crashing your game?

  • LoadedLoaded Member Posts: 240

    @LumpApps said:
    Hm, I can't see why a timer is needed. I never did and it always works. The only thing I can think of is to make sure the post score fires but then it should be an for timer and with Run to completion ticked.

    Hi @LumpApps, I used the timer as when I was looking for answers to my crash problem I found this thread - http://forums.gamesalad.com/discussion/23101/game-center-leaderboard-best-practices that suggest not having the rule trigger at the start of a scene and therefore adding a timer to trigger the rule.

    @LumpApps said:
    Are you sure this is what crashes your game? I suggest making a new project with just a button and that behaviour. If it works then I'm pretty sure something else is going on in your app causing a crash.

    Yeah pretty sure. The original version was configured so that the gamecenter login triggered on the start scene and the gamecenter score posted on the game scene, both with no timers.

    If I pressed start on the start scene to go to the game scene before gamecenter had time to log in then the game scene would work with no problems and no crashes.

    If I waited for gamecenter to login on the start scene and then pressed start to head to the game scene then the game would crash when the game scene started, this is when the post score was triggering.

    @The_Gamesalad_Guru said:
    I agree. Are you sure this is what's crashing your game?

    Hi @The_Gamesalad_Guru , Yeah it's more than a coincidence considering the above and then I changed the gamecenter rules and put them in timers - both the login and post score. Again if gamecenter doesn't have time to login then the game works fine. Wait 3 seconds on the start scene and the login still worked as it did before without the timer but 3 seconds in to the game scene when the post score triggers the game freezes and then crashes.

    The game is called Pop Gun, link in this thread - http://forums.gamesalad.com/discussion/78755/pop-gun-ios-by-loaded-arts-available-now#latest

    If you have an iDevice and are willing to test it on your device to confirm the issue that would be cool.

    Really frustrating because the issue doesnt occur in AdHoc testing, only when published so I have to re-publish to test the fixes.

    Thanks to both of you for offering some help :smile:

    Gareth.

    Website » Twitter » Facebook » Loaded Arts - Fun for thumbs.

    Developer Blog » 08/01/2015 - Week 72 – Apple, the great dictator…

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    Maybe a behavior got corrupted have you tried deleting the game enter code and redoing it? I myself allow the player to determine if they want to login to gamecenter. I usually have an options button for that.

  • LoadedLoaded Member Posts: 240
    edited February 2015

    @The_Gamesalad_Guru said:
    Maybe a behavior got corrupted have you tried deleting the game enter code and redoing it? I myself allow the player to determine if they want to login to gamecenter. I usually have an options button for that.

    Will try that and update, will add the login option idea too. I'll get back to you in a fortnight once Apple have approved the update lol

    Website » Twitter » Facebook » Loaded Arts - Fun for thumbs.

    Developer Blog » 08/01/2015 - Week 72 – Apple, the great dictator…

  • LoadedLoaded Member Posts: 240

    Could it have anything to do with my pro membership lapsing?

    Website » Twitter » Facebook » Loaded Arts - Fun for thumbs.

    Developer Blog » 08/01/2015 - Week 72 – Apple, the great dictator…

Sign In or Register to comment.