question

matt-6 avatar image
matt-6 asked

Catalog Item Custom Data Limit

Hi, what's the limit to the amount of custom data on an inventory item in the catalog? I've had a look at both the documentation and the limits page and cannot see anything specifying this.

Also, for item data I assume this is the place to put it rather than in title data. Either way if I'm working with the data in cloud script I'm going to have to retrieve it. I've seen in other answers you advise caching the data in cloud script using a static object - is there a limit to the size of data which can be stored this way?

limitsdata
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

·
Andy avatar image
Andy answered

Item Data shouldn't exceed about 1 KB. There's not an upgradable limit in place here, so I'd advise architecting around that limit.

I'd like you to better explain what you mean by caching the data in a static object in cloud script. Persisting data across cloud script calls should be done through title objects, not statics in your script. If your caching is scoped to a single call, I don't think we have explicit limits around cloud script memory usage, only execution times. Loading large amounts of data will blow past those limits fairly quickly, though.

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

matt-6 avatar image matt-6 commented ·

I was misremembering Brendan’s comments from this thread (https://community.playfab.com/questions/3958/empty-custom-data-for-item-instances.html) where he’s saying it’s not a good idea.

So for each call to cloud script I’d have to get the catalog data and search for the item I want?

Can I ask what you’d advise for the following. Let’s say I’ve 1000 items each of which has 8 integer stats with it. I need access to these stats in cloud script since we cannot trust the client. The three mains ways I can see doing it are:

  • put them in the catalog item custom data
  • stick them in title data as one large json blob {“0”:{“stat1”:56, [etc]}, [etc]}
  • put them in title data but split so each stat type is a different TD entry {“0”:56, [etc]}

Or is there something better I’m missing? My main concern here is efficiency, with the TD json will I still have to loop it to find my match? If that’s the case I may as well stick with looping the catalog.

0 Likes 0 ·
Andy avatar image Andy ♦♦ matt-6 commented ·

I have a couple more questions to ensure I understand your scenario properly:

  • How often are these stats updated?
  • Are the stats the same for all players, or do some players have different stat values for items?
0 Likes 0 ·
matt-6 avatar image matt-6 Andy ♦♦ commented ·

- Hopefully never, but that’s unrealistic so let’s say very occasionally.

- They would be the same for all players.

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.