Best Answer

**Answer** by Citrus Yan
·
Jul 08 at 04:29 PM

Rename the following variables:

Gold coin: G

Recharge maximum: M

Recharge Rate: R

Time: T (define 1 day to be 1, then 1 day = 24 hours = 1440 minutes... )

**here's the formula:**

G += R / T, (G < M)

G = G, (G >= M)

T represents time granularity here, for example, if you want to calculate how much coins to regenerate every 4 hours, them T = 24/4 = 6.

So,

R / T = 210 / 6 = 35 coins per 4 hours

As the doc mentioned "Virtual Currency that is granted to the player via a Recharge Rate is granted to them gradually and is evenly distributed over a 24 hour period". It means that the value of recharge rate is distributed within 24 hour and it is counted via seconds.

For example:

- 35 coins per 4 hours

We should say the charge rate is 210 coins/day, which equal to 0.145833... coins/min. Then let 1/0.145833... ≈ 6.85714... min/coins. It means every 6.85714...mins will recharge 1 coin.

**One minimun unit of VC is 1 and one minimun unit of time in PlayFab is 1 second**. if the recharge rate is smaller than 1 unit/second, it will wait and accumulate untill equal to or larger than 1 unit.

Another example:

- 2400 coins per day

It equals to 1.66666... coins/min, which means 36 second/coin. hence, every around 36 seconds, the VC will increase by 1.

The main idea is "**gradually and evenly**".

I just want to show my appreciation. Man you guys are awesome. What a platform. the things like logins, leaderboards, receipt validation for IAP, Automation, segmentation. What a Platform!!

Representing relational data in Title Data,How to represent relational data in Title Data 1 Answer

We need to store data for a turn based game, that data is about like 5kb because are long turns. 1 Answer

Custom Data size for Store/Catalog/Inventory is way to small 1 Answer

CloudScript Data Problem 1 Answer

Catalog Item Custom Data Limit 1 Answer

- Anonymous
- Sign in
- Create
- Ask a question
- Post an idea
- Create an article
- Spaces
- PlayStream
- Feature Requests
- Add-on Marketplace
- Bugs
- API and SDK Questions
- General Discussion
- LiveOps
- Explore
- Topics
- Questions
- Ideas
- Articles
- Users
- Badges