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?
Answer by Andy · Aug 15, 2018 at 08:46 PM
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.
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:
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.
I have a couple more questions to ensure I understand your scenario properly:
- Hopefully never, but that’s unrealistic so let’s say very occasionally.
- They would be the same for all players.