GameCenter not posting scores

pilotjoepilotjoe Member, PRO Posts: 31

I know there are several folks here who have had a similar problem mine might be slightly different.

I have a button for the leaderboard that when pressed will login to GameCenter, Post the current BestScore, then view the leaderboard. Pretty simple right?

Does anyone know if there is a problem doing this? Not sure if I have a timing issue or what. It all seems like its working however I only the leaderboard is displayed, nothing gets posted.

This happens in sandbox mode or in production.

Here is a quick snippet of my call to GC in my game

Thanks!

Comments

  • HopscotchHopscotch Member, PRO Posts: 2,782

    @pilotjoe, a touch rule is only active/valid while the user is actually touching the screen. Any loop/timer/animation/networking function will usually get interrupted as soon as the condition becomes false.

    Suggestions:

    "Platform - Show Leaderboard" should be the only behavior called this way on user action.

    "Platform - Login" and "... - Post Score" should be called by the logic of your game at appropriate times.

    Call the "Platform - Login" some time early in the game, e.g. first time the menu appears. Anytime your app is probably idle for a few seconds. This behavior is not so critical though, if it fails, the "... - Post Score" behavior will perform a login itself, take a fraction of a second longer though.

    The "... - Post Score" behavior is the critical one. Always wrap it in a "Timer after 0 seconds - Run to comletion". Also call it in the flow of the game as soon as possible, giving time to complete before a change scene may happen.

    To illustrate:

    1. Hero dies
    2. Calculate score
    3. Post to Leader boards
    4. Play death animation
    5. Change scene to display score
  • pilotjoepilotjoe Member, PRO Posts: 31

    @Hopscotch Thanks! I didn't know any of this. I don't think its really documented anywhere either, at least no where that I've found. This is fantastic. I made the changes you suggested and it works perfectly!

    I was already thinking about moving the login to the main splash screen that way everyone is logged in as soon as the game starts. I wrapped the login in a timer too to make it more consistent every time.

    Now I just have to wait for the iAds fix and I'm good to go. I think I may push an update without iAds just to fix this bug .. then push again when iAds is fixed. It also gives me an excuse to tweak the keywords more.

    Thanks again!

Sign In or Register to comment.