Game Center Turn-based game - ios

Is it possible to use the GameKit framework to pass matchdata to the other player without actually ending the turn of the current player?

So the answer to this, for iOS 7 at least, is to use the GKTurnBasedExchanges. You can send data, exchanges, replies to players even though it isn't the players turn.
I don't think there is a way to pass data to another player, then get a response back without the exchanges.
There is a way to pass data once by using saveCurrentTurnWithMatchData:completionHandler:, but the players who receive the match data won't be able to reply.

Related

Can Game Center Track total time played?

Curious to know if Game Center tracks total time played per app? If it does, how could I easily query this data?
Thanks!
No, you cannot use game center to do this. There are a couple of options though.
You can track it locally, and then upload the data to a game center leaderboard. I don't know if you want to do that though because then everyone can see how much a certain player has played
You can use some sort of analytics service, like Google Analytics and ping it periodically while a player is on the app so you can see how much people are playing
Or you can set up a server and database, where the player sends their play time when they are on the app

Is it possible to issue an alert when a GameKit opponent is ready?

I made a game using GameKit and I am using the framework to manage a real-time match between two opponents. If I invite a specific person to a match, or make sure they are "waiting for opponent" at the same time as me, the match and game goes smoothly and everything is great.
The problem I have now is that there aren't a lot of people on my app yet, and so people that are wanting to play against a random opponent who also wants to play, don't have any way of knowing when a match could be ready.
Is there a way to utilize GameKit, but enhance the experience so that a push notification or alert of some kind is sent when an opponent is found? It could be this is all built in, but I'm not seeing anything.
AFAIK, GameKit does not support push-notifications for matching real-time games while your App isn't running.
But, GameKit has a Player Activity API that tells you how many matches were requested in the last 60 seconds, and you could use that number to create an informative message or status to show the player.
EDIT: the methods in question are
- queryActivityWithCompletionHandler:
- queryPlayerGroupActivity:withCompletionHandler:

Network game: how to handle turn game (like ruzzle management)

I am wondering how to handle matches like do ruzzle in ios:
I have read Game Kit Programming Guide and seems not what i am searching for.
in ruzzle one player can play the game and the other can play it too, while all two player haven't finished, i can't go to the second.
GKTurnBasedMatch can't be because only one player at a time can make his move.
Real-Time Matches? but if a player accept to play, then disconnects, the forst player can finish and wait the answer of the opponent, while seems not be so in real-time matches
should i have a separate server that stores the game, or i can use some other apple API?
thanks

Chat between players in Game Center turn based match

I am trying to create a turn based game using Game Center. I wanted to know if it is possible to allow the players in the match to chat between each other (either voice or text).
I have looked into it a little and seems that it is possible via the normal game but not a turn based one.
If it is not possible what are the solution or ways to allow this type chat?
Yes, you can have text chat the following way:
Without ending the turn, update the matchData object on the GKTurnBasedMatch. The updated NSData will be provided to all players that open your app and are participants in the game. So, your matchData object would have to carry both the game state and the chat state. Unfortunately, I do not see how one could trigger user notifications or badge the app for new chats without having to end the player's turn each time.

Game Kit Send data to offline player

I am pretty sure i know the answer but is it possible to send data using game kit to a player who is not playing the game anymore so next time he loads the game the data will be there. Is there any sort of messaging queue in gamecenter that can hold data
Nope, this is not possible if you let Game Center host the game. But you can set up your own server which stores the data and hands it over to the client while still having Game Centers match making functionality.

Resources