Basically i have a working datastore system in my game thats had nearly no issues storing data
this datastore system stores how many of an item there is
In a update im working on these items will recieve skins that players can unlock
problem is i have no idea how to store this much data
im planning on giving atleast 3 skins to every weapon
how would i handle a datastore with this much data?
sorry im looking for an solution that doesnt involve free scripts
im a beginner scripter and im not looking for easy solutions, but rather to try and learn
a datastore key can hold upto 4mb of data. one solution is to check whether the data may exceed 4mb. if it does then create a new key when the datastore reaches almost lets say 3.8mb and flag that key as FULL so a key may look like this u/data/123123/1 and if its flagged FULL another key will be created u/data/123123/2. you can utilise ListKeysAsync to get all the existing overflow keys that the player has.
using an external database is also an option but that will require you some money.
now most likely a key wont even reach 4mb if you know what you’re doing and this is simply overkill. your player data is most important so id advise to not even think about this case especially when you’re just starting. for reference 4mb can store up to 1,048,576 characters!
i don’t see why that would be alot of data. Every item could be represented as 64 bits, with one 32 bit int being the items id and one 32 bit int being the items skin.
so 64 bit per inventory item. Then when loaded use the 2 number to load the item and its skin from a table.