unbrokencraig avatar image
unbrokencraig asked

Reward VC when scrapping / disenchanting an item?

Our game is going to have a system in which users can smash / scrap / disenchant duplicate vanity items and get virtual currency in return.

Looking over the API and reading through some forum posts, the best way I've figured out to handle this is to have every item be a container and have those containers store either VC directly or a bundle that contains VC (probably going this route so we can tune values for different categories of items in a single place).

Assuming there isn't a better way to do this that I'm overlooking, should I be concerned at all if the user scraps a large number of items all at once, since each item being scrapped would have it's own UnlockContainer call, and each of those grants a bundle which then grants currency and consumes itself?

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

brendan avatar image
brendan answered

Yes, the scenario you call out is specifically what I would call out as problematic. But let's back up:

First, no, Bundles wouldn't be the way to do this. Bundles are "items that come with other items". So as soon as the player was granted the bundle, they'd get the VC.

But also no, Containers wouldn't be the way to go if there's any way the player could consume many of them in a short period. The issue here is that - in the legacy commerce model - a high frequency of changes to a single player's inventory will cause performance issues, resulting in slower responses. Also, there is the issue that you're going to hit the API rate limit on calls from the client, going that route. What I would recommend is having a Cloud Script (or custom game server) which takes a call from the player telling it how many of the items to consume, and then it processes them - checking the player inventory, removing the items, and granting the VC.

10 |1200

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

unbrokencraig avatar image unbrokencraig commented ·

If the bundle was stored in the container’s list, the contents of that bundle would be granted only once the user scrapped (unlocked) that item, correct? That’s the behavior I would want. The bundle would only serve as a way to have many of these containers share a common reward instead of having to change the VC reward value on every individual container.

That said, it sounds like the larger issue is the frequency, and that using cloudscript to consume and grant currency might be the better route for our title. Either that or convincing my designers to abandon the “scrap all” idea and only allow the users to scrap one item at a fine, possibly with a built in delay (hold for 3 seconds to scrap, etc).

0 Likes 0 ·
brendan avatar image brendan unbrokencraig commented ·

Sure, you can put Bundles in Containers, that's not a problem. And yes, you should definitely go with the Cloud Script route - use one call to set the new usage count on the stack, and one to grant the relevant VC.

0 Likes 0 ·
unbrokencraig avatar image unbrokencraig brendan commented ·

Are there any examples of how to use CloudScript in a UE4 project? I'm not entirely clear on how to set up the request, specfically the FJsonKeeper object I pass as the FunctionParameter.

0 Likes 0 ·
Show more comments

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.