12 Replies
      Latest reply on Mar 21, 2016 5:37 AM by kirkmahr
      mhatzitaskos Level 1 Level 1 (0 points)

        For iOS9+: I created TurnBasedSkeleton (github.com/mhatzitaskos/TurnBasedSkeleton). This project aims to create a skeleton for any turn based game using GameCenter. As GameCenter seems to lack in documentation and tutorials, especially as far as turn based gaming is concerned, I decided to create this project to help others who might want to integrate GameCenter to their projects.

        • Re: Turn based skeleton project
          bob133 Level 4 Level 4 (955 points)

          You should probably log into the Bug Reporter (bugreport.apple.com) and file a Documentation enhancement request describing what's needed.  You might even offer to provide that skeleton project as sample code!    (I'm not sure they'd accept your offer, but it's worth a try, and you might be able to do something cool for the rest of the game development community!)

          • Re: Turn based skeleton project
            Eternity Level 1 Level 1 (0 points)

            Thanks mhatzitaskos,

             

            A very good initiative!

             

            I've taken a quick look. One initial comment is that I don't use a singleton to implement the listener functions. Instead I register a listener on the GKLocalPlayer when I enter different scenes. Each SKScene inherit GKLocalPlayerListener and can thus have specific listener methods, and some scenes can just ignore some events. Any comments on that?

              • Re: Turn based skeleton project
                Eternity Level 1 Level 1 (0 points)

                I've cloned your repo now, and I have trouble with the following:

                 

                AUTHENTICATION CHANGED

                Player is authenticated

                GameCenter is unavailable with error: Optional(Error Domain=GKErrorDomain Code=15 "The requested operation could not be completed because this application is not recognized by Game Center." UserInfo={NSLocalizedDescription=The requested operation could not be completed because this application is not recognized by Game Center.})

                 

                I have changed the bundle id, and registered the app in Member Center, and in Itunes Connect. I have some memory about having to enable the app for Game Center in Itunes Connect, but I did not find that option now. Maybe that has been removed? Any suggestions?


                  • Re: Turn based skeleton project
                    mhatzitaskos Level 1 Level 1 (0 points)

                    Yea, I got the same error in the beginning and I read somewhere that I need to create a high score ladder in order for the gamecenter to become enabled (although it was enabled in itunesconnect and Xcode) and the error to go away. So, I did, and the error went away. It's like gamecenter is not enabled until this is done. You can then remove the high scores ladder. One of the few things that seem to be weird about gamecenter. :)

                  • Re: Turn based skeleton project
                    mhatzitaskos Level 1 Level 1 (0 points)

                    Well, that's a way to go. I feel that having a singleton allows for all of the gamecenter related stuff to be bundled together and not be present in various SKScenes around the project. It's a matter of preference and also on how you have structured your project. At the end of the day both work.

                  • Re: Turn based skeleton project
                    Eternity Level 1 Level 1 (0 points)

                    I really think this thread is a good initiative. A couple of reflections, if you have the time and interest...

                     

                    Cut from https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/GameKit_Guide/MatchmakingwithGameCenter/MatchmakingwithGameCenter.html:

                     

                    • A player can use the Game Center app to create a match with another player.

                     

                    I don’t know any way to invite players from the Game Center app. I know that I can launch my app by selecting “Play” in the “…” menu on top of the Game menu. Is this the intended functionality?

                     

                    I really don’t want any more functionality from the Game Center app apart from removing & ending matches. For instance, I don’t want anyone to be able to accept an invite from the GC app. It only complicates the states within my app. I have no control. I mean, the user might have put the app to background in the middle of a turn, and now the GC app wakes it up and prompts for turn acceptance actions. I guess it’s also possible to take a turn from within the GC app. How shall I handle those cases in an intuitive way?

                     

                    I don’t have my development environment here — I’m drinking coffee at a café — so I’m not 100% sure, but I am quite sure that I've been able to handle invites and take turns from within the GC app. Is it possible to disable this GC app functionality? Can I just ignore it, or will my app be rejected if I do so?

                    • Re: Turn based skeleton project
                      kirkmahr Level 1 Level 1 (0 points)

                      Thank you a lot! Your skeleton provides some insight that I could not find anywhere else.

                      I mean, bravo!

                      Apple should really consider game center with a lot higher priority than they currently do. I think a huge percentage of their income is through games, no?