question

Daniel Keele avatar image
Daniel Keele asked

Track virtual currency purchases in Playfab, but store amount locally

I am interested in using the Purchase Item method to track purchases using locally-stored virtual currency.

Is this possible?


My reasoning:

1. I want to make fewer calls to Playfab. Managing the amount locally saves many calls.

2. I still want to run analytics on the items being purchased.

In-Game Economy
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

·
Seth Du avatar image
Seth Du answered

It is not supported, Purchase Item API can only use the Virtual Currency defined in Game Manager. VC is something cannot be managed locally in the client, and the local data in the client should be only used to reflect the corresponding ones from PlayFab. As commerce related data should be handled by PlayFab or on the server side to prevent abusive uses.

To help reduce the API call frequency, you may provide the detailed scenario with us so that we can dig into it.

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Daniel Keele avatar image Daniel Keele commented ·

Thanks for your help SethDu, I've been wrestling with this for a while.

In my game the player earns virtual currency every 30 seconds or so, and play sessions have lasted about 15-30 minutes on average.

A single 30 minute session would result in about 60 calls.

Is there some sort of custom user data api where I could post purchased item events?

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ Daniel Keele commented ·

One VC change per 30s should be fine, and it should be fine in Cloud Script as well. If you have concerns about data update frequency, you may also consider update data according to players' actions instead of via a fixed interval. Take strategy game as an example, every time the player finishing the movement, the current state will be synced with PlayFab.

If you want to pose a customized event, you may use WriteEvents API or WritePlayerEvent API.

0 Likes 0 ·

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.