What is the formula for recharge rate?
Scenario: gold coins
i know if value is 24 it means 1 gold coin per hour.
what is the mathematical formula tho?
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:
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:
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".
3 People are following this question.