question

brendan avatar image
brendan asked

Does PlayFab support regenerating currencies?

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

Brendan Vanous
started a topic on Tue, 09 December 2014 at 7:01 PM

While we have had the ability for titles to define and use virtual currencies (VC) since the start, we now also provide the ability to define a VC as regenerating over time.

The RechargeRate and RechargeMax for a VC determine this behavior. The RechargeRate is the number of units which will be added in a 24 hour period, while the RechargeMax is the limit beyond which the VC will no longer be incremented. The RechargeMax can be lower than the RechargeRate, to allow for fast-regenerating VCs, and the RechargeMax isn't a hard limit on the VC - just the point where the player won't get more just by letting time pass.

So for example, a title could define a VC like so:

POST https://[TitleID].playfabapi.com/Admin/AddVirtualCurrencyTypes
Content-Type: application/json;
X-SecretKey: <title_key_value>{
  "VirtualCurrencies": [
    {
      "CurrencyCode": "CC",
      "DisplayName": "Chump Coins",
      "InitialDeposit": 0,
      "RechargeRate": 1440,
      "RechargeMax": 500
    }
  ]
}

This would create a VC which starts at 0 when the player signs up for the game for the first time, regenerates at a rate of 1 per minute (1440 being 24 hours times 60 minutes), and would stop accumulating when it reaches 500.


1 Comment
gwertzman said on Tue, 09 December 2014 at 7:10 PM

Or you could do a recharge rate of 24 and a max of 5, and have something similar to the Hearts in Candy Crush Saga that recharge one per hour, up to 5 total.

The new game manager (which is coming out shortly) provides direct editing of these new fields.

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.