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 /
  • API and SDK Questions /
avatar image
Question by Ashley Godbold · Jul 12, 2021 at 04:45 PM · CloudScriptIn-Game Economy

Update CustomData on multiple items at once?

I'm working in Unity and I have custom data on items that I need to save when players make a change to their inventory items. There's a possibility that the users could make these changes very quickly. I have a few questions related to what the best method for saving this information would be.

I was hoping to store their changes locally and then send them all at once, but since CustomData requires a server.UpdateUserInventoryItemCustomData for each item that seems like the bad move and would exceed my CloudScript execution limit. Would it be better to just send the changes as the player makes their changes? Or is there a better way?

I reviewed the limits section of the dashboard and I'm not fully clear on what the limits are related to the following:
1) How often I can call the ExecuteCloudScript function within Unity?
2) How many server.UpdateUserInventoryItemCustomData a single function can call?
3) In general, how many client API calls can I make within a certain time limit?

I found the following question from 4 years ago and the answer stated there was an update coming to the Inventory and data systems:

https://community.playfab.com/questions/12605/multiple-inventory-item-instances-customdata-updat.html

I essentially have the same question. So, I'm also wondering if the update mentioned came out. Is the answer still the most up-to-date solution? Should I just save this as PlayerData?

Thanks so much!!!!

Comment

People who like this

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

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by SethDu · Jul 13, 2021 at 09:40 AM

The current economy system still doesn’t support updating custom data in a bulk. Since the Cloud Script have a limit of 25 API calls per execution, additional item data should be divided into separate executions. However, I suggest implementing Azure Function because there is 10s limit in a HTTP trigger function and 65536 bytes size limit for argument/response, but no specified API number in it. Error will still occur when item number increases. I suggest test it on your own to find a safe threshold. PlayFab client API has a limit of 100 calls per 2 minutes per IP address, which also applies to CSAF execution related APIs.

Would you share more details about the scenario?

Comment

People who like this

0 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 Ashley Godbold · Jul 13, 2021 at 02:41 PM 0
Share

Thanks so much for the reply and clearing up the info on the limits!

To elaborate on my scenario: The player has a very large inventory to manage. They can "favorite" the individual items and organize the items into various buckets. I was originally saving this information as CustomData on the item instances, but I am realizing it will exceed the limit pretty quickly. They'll be making these changes very quickly and when they are done they may have dozens of changes that will need to be saved.

I honestly have no idea how Azure Functions work or what they are used for. I am just learning this as I go :D Do you have any suggestions for where I can start my research?

Based on the limits you're describing, it seems like saving the info as Player Data using the ItemInstanceID may be a good approach, while I research Azure Functions.

avatar image SethDu ♦ Ashley Godbold · Jul 19, 2021 at 02:30 AM 0
Share

According to your supplementary description, it is correct that Player Data may be a better solution.

Still, Azure Function does provide more powerful functionalities and may help when implementing advanced features in your game. Please refer to PlayFab CloudScript using Azure Functions Quickstart Guide - PlayFab | Microsoft Docs

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

    4 People are following this question.

    avatar image avatar image avatar image avatar image

    Related Questions

    Transfer Items Between Users 1 Answer

    Question on granting items 1 Answer

    Store with random items 1 Answer

    GrantItemsToUsers CustomData - CloudScript 1 Answer

    Adding User Virtual Currency 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