I want to build a massive social async game mode into my iOS game, is there an iOS API for that? - ios

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.

Related

Is making a video calling and live broadcast app possible in Swift?

I am new to Swift and I want to integrate video calling in my app using Swift. I want to make a live broadcasting video app where one host will come live and other clients can join him/her.
I tried several third party apps like agora.io but it didn't work for me. Do you guys have a better suggestions?
Try quickblox. It is a very smart solution, it can manage everything for you, your only task is to present the UI and the buttons. It is relatively cheap, even free for low user count. We have used it to create an "intercom" like application
Quickblox website

Do iOS Game Center turn based games use Apple servers?

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).

real time messaging for multi player game on ios

Building a multi player iOS game where players compete one against the other. Nature of the game is synchronous. Basically, players either invite each other through facebook, email, etc and then start playing.
We debate what is the best strategy for facilitating the real time communication between players (sending events, etc). Coming from web development, we used comet and long polling which worked great. However, it's not clear what's the best way to achieve that on iOS.
Seems like APN (Apple Push Notifications) is not suitable in our case for two reasons: the delay can be pretty significant, up to few seconds, as far as we understand. Also, using APN requires the user to authorize notifications. If the user doesn't authorize this then it won't be possible to play the game.
Also, we understand Apple's Game Kit (Game Center) can be of value in our case however it's not clear how it interacts with invites through facebook etc. Also, not clear if we need to get into bed with Apple's Game Center and how it'll affect the user experience.
Any guidance on this matter as well as other options that you might think of would be greatly appreciated.
Thanks for your help.
Before you read the rest, a disclaimer: I work for Realtime.co but I do believe I can help here so I'm not trying to "pitch a sale".
If you need to have real time updates, you can check out Realtime (www.realtime.co). It's basically a set of tools for developers to use real time technologies on their projects. It uses websockets but does fallback to whatever the user's browser supports (such as long polling, for example) if you are using a browser (which is not your case, but it's always good to know).
Behind Realtime you have a one-to-one/one-to-many/many-to-many messaging system that will transport your messages to and from your users.
There's a iOS API too which you can use in your project. You can download it here: http://www.xrtml.org/downloads_62.html#ios and check the documentation here: http://docs.xrtml.org/getting_started/hello_message.html#ios.
There's also a plus which is the fact that the Realtime framework is actually cross-platform. This means that you can even have your iOS players to communicate with players using Android, Windows Phone, HTML5, Flash, etc. if you decide on expanding your game to other platforms.
I hope that helps!
I'll just provide some insights on the question.
APN should never be used for synchro communication as for iOS at least, you'll never have both way communication (basically the Apple APN servers are pushing an information to the device).
You should probably play with C sockets in order to open a tunnel (depends if your game is real time or not).
Using the Apple Framework GameKit is great! But might take some time to understand all the functionnalities.
Check out Gree
https://developer.gree.net/en/
Parse:
https://www.parse.com/
Sparrow:
http://gamua.com/sparrow/
There are a few things that your talking about, there is the joining/starting of a game, and then the communication between the players. They are not necessarily related.
You can use game-center and at the same time another framework for facebook, they are not mutually exclusive (but it would be more work.)

iOS - turn-based game with GameKit?

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

Game Center Challenges

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 ;)

Resources