question

jeff0rosenberg avatar image
jeff0rosenberg asked

Is A Negative Currency Recharge Rate Possible?

Hello, we're looking at PlayFab as a possible store/backend solution for a client. In the game, Users should be able to earn Temporary Points which decay over time. These points can be used as a currency to purchase some items from the shop. I saw that you could have recharging currencies but the change rate wasn't able to be negative.

Is this kind of "decaying currency" possible? If not, is there a workaround we could use? Something like a consumable item that decays or a server-side script to decay a user's temp currency every 24 hours?

Thanks!

In-Game Economy
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

·
brendan avatar image
brendan answered

Not currently. You could manage this separately via Cloud Script, but you would need to make sure not to set the prices up in the catalog directly, since a hacked client could spend currency it had been granted, without going through the logic you'd have set up in your script to subtract the currency before allowing the purchase based upon elapsed time. I'll add this as an idea on the backlog, in case we have others who might be interested.

3 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.

jeff0rosenberg avatar image jeff0rosenberg commented ·

Could you elaborate on this a little further?

you would need to make sure not to set the prices up in the catalog directly, since a hacked client could spend currency it had been granted, without going through the logic you'd have set up in your script to subtract the currency before allowing the purchase based upon elapsed time.

And thank you for considering the feature!

0 Likes 0 ·
brendan avatar image brendan jeff0rosenberg commented ·

Sure, the way you would do this would be by tracking the VC balance in the player, but without any regeneration rate (since that has to be positive right now). Whenever you perform any operation which would change the balance, or if you need to query the balance to make sure the player is in sync (on login, for instance), you would re-calculate the current balance by checking a timestamp you store in User Internal Data (which you would then update). To avoid letting the player (a hacked client) use PurchaseItem to buy the item for its catalog/store price, bypassing your balance recalculation, you wouldn't have prices in the catalog or store. Instead, you would store the prices as a lookup table in Title Data. When someone wants to purchase an item, the Cloud Script logic would be to get that Title Data and recalculate the player balance, see if he has enough remaining, then Grant the item and Subtract the VC.

0 Likes 0 ·
jeff0rosenberg avatar image jeff0rosenberg brendan commented ·

Thanks for the pointers!

0 Likes 0 ·

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.