question

robert avatar image
robert asked

Granting Reward Items (best practices)

Sorry for the rather long text, but I hope this explains what I want to archive.

I hope someone can explain the best practices for granting reward items.

At the moment we use two methods:

1. At strategic best matching places (e.g. when starting the game, after finishing an event) we call a cloud script function like checkForRewards() and return a list of items which should be granted to the user along with a explanation text why the item will be granted.

In the game, if we receive such items we display then a dialog: You have been granted item X because of Y.

2. In case of a Task granting such items (e.g. Top ranked in leaderboard on reset) things are a bit more complicated. In such a case we grant a item (GrantableRewardItem) to the user. In the custom item properties we add a string for the reason why it was granted and a reference to the actual item to be granted. Optionally if the item changes the virtual currency balance we also include the amount of VC to be granted). Then, at strategic best matching places we call the same method as described in the previous point. There we find the GrantableRewardItem, return it to game code, display the dialog, and when the user closes the dialog we call another cloud script function with the GrantableRewardItem as parameter which then actually grants the item to the user inventory, or optionally add VCs. (the amount of VC to be granted because of rewards is very dynamic, so we can't create items for each and every case).

Another reason why we use this 2 step process is that the user doesn't have his virtual currency balance already increased when he starts the game but actually recognises the change of this balance when he accepts the reward.

The main reason we don't just use GrantItems (e.g. from a Task) is that when the user starts the app and we initially query the inventory, balance, etc.. we don't want this reward items to be reflected in the virtual currency balance already. People should "see" the virtual currency balance change or the popup of new item only after a dialog told them why they got new things. This should also work across devices, so we can't keep a record of items to check if something was added to the inventory between two sessions.

To conclude, whenever we grant a reward we do following:

Server side:
- Grant GrantableRewardItem.
Custom Item Properties:
- OPTIONAL: Reference to a item. (e.g. ItemBattlePack)
- OPTIONAL: Amount of VC to be granted (e.g. 17 coins)
- REQUIRED: Reason (You earned 17 coins for ranking up)

Client side:
- Call checkForReward()
Get a list of all GrantableRewardItems in the users inventory
For each GrantableRewardItem display a dialog why item will be granted
On Dialog close, call rewardItem(thisItem) on the server

Server code:
- Reward the either optional reference item or change virtual currency balance
Remove the GrantableRewardItem from the inventory
Return new inventory list and new virtual currency balance

Client side:
- Update virtual currency balance (e.g. in the status bar in each menus display current amount of virtual currency)

Although this works really nice and stable, I ask myself if there isn't a more integrated way of doing this.

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

Apart from talking about the code in the server-side to check to ensure that you're only granting items to players that have actually earned them in some way, that seems like a fairly complete overview. When it comes to determining when to give items to players, the logic for that can often be fairly title-specific, The PlayStream action triggers, and their ability to call Cloud Script handlers, are one way to manage this in a consistent manner - you can set the conditions for achieving something that the player should be rewarded for as the filters on a Rule or a Segment, and then have the grant operation occur in a Cloud Script handler that is triggered by that filter or Segment enter action.

10 |1200

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

robert avatar image
robert answered

Our main issue here is not how to grant items to players. We do this mostly from cloud script and Playstream action triggers. The main issue is how to notify the player that he just earned item X because of Y. (and actually reflecting this in the UI after he "accepted" the reward).

Ideally there would be something like granted but not yet "redeemed" items. This way the client code recognises that a new item has been added to the inventory (for whatever reason) but the player did not redeem it yet. Then one could show a dialog with the reason for the grant (which should be included in the items custom data). And only then the user can redeem it and all the associated items or virtual currencies are actually granted.

We try to archive the best possible UX here. For instance we have a status bar constantly shown in all menus with the virtual currency. If a user is granted new VC while he is not playing and starts a game session later, the virtual currency shown should not reflect this already. Only after he has been presented with a "you got new coins" dialog and accepts this dialog, only then the VC should actually change.

Hope I could explain what I mean...

1 comment
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 commented ·

Ah, I see. In that case, your best bet would be to write to the player data (UpdateUserReadOnlyData, for instance) to provide the info on the items added and the reasoning. Depending on the level of specificity you need, that could be the ItemId values or the ItemInstanceId values, along with the IDs/tags you use to determine what text to show the player (assuming you use some form of localization).

0 Likes 0 ·
dragonfoundry avatar image
dragonfoundry answered

You could make all your reward items containers, so the player opens the container when they accept the item. That way, they wont' have the items/currency in their inventory until they've taken the action of redeeming their prize.

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.

robert avatar image robert commented ·

Thanks for the hint. I took a look at containers already, but from what I understand I would have to create the containers and their items in the Game Manager and will not be able to for example use a formula to compute how much coins the user gets, e.g.:

XP * 50 + RetentionDays * 10

(at least not without creating thousands of containers and items manually or programatically). Or did I miss something here?

Thanks!

0 Likes 0 ·
brendan avatar image brendan robert commented ·

Correct - while you can use Drop Tables to randomize the items in a container, we don't do randomization on VC (yet - it's on our backlog).

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.