Persistant data with Game Center? - ios

Is it possible to use Game Center to store persistant data regarding your game? so for example would I be able to store an "experience" value for players linked to a specific game, in their Game Center accounts?

I did something similar to this by using different leaderboards.
But the kind of data is very limited, and you can only increase one player's score.
What do you want to store ?
experience can be stored locally, even permanently with NSUserDefaults

Related

Game Center leaderboards confusion

I was wondering if I create a game center leader boards if I could reset all the game scores posted on it? Not remove data during test but after launch.
The reason for me asking this is I was thinking about creating a game where whoever has the highest score by the end of the week gets a bonus of some sort based on my game and then a new competition starts and all the data resets again so new scores can be uploaded.
That's not what they were designed for, no. While it may technically be possible using score deletion through the iTunes Connect interface, I would recommend against it and try to come up with either your own solution or a different third-party service.

Saving score with Keychain

I am developing a game with Spritekit and I'm now at a point where I have to keep track of the user's highscore. There are various different methods for storage with the easiest one being NSUserDefaults, but it's recommend for preferences.
However, I found this Keychain wrapper which tends to save a string with a key:
https://github.com/jrendel/SwiftKeychainWrapper
Do you think it's good to use it? My idea is to convert the score (Integer) to a String before saving it and while retrieving the highscore, I will convert it back from String to Int. Do you think it's a good idea?
The main advantages of the key chain I can see are that entries persists when an app is deleted and can't easily be changed. UserDefaults would be tied to your app Id and lost on app delete: unless you used the global domain.
You could look to use CloudKit key/value storage to achieve cross device high scores, storing the data in the cloud. This would be more work and you would need to add conflict resolution.
Depending on how serious you are taking high scores, you should perhaps consider integrating with Game Center? Ideal if you want high score etc to persist across more than one device.
https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/GameKit_Guide/LeaderBoards/LeaderBoards.html

Saving game progress on iCloud: best solution?

I'm working on a new iOS game and would like to save the progress online through iCloud. The saving is fairly frequent, but they are mostly doubles and ints with scores, unlocks and NSDate numbers.
Since internet will be required to play the game, I would like to save the game only online, not locally. When the app opens it should download the saved game from the server, and when it's done, launch the game.
Online currency will be sold through IAP, so I want to make sure the progress will not be lost even if the game is deleted and reinstalled, and of course, be available on multiple devices from the same user.
What's the best way to do this? Is it possible through iCloud? Key value seems like a mess because it doesn't sync quickly with iCloud. So Core Data?
I'm not looking for code to copy and paste, but I would like to create a discussion to find out the best solution for this case, if it's iCloud, setting up my own server, etc. Everywhere I look people say different things, but so far I couldn't find the best solution.
Thanks!
In iOS 8, you might want to look at GKSavedGame — it manages saved games associated with a Game Center player and syncs them through iCloud.
Otherwise, direct use of iCloud APIs sounds reasonable for your use case. If you write a small, well-defined set of values, the ubiquitous key-value store is very easy to use. If your save games are more complicated, write out a property list or encode your custom objects with NSKeyedArchiver, then use the NSFileManager APIs for syncing the resulting files through iCloud.
Going for Core Data or CloudKit is also possible, but sounds like it's more complicated than your game needs.

Rank different countries in Game Center Leaderboard?

I was wondering if it would be possible to rank things other than individual player in Game Center, such as a country. It would be set up so that when a player gets a score, it adds that score to the player's country score and that gets sent to Game Center. So, would this be feasible?
The Game Center views do not offer filtering other than what you see in the standard interface (time scope and all players vs. all friends). So, to get this behavior, you would need to build your own custom Game Center leaderboard interface, manually downloading scores with GKLeaderboard, and storing and retrieving country information in the hidden context parameter of scores.
However... this would be hugely impractical, because you would have to download a very large number of scores to ensure that you would capture even most of the countries where players have submitted scores. As such, you really should look into having your own leaderboard server which tracks the data you're interested in, and can efficiently return it organized in the way of your choosing.

Where to save high scores in an XNA game?

I'm making a simple 2 player game in XNA and started looking into saving the player's high scores.
I want the game to work on the XBox 360 as well as Windows, so I have to use the framework to save the data.
It seems that you save data to a particular user's gamer tag - so my question is, what to do with high scores?
Save the user's own scores in their profile? (So you can only see your own scores if you're the only one signed in)
Try and save other player's scores in all profiles? (Seems like a pain to try and keep this sync'd)
Store scores online
The 360 seems to have a standard method for showing friend's high scores. Can this be accessed from within XNA, or is it only available to published games?
Roll my own. (Seems excessive for such a small personal project.)
the XNA Live API doesn't give you access to leaderboards ... so your real only option is to store the scores locally. If you want users to see each other's scores ... you could use two different stores. The player's store for his own save data ... and then title storage to store scores.
Of course then, if the 360 has more than one storage device, they'll have to select it twice ... but you could only let them choose the device for scores if they go into the high score section.
You may want to read http://www.enchantedage.com/highscores. It uses XNA network sessions to share high scores with other xboxs playing the same game.
Here's one way that has been accomplished that seems extremely simple and easy to implement.
http://xnaessentials.com/tutorials/highscores.aspx

Resources