#Item Storage
1 messages ยท Page 1 of 1 (latest)
Have you looked at Cloud Save Game Data for this use case?
https://docs.unity.com/ugs/en-us/manual/cloud-save/manual/concepts/game-data
You could use Cloud Code to generate the items and store them as Custom Items in Cloud Save Game Data
I don't really understand what the limits mean?
Limits#
Custom Items have a limit of 2000 key/value pairs each, per Access Class
2000 keys in the default Access Class
2000 keys in Private Data
Custom Items have a total limit of 5 MB each, per Access Class
5 MB of data in the default Access Class
5 MB of Private Data
It sounds like I can only have 2000 of these?
Same thing with player data, it seems very interesting, but I just don't understand the limits
That's only if you use one key per item. for inventory its usually just one key per player that would be like a json blob of all the items that player has
that would still limit me to 2000 players not?
no, there is no player limit. just limits per player
so an access class is a player?
no each player has 3 classes, Default, Public, and Protected
https://docs.unity.com/ugs/en-us/manual/cloud-save/manual/concepts/player-data
yeah I've read that a few times ๐
it's very confusing
so each player gets 3 access classes with each 2000 key/value pairs?
but the amount of players is unlimited?
yes. technically 6k keys total if you max it out
so if I put a limit of 200 items per player in my game for example, I will never run into any issues?
or like you said before, just store the items in one json and then I have 1999 keys left ๐
guess I'll need to store some player stats and stuff too
cool! probably gonna rework my game
There are storage and read/write limits to the free tier. But as long as you are not storing loads of files I doubt you will ever go past it
Hi Pasc!
So yeah that reading of it (2000 key value pairs, per access class) is correct!
I appreciate it is confusing, it's a consequence of us adding the access class functionality to an existing product (it was easier for everyone to make it work that way than to worry about trying to make the limit shared, and it gives developers more options!)
At risk of adding some confusion, but for completeness:
If you want more space than that for player, you can use Game Data to create Custom Items.
Custom Items are like Player Data but for anything, e.g. an object in the world (loot chest, NPC) or something like a level or match state.
You could always create Custom Items with a key like "PlayerID" with a Player ID in it and Index on that property, and then create as many items (each with 2000 key/value pairs) as you need for each player!
You can only write to these from something like Cloud Code or a game server (it's intended for server authoritative flows).
This is a bit opinionated, but we are interested in feedback around what directions to go from here to best reduce friction and remove limitations!
(We know better docs and examples are big part of that, but all feedback is welcome!)
it should really explain on the docs page that it is per player though
maybe just change it to: Player Data has a limit of 2000 key/value pairs per Access Class per player
or just add "you can have an infinite amount of players each with their own 3 access classes"
It is correct that you can have unlimited players each with 2000 key/value pairs right?
That's the main reason I decided to use a database, a few months back when I started on my game
Your right, that's good feedback I will update it so it's clear that that limit is per player!