question

alanmthomas avatar image
alanmthomas asked

Best approach for a newbie to PlayFab

Hello everyone.

I'm new to PlayFab and hoping to start getting it integrated into my project. I've gone through much of the documentation but have a few questions. I hope you don't mind. I am developing in Unity and have a solid understanding of C# and getting things working within that environment.

I'd like to have data stored both locally and on the cloud. If the player doesn't have an internet connection, then I'll use the local data. Once they have a connection again, I'd like to check the local data against the cloud data and use the most recent version (or give them an option, as games like FarmVille do, to select which data they would like to use).

Does the PlayFab API handle local data storage or would I need to handle this on my end? What would be the best recommended approach?

I appreciate any input that you might have.

Thanks,

Alan

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
1807605288 avatar image
1807605288 answered

PlayFab does not have a solution for resolving local data against cloud data. We only handle the Cloud side.

There are a number of features which simply can't work in "offline mode", such as virtual currency, inventory, purchasing, titleData, and others. About the only thing that could work is PlayerData, and/or Statistics (if you enable client-editing for the latter in the settings).

This also means that your game data is client-authoritative. Because of that, leaderboards become nearly useless (players will post max-int for their scores). Additionally, most multiplayer interaction becomes compromised.

In short, under those conditions, PlayFab can be a backup save for Statistics and PlayerData, and that's about it. You need to resolve data discrepancies yourself, on your client, or via Cloud Script. And you must consider rampant player cheating an acceptable outcome.

4 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

alanmthomas avatar image alanmthomas commented ·

It sounds as though you are suggesting that one should not implement a local data save if using PlayFab, thus limiting the game's scope to players that have an active internet connection.

How do you imagine games that offer both online and offline play handle the issues that you are saying will arise, with things like rampant cheating and limiting cloud service usage to things like player data backup?

0 Likes 0 ·
brendan avatar image brendan alanmthomas commented ·

Not at all. We have quite a few games that have an offline play mode. What Paul is highlighting is simply the fact that offline play is, by its nature, extremely vulnerable to cheating. You can certainly reduce the frequency of cheating by obfuscating or encrypting the data locally, but since the logic for all of that is local to the client, it's not possible to completely prevent it. For most casual games, that's not really a concern - it's well understood that players will cheat, so the key is to make sure that doesn't impact other players.

If you have an offline mode, the way to manage it would be to aggregate all the changes that occur while the player is offline, so that you can update the backend data when the player is next online in as few calls as possible, with appropriate cheat checking on the values being sent (check min/max values, time since the last save versus progress, etc.).

0 Likes 0 ·
alanmthomas avatar image alanmthomas brendan commented ·

Thanks, Brendan. That makes sense and is what I figured the approach would/should be. I'll have to get creative with some of the client side code, particularly in preventing players from pushing the clock forward and other things that are common cheats.

0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.