question

Orcun Nisli avatar image
Orcun Nisli asked

Use PlayFab on semi-online games

Hi there!

I am exploring PlayFab, since a while and I am confused that if I could use PlayFab with a not fully online game such as Candy Crush saga.

1-) I plan to permit player an offline play and consume currencies while offline, yet i need to synchronize the currency on the server when player is re-connected. Is it possible on PlayFab to achieve this?

2-) Also another issue i am wondering is: I don't want to show player a login screen and allow him/her to just connect with Facebook to create an account and login. What I must use as player password to register. If i create a random password, i can not allow player to reconnect from different device to continue to progress

3-) I don't want to show all players on the leader boards, but only player friends from Facebook. How could i achieve that?

4-) Also my game will have 400+ levels to track and on the leader board page i need to create each stats individually. Is there any option to create stats as a bulk.

Thanks for your help.

 

10 |1200

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

brendan avatar image
brendan answered

Sure thing:

1. It's certainly possible, though by giving the local client authority over those transactions, you're allowing an easy path to cheating in those transactions. We don't provide an offline caching solution for game actions currently, so reconciling those actions once the player is online is something you'd need to do - but it's important to make sure you're not hammering the system with tons of calls. The way to do this would be to aggregate all the info across the offline play, and then make one call to update the virtual currency balance and another to grant any new items (potentially one more, for any User Data updates). If you have more complex goals for the offline mode and the reconciliation of the data seems like it'll need more calls, please let us know the details at devrel@playfab.com and we can discuss it in more depth.

2. We have a number of login methods which don't require a password - Device IDs, Facebook, etc. You can use any of those to create a new player account. Our recommendations on best practices for login are here: https://playfab.com/blog/first-impressions-count-best-practices-friction-free-player-authentication/

3. You can use the friends leaderboard API calls to show only the scores for the player's friends. Setting the IncludeFacebookFriends parameter to true will cause the player's Facebook friends to be included in the friend list.

4. No, but any statistic update call creates a leaderboard - it's not necessary to pre-create them in the Game Manager. However, please note that titles are limited to 256 statistics in our free service: https://playfab.com/limits/. Any title needing to exceed any of the free service limits can work with us at devrel@playfab.com to get a custom contract which allows for higher limits.

10 |1200

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

Orcun Nisli avatar image
Orcun Nisli answered

Hi, thanks for fast response. Since that time I had found a chance to more involved into PlayFab and I managed to implement a Manager class right now.

  1. Lack of offline caching is so bad. Is there any plan to add an offline caching system? I'll need create one, and can you assist me how could i do it. I already implemented my PlayFabManager functions to query/send UserData, UserStats as a single bulk and send only the changed ones. Yet I am still confused if I must choose to store my hard currency and other currencies (life, boosts, etc.) as a currency or as UserData in PlayFab... Because, if i choose to store them as currency, it would turn in to a mess. Forex: I can't use recharge property, because player could switch between offline-online anytime. Or if player spend a booster in offline mode, what is going to happen when player connect to PlayFab? It is very important for me to find a semi-secure way to do that so I am ready to try any good possibility.
  2. I already checked and implemented it. Really Thanks.
  3. I already checked and implemented that.
  4. I will send you a mail about it.
10 |1200

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

brendan avatar image
brendan answered

We would advise storing virtual currencies, whether energy (regenerating) or not, as virtual currencies in your title in PlayFab. We've built systems around secure purchase using those VCs which give you better control over them (and help prevent players cheating them, as long as you leave the Add/Subtract VC API calls turned off for the client - which is the default).

Pulling over the info from our email thread for the rest:

For caching, we do plan to provide for event caching in a later update, but I'll be frank - there is no valid way to secure purchase transactions offline. Anything you cache locally for later update to the service is vulnerable to hacking. So a hacked client could easily change currency balances and make purchases which are completely invalid as much as they want to. For a system that then re-syncs when the player reconnects, it is the case that the purchases would be rejected as invalid (since there's no way for the player to hack the servers), but how that's handled in-game would be up to the title code. There wouldn't be a way for us to generically roll back the purchases and anything the purchased items were used for in the game. We may still provide for a "cached actions" queue of PlayFab calls that are synchronized when the client reconnects at some point, but even then, sync of VC purchases would require the title to understand and take action on any purchase which is later invalidated. For now, I would have to recommend not allowing purchases while offline.

10 |1200

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

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.