question

glen avatar image
glen asked

Catalog Item's ItemClass doesn't update Inventory Item's ItemClass

When updating a catalog item's ItemClass, that data is not updated in the Inventory of players. So the ItemClass of instances in a players inventory remains what it was when the player gained the instance of that item.

I know that CustomData from catalog items doesn't transfer and are unconnected, but I don't understand the value in not connecting the ItemClass. Shouldn't updating the catalog items ItemClass also update all instances of that item in a player's inventory?

Also, when browsing an item in a player's inventory there is no way to view the ItemClass of that instance or change it, could be handy to have that functionality.

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

Correct - items which are in the catalog and not copied to the item instance are there specifically so that they can be used globally, since the item instance properties are set when the item is created. Since there could be millions (or, at the extreme, billions) of instances of an item, it's not really feasible to update all instances of items when the catalog updates. The ItemClass being in the instance properties is a holdover from when we first created the Catalog system. If anything, the correct fix for this would be to deprecate the ItemClass in the instance, so that there's no confusion.

5 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.

glen avatar image glen commented ·

Would it be better to have the item instance's ItemClass reference the ItemClass in the catalog instead? This way data is never "copied" over to the item instance which would allow for updates that do not tax the system. Then when a query to the inventory occurs it would grab the ItemClass from the catalog instead of the item instance in inventory.

In many ways, from my development perspective, this approach seems like the best option. Right now there seems to be a significant disconnect between the catalog and the inventory. This creates an issue when testing and balancing a game. And balancing a game is not relegated to pre-launch, it continues throughout a game's life-cycle. So being able to update the catalog and have it "update" inventory information would be extremely useful.

0 Likes 0 ·
brendan avatar image brendan glen commented ·

No, the problem with "pulling" data from the catalog is that it would mean doing that cross-table lookup for every item when getting the inventory info, which could mean hundreds of items (or worse). The way the service is designed, the client grabs the catalog first, then the inventory, and uses the global info from the catalog when determining the properties of the item instances.

0 Likes 0 ·
glen avatar image glen commented ·

It's not really a problem for the local client because we grab both the inventory and the catalog at launch, which means we can simply query catalog data instead of inventory data for certain parameters, or fashion our own inventory system using catalog and inventory data. But when it comes to Cloud Script it requires an additional API call which also increases execution time, and, as you are well aware, both of those have limits.

0 Likes 0 ·
brendan avatar image brendan glen commented ·

Correct, if the Cloud Script call needs the global info, it does need to query the catalog, as well. You are correct that this does increase execution time, but the API servers are in the same datacenter with the Cloud Script servers, which minimizes this hit.

0 Likes 0 ·
glen avatar image glen glen commented ·

Ok, thanks for clearing this up.

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.