Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • General Discussion /
avatar image
Question by Niclas Rosengaard Andreasen · Dec 08, 2019 at 06:46 PM · Player DataPlayer Inventory

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

Comment
Niclas Rosengaard Andreasen

People who like this

1 Show 1
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Niclas Rosengaard Andreasen · Dec 08, 2019 at 06:49 PM 0
Share

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???

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Sarah Zhang · Dec 09, 2019 at 06:32 AM

>> 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”}

Comment
Niclas Rosengaard Andreasen

People who like this

1 Show 2 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Niclas Rosengaard Andreasen · Dec 09, 2019 at 07:30 AM 0
Share

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

avatar image Sarah Zhang Niclas Rosengaard Andreasen · Dec 10, 2019 at 07:48 AM 0
Share

>> 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(',');

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    3 People are following this question.

    avatar image avatar image avatar image

    Related Questions

    Grant item to entire player base,Granting an item to entire player base? 1 Answer

    Unlock inventory item after specifice time 2 Answers

    Where/How to save players personal data? 1 Answer

    I need to perform a bulk item grant to a subset of players based on a list of SteamIDs. How can I create a segment based on a list of SteamIDs? One that is say, 500 or 1,000 users long? 1 Answer

    Best approach for a city-builder? 1 Answer

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges