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.
Related
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
I am working on a game. It will use Game Center for multiplayer. I would like to be able to use CloudKit for storing levels and the local CloudKit container for storing game progress. The problem is that this requires to different accounts. Any ideas on how to link them together?
I struggled with this recently when building in syncing to my game Qiktionary. At first I associated single player game data with the currently logged in Game Center player. So when I started working on sync, I was associating the single player game data in CloudKit with the Game Center player by using a separate CKRecordZone (in the private db) for each Game Center player.
I ended up abandoning that approach because it turns out that causes some behaviour that looks to the user like data loss. For example, GC Player A is logged into your game and plays 10 single player games (or in your case, levels). Later they happen to log out of Game Center, and even later than that they come back to your game and since they are logged out, they no longer see their 10 games played. It's not obvious that the game data is there but just "missing" because they are now logged out of GC.
I did some research and most other games don't work like that. Single player game progress is not linked to the logged in Game Center player. Which means that the single player game data in CloudKit shouldn't be linked to the Game Center player either.
This is even how the GKSavedGame API from GameKit works. According to the docs:
Saved games are tied to the iCloud account, not the Game Center account
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).
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.
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