If I implemented a Game Center game on iOS using their turn based functionality will the game operate on Apple servers alone?
No further cost to me?
I'd probably use gkturnbasedmatch from what I've seen.
I am making an iOS board game and it occurred to me that I might be able to add online multiplayer. The simplest and cheapest option for me would be if I could do it all from ios sdk. I'm not interested in paying for a server.
If it does work then what are the limitations?
Please only provide an answer if it's current. I think early Game Center was much more limited. It might not have had gkturnbasedmatch for instance.
I am developing in iOS 8 and swift.
From the Apple Documentation on Turn-Based Matches.
Game Center is primarily responsible for storing data. You are
responsible for providing the game logic that uses this
infrastructure. In particular, you define:
What data must be stored on Game Center
When the match data needs to
be updated
When play passes to another player
Limitations:
Size of matchData - 64KB
Each player can participate in up to 30 simultaneous matches in a turn-based game.
Note that games that have ended still count until the user removes them (e.g. from the GKTurnBasedMatchmakerViewController).
Related
I am trying to understand to what extent the games that have game center enabled are multiplayer games. Please help me understand following questions:
a) Is it possible to create a multi-player game without enabling game-center
b) Can a game with game-center enabled be a single-player game.
Is it possible to create a multi-player game without enabling game-center?
It is definitely possible, but harder to spin up. Without GameCenter, you need to create your own servers, store game sessions, handle game data being transferred from player to player, and other non-trivial things. GameCenter basically says “Don’t worry about all that network and infrastructure, we got it covered. All you need to do is use our framework.”
Can a game with game-center enabled be a single-player game?
Also a yes! You can actually build a game without GameCenter and let you app handle everything. GameCenter is useful here when you want to add a leaderboard, let players compete with other players, enable high scores, etc.
I am implementing game center leaderboard to my game and would like to use the leaderboard data to influence the gameplay.
My question is how to add fake data with different playerID into my sandbox game center so that I can test my feature.
I tried run the game both on simulator and device with different sandbox game center account, but I don't understand why, they can only see "ME" in the leaderboard, not as expected seeing two different players.
Then I tried switch different game center accounts on the same device, but same problem, there is only "ME" on the leaderboard.
I have been googling this issue for a while but cannot find anything related.
To clarify my purpose again at the end, I just want to find an easy way to add fake data in my sandbox leaderboard so that I can test my feature, pretty much it. :P
Thanks for helping out! :D
I don't believe it's possible to do that. What you can do is put fake data into your app. Define a protocol that lets you get players and their scores (or positions in the leaderboard, if that's what you need). For testing, supply a class that conforms to the protocol, that uses test data. In the wild, switch this for a class that gets its data from Game Center.
Game Center seems quite flaky when it comes to running on a device and on the simulator - when testing challenges they very rarely get through between the two. It's also not very good at recognising user changes on the same device. From my tests it seems much more reliable if you have two or more actual devices running the game when testing Game Center features.
I’m building my 2nd game now and I’m wondering if there’s an iOS API to help me out with building a social async game. I’ve used GameCenter before (for leaderboards) but I don’t think GameCenter is something I can use for this.
Are there any open source components I can use instead? Something like the Facebook SDK?
Would I need to have the game run on a server?
You could actually use GameCenter for some of the things you wish to build. For instance, there’s a built-in mechanism for matchmaking and turn based style games. You can have a look at GKTurnBasedMatch for more information.
However, GameCenter does have its limitations. There’s a great blog post by Andrew Plotkin that describes his experience with building a GameCenter based turn-based game. In short, using GameCenter is a bit convulted, one of the players in the match needs to constantly maintain the game state (since it’s all client based) and there is no possible way for both players to act simultaneously. Also, there are issues with players logging out of games (Apple doesn’t provide a mechanism for forfeiting the game or skipping someone’s turn).
You could always take the long road and implement the game using your own server. You would need to build several mechanisms like registration, matchmaking, push notification integration, storage and of course client to server communications.
Another option to consider would be to use Nextpeer’s SDK. They provide a complete solution for games that wish to incorporate a “play with friends” feature and it’s free. They take care of the matchmaking, push notifications and all server-side logic. The game itself just needs to implement some simple methods like starting a game, reporting score and ending a game. It’s pretty easy, they have a simple screencast here that shows how to do it.
From the research I've done, GameKit seems to be mostly about leaderboards and achievements. I am trying to develop a turn-based game like Words with Friends or Checkers. Can GameKit be used for this? The Game Center app seems to require you and your friend to simultaneously have the app open and invite each other to play. I want the Words With Friends approach where you receive notifications that your friend has made a move. Can GameKit do this?
If not, how is this achieved?
GameCenter can be utilized for both real-time and turn-based, check out the tutorial here: http://www.raywenderlich.com/5480/beginning-turn-based-gaming-with-ios-5-part-1. It has two parts with the second one contains most of the game logic. The project code is also downloadable.
It's worth checking out the new GameKit APIs in iOS 5. GKTurnBasedMatch should probably do the trick if you haven't rolled your own solution yet.
Using GKTurnBasedMatch in the new iOS 5 SDK will allow you to do this
I've some suggestions for you. You can use GKTurnBasedMatch class for the reference. In GKTurnBasedMatch you will find
1)Retrieving Existing Matches,
2)Creating a New Match,
3)Retrieving Information About the Match,
4)Retrieving the Match’s Custom Data,
5)Handling the Current Player’s Turn,
6)Leaving a Match,
7)Ending a Match and Deleting a Match From Game Center.
However you can also read detailed description here about this class. For more details visit following link.Thanks
http://developer.apple.com/library/ios/#documentation/GameKit/Reference/GKTurnBasedMatch_Ref/Reference/Reference.html
GameKit / Game Center can be used to solve many of the social gaming aspects you might need, but the actual game play (ala Words with Friends) would need a server that has web services created specifically for the rules of your game.
There are many threads here about webservices, here are a few:
Best way of using web services on iOS?
iPhone REST client
Using a REST API and iPhone/Objective-C
Open Feint has a notion of challenges -- where a player can finish a game and then send a challenge to another user (like a "beat my score"). The app passes along whatever game data it needs to the OF servers and then when the challenge is accepted, the info is downloaded and the challenge is started.
Is there something similar in Game Center? I've been looking through their docs, but it seems they are more interested in live multiplayer scenarios.
Andrew
To do this, you need to have your own server, and you should use Push Notifications. It's not (yet) possible with Game Center at the time of writing (4 november 2010). However, iOS 4.2 is coming soon and it has many new things. :)
Check for the new APIs released at 2012's WWDC ;)