question

Niclas Rosengaard Andreasen avatar image
Niclas Rosengaard Andreasen asked

Hitting limits with Playerdata

Hello everyone
pla
Me and my partner has been programming a new game for the last 3 months.
We keep hitting playfabs limit on playerdata, in the free tier it was 10000bytes, then we said well we will use the server to store the playerdata instead. It has a limit on 30000 bytes for the arguments in scripts.

It worked fine for now, but we have put ALOT inside the game now, like 140 + items and such.
Now we the limit in argument is hit again in cloud, we upgraded to Indie licence to increase all limits.

My question is how are everyone else storing data for their items.
The custom data for Items is only 1000 bytes for ALL items wich is so low.

The way we are storing data is we convert a dictionary to a list then we serialize it and upload the JSON data to playfab.

But its like when we get stuff from playfab it has low data usage, but when we upload the SAME data, with some minor differences its doubled in size? How is this possible, if its the same data??

Is there a smart way to store data for each player? We want each player to have and inventory, with items that can level up and those items need to be store some where. Right now we have them all typed into the GameTitleData and we get those when game starts, then we load them into a dictionary, then we get all data from PlayerData and delete that data in the dictionary and replace with the data from PlayerData if they have set some data themself.

That way we always have progress of the player stored safe in the PlayerData.
I heard someone talk about stringify something data so i could take all data..

Player DataPlayer Inventory
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Niclas Rosengaard Andreasen avatar image Niclas Rosengaard Andreasen commented ·

This is 1 item from the TitleData:

[ { "ItemID": "Helmet of Ancestral Family", "SetItemName": "0", "UnityID": "10001", "ItemType": "Helmet", "Rarity": "Normal", "Attribute1Name": "10% Attack speed on all towers", "Attribute1Value": 0.1, "Attribute2Name": "0", "Attribute2Value": 0, "Attribute3Name": "0", "Attribute3Value": 0, "SetBonus1Name": "0", "SetBonus1Value": 0, "SetBonus2Name": "0", "SetBonus2Value": 0, "SetBonus3Name": "0", "SetBonus3Value": 0, "SetBonus4Name": "0", "SetBonus4Value": 0, "SetBonus5Name": "0", "SetBonus5Value": 0, "Unlocked": false } ]

How can i compress this as much as possible???

0 Likes 0 ·

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

>> The custom data for Items is only 1000 bytes for ALL items wich is so low.

1000 bytes is the limit size of one store item custom data value. We can write 1000 bytes of custom data for every item.

>> But its like when we get stuff from playfab it has low data usage, but when we upload the SAME data, with some minor differences its doubled in size? How is this possible, if its the same data??

Do you mean you want a mechanism reusing data? Playfab only supports storing player data as objects, files or K/V pairs. There is not a native mechanism of reusing the same data, game developers need to design such a mechanism by themselves.

>> Is there a smart way to store data for each player? We want each player to have and inventory, with items that can level up and those items need to be store some where.

1000 bytes is the limit size of one store item custom data value. You can try to use Player Inventory directly. You can store every item’s name/value pairs’ values in the item’s custom data, store the reusable name/value pairs’ names in the title data. Then you can modify items’ data based on items, not player data name/value pairs.

>> How can i compress this as much as possible???

You can store item’s default information in Catalog item’s custom data, not in the title data. And as the above content said, you can store values in the custom data, and store names in the title data. If so, item information names only need to be stored one time. It can compress the data size to some extent.

{“ItemInfoNames”:“ItemID,SetItemName,UnityID,ItemType,Rarity,Attribute1Name,Attribute1Value,Attribute2Name,Attribute2Value,Attribute3Name,Attribute3Value,SetBonus1Name,SetBonus1Value,SetBonus2Name,SetBonus2Value,SetBonus3Name,SetBonus3Value,SetBonus4Name,SetBonus4Value,SetBonus5Name,SetBonus5Value,Unlocked”}

{“ItemInfoValues”: ”Helmet of Ancestral Family,0,10001,Helmet,Normal,10% Attack speed on all towers,0.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,false”}

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

Niclas Rosengaard Andreasen avatar image Niclas Rosengaard Andreasen commented ·

>> The custom data for Items is only 1000 bytes for ALL items wich is so low.

In the test we made we tried to write alot of different stuff. It looks like it takes the longest/biggest of the items and count that? Is that true?

>> How can i compress this as much as possible???

{“ItemInfoNames”:“ItemID,SetItemName,UnityID,ItemType,Rarity,Attribute1Name,Attribute1Value,Attribute2Name,Attribute2Value,Attribute3Name,Attribute3Value,SetBonus1Name,SetBonus1Value,SetBonus2Name,SetBonus2Value,SetBonus3Name,SetBonus3Value,SetBonus4Name,SetBonus4Value,SetBonus5Name,SetBonus5Value,Unlocked”}

{“ItemInfoValues”: ”Helmet of Ancestral Family,0,10001,Helmet,Normal,10% Attack speed on all towers,0.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,false”}

How will you extract that data value inside C#? When its comma seperated?

Thanks for fast respond

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang Niclas Rosengaard Andreasen commented ·

>> The custom data for Items is only 1000 bytes for ALL items wich is so low.

I mean we can write 1000 bytes of custom data for every item not for all items. Maybe it is so low for your case. If you have tested it, and don't have a misunderstanding about the limit's target range. Please ignore this clarification.

>> How can i compress this as much as possible???

Just separate names and values in order. You can modify it based on the actual situation. If we use a comma to separate it. We can get these values using Split() function.

string[] arrTemp = ”Helmet of Ancestral Family,0,10001,Helmet,Normal,10% Attack speed on all towers,0.1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,false”.Split(',');
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.