we are doing a pp for facebook, but we seen that facebook API _score allow user to set only 1 score.
so we would like to know how games like candy crush and other level based games are doing to make theire saving system so you can cross platforms and get your progress on other os (android, web, IOS…)
we are planning to have 3 stars by level,+ 100 levels, +best score by level +bonuses unlocked etc…*by players
We’ve used Parse with Facebook for this type of thing. We have a Facebook login to get an id for the player and then store their progress as an object in a Parse class. We can then query their friends and show progress.
You basically have to store all of that in your own database on a server. Parse is decent, and integrates well with Unity and Facebook. Its also recommended (owned?) by Facebook.
There are other options as well, you can write your own database pretty simply.
I know this is an old thread but I need to clarify something… So developers do not actually use Facebook to save the game progress for each account? They actually use an online server and they only use Facebook SDK to get the account information? Did anyone find a tutorial on how to implement this? I’ve been looking for a while on this thing. and surprisingly, there aren’t much that you can find on this topic.
I use PlayFab to store player data. I use Facebook to identify the player and login to PlayFab using that identity. It gives me a way to identify that player across installs, devices and platforms.
Sounds cool. Have you encountered any difficulties while implementing it? And did you follow a specific guide or tutorial? or did you have to figure out the whole thing on your own?
No problems that I remember. I originally used Parse - until Facebook closed it down. I was looking for something that did the same thing, and found PlayFab. I don’t recall if I followed a tutorial or not. It’s pretty simple anyway. I only really use 3 main calls. Login with facebook, get user data, and set user data.
Hey there, I actually want to do the same, but I have some quick questions. Do you save everything as a Key value Pair in Playfab, and load it as such? Or is there another option? All I want to do is save the players progress and retrieve it when they log in, but man I can find a damn tutorial that does just that.
If you can help a tiny bit, mind posting the name of the function I should call?
Thanks for the reply. I have to learn to serialize to JSON, I’ve never done it. So you basically serialize all the data, then save it as just 1 key in Playfab? How compact is JSON? Or do you use multiple JSON serializations?
I don’t have much progress data so I don’t worry about size. I use JSON .NET for Unity although you can use Unity’s built-in functionality but it’s a bit restrictive.
Serialising/deserialising to/from json is simple.
class Progress
{
...
}
var obj = new Progress();
// Replace with correct methods
string json = Json.Serialise(obj);
Progress newObj = Json.Deserialise<Progress>(json);
void SetUserData() {
PlayFabClientAPI.UpdateUserData(new UpdateUserDataRequest() {
Data = new Dictionary<string, string>() {
{"serialization1", "json"}
//serialization is the key, json is the value of the data serialized
}
},
result => Debug.Log("Successfully updated user data"),
error => {
Debug.Log("Got error setting user data Ancestor to Arthur");
Debug.Log(error.GenerateErrorReport());
});
}