question

brendan avatar image
brendan asked

HowTo: Increase a currency every XX minutes?

deldam
started a topic on Tue, 23 September 2014 at 8:52 PM

Hello,

I would like to have a currency that is increased X minutes by one.

Is it possible with playfab to have this, also as offline calculation.

if the player dont play one day, the currency will be for example at 10/10

I would like to manage this by playfab to avoid time cheating when player change his device date.

if it does not exist, should i move this into feature request?

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

Best Answer
Brendan Vanous said on Tue, 09 December 2014 at 12:11 PM

Hi again,

Virtual currencies can now be defined with a RechargeRate and a RechargeMax. The way this works is that the RechargeRate is the number of units which will be added in a 24 hour period (so, if you wanted to get 1 added per minute, you would set it to 1440), while RechargeMax is the amount over which no more will be added to the VC in the user's inventory. The RechargeMax can be lower than the RechargeRate, so you could have a VC which recharges up to 100 at a rate of 1 per minute. Also, while the VC will no longer be incremented once it reaches the max, the value can go over that, if your game logic allows for this.

Brendan


5 Comments
Brendan Vanous said on Wed, 24 September 2014 at 10:46 AM

Hi Damien,

You are correct in thinking that this doesn't exist in the PlayFab system currently. However, as luck would have it, this is a feature we're working on this sprint, so it should be available shortly. I've added it to the Feature Requests forum as you suggested, for clarity.

Brendan


deldam said on Wed, 24 September 2014 at 8:40 PM

Thank you thats great!


Brendan Vanous said on Tue, 09 December 2014 at 12:11 PM

Hi again,

Virtual currencies can now be defined with a RechargeRate and a RechargeMax. The way this works is that the RechargeRate is the number of units which will be added in a 24 hour period (so, if you wanted to get 1 added per minute, you would set it to 1440), while RechargeMax is the amount over which no more will be added to the VC in the user's inventory. The RechargeMax can be lower than the RechargeRate, so you could have a VC which recharges up to 100 at a rate of 1 per minute. Also, while the VC will no longer be incremented once it reaches the max, the value can go over that, if your game logic allows for this.

Brendan


deldam said on Wed, 31 December 2014 at 8:01 PM

thank you for adding this feature so quickly!

how should i deal with the logic?I think easiest way is to request a "timeBeforeNextRecharge" everytime we reload the gui? did you added something like this? any doc?


Brendan Vanous said on Wed, 31 December 2014 at 10:27 PM

Thanks, that's an excellent suggestion. Right now, we do not have a "last incremented time" for the recharging currencies. I'll add a backlog item to get that added, so that you can have a "time before next increment" as part of your interface.

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

Quick follow-up to this: When you request the player inventory, the player's current VC balances are returned, along with the time to the next recharge, for 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.

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.