Hello,

we will run a closed beta and we want to restore the virtual currency that players will buy and use during this period.

So if a player buys 100 HC and spends it, after the beta he will get 100 back.

If a player buys 100 HC and spends 50 HC, he will get 50 back. etc.

What would be the best way to achieve something like that ?

Comment

Best Answer

**Answer** by Citrus Yan
·
Dec 03, 2019 at 06:50 AM

As I see it, using
a **Scheduled
task** that run **actions**
on each player in a **segment**
might be a good way to massively restore all virtual currency purchases after a
closed beta, the action being a Cloud Script function that will first check how
much VC should be restored (**refund**) for each targeted player and then call
**AddUserVirtualCurrency** to restore the VC, and, the segment should
contain all active players during the beta in case you missed out some players,
hence, the **All Players segment** is a safe choice.

Now, we have only
one problem left: how to calculate the **Refund** for each player? And, to
simplify the question, let’s suppose there are only two operations
players can perform regarding virtual currency: (a) buy VC (b) spend VC.
There are two ways to achieve this:

- Keep track of the total VC players bought, after the closed beta, subtract the amount of VC players currently have from the total VC they bought to get the amount of refund.
- Keep track of the total VC players spent, after the closed beta, it should equal to the amount of refund.

You can utilize another
type of VC, Player
Data, or Statistics
to keep track of VC bought/spent. For instance, suppose we choose to keep track
of VC bought and use another type of VC (let’s suppose it’s called **RC** ),
the basic idea is that whenever the player buys the VC we always add the same
amount of RC for him, after the beta, the amount of RC for each player equals
to the total VC he/she bought. Similarly, if we choose to keep track of
VC spent, we’ll need to add the same amount of RC whenever players spend the
VC, after the beta, the amount of RC should equal to the amount of refund.

Please feel free to reach us if you have any questions regarding this.

- 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