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 John Peterson · Apr 11, 2018 at 02:49 AM · apisLeaderboards and Statisticssdks

Custom data for statistics?

Dear PlayFab community,

I am curious to learn if there's any ability to hang custom data off of a statistic? From everything I've reviewed, a statistic is basically composed of an integer value and a version number.

The reason I ask is that I'd like to provide some additional context for a statistic. That is, if I have an leaderboard with an aggregation of last/min/max, it'd be convenient to provide some additional information to the statistic in the event that it's the "winner" (e.g., what weapon was used to achieve this high score, etc.).

Presuming there's no native support for this, can anyone provide me with some suggestions as to how I might achieve this feature? I had thought that I could store this in the UserData, but I wasn't sure whether the submitted statistic would be "persisted" as a last/min/max.

Thoughts?

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 Brendan · Apr 11, 2018 at 01:36 PM

No, sorry, but that won't work. The problem is that when players view the leaderboard, they're going to view the top folks quite often. If you have a whole bunch of players querying the leaderboard, and they're all trying to read user data from the same players, that's going to cause a serious problem with the data table - bear in mind that every request to read a single row in the table has to be serviced one at a time. So in the case where you have loads of players, that's going to cause a "logjam" effect when they're trying to read the same players' data too quickly.

In addition, if you wanted to show this as a rich leaderboard with that info, you'd be making a query per player on the leaderboard, generating excessive calls, which could get the title throttled or blocked.

What I would recommend is that you use the profile elements to build out that extra info for the rich data you need. You could use other statistics, for example, to have info on state of the player at the time of the score, for example (since you can get all the profile info on each leaderboard entry).

Comment
John Peterson

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 John Peterson · Apr 11, 2018 at 03:05 PM 0
Share

Thanks, @Brendan! Yeah, I can appreciate that this would generated kind of a "hotspot" effect if we were to try and leverage UserData. I wondered, too, whether we might try and store/update this data as some TitleData element (by providing our own interfaces to update the statistic and determine whether to update TitleData), but maybe that would run into some of the same issues?

Can you elaborate on your recommendation? I'm not quite "grokking" it. It reads like you're suggesting that we use the user profile data to store the custom data, but I'm not sure how that's done, or how we'd correlate a specific statistic instance with the leaderboard instance (maybe through the version?).

I do see a Tags element on the Profile from https://api.playfab.com/documentation/Client/datatype/PlayFab.Client.Models/PlayFab.Client.Models.PlayerProfileModel. Maybe we could do something clever with that?

I'm not quite sure how we'd use other statistics to track statistics. Any additional information to give more clarity into your suggestion would be much appreciated!

Also, is this worthy of a Feature Request for the statistics, in general?

avatar image Brendan ♦♦ John Peterson · Apr 12, 2018 at 07:56 AM 0
Share

It really depends upon what you have in mind. If you're going to have your own server running, and it updates Title Data once every few minutes, that would probably be fine, but you need to bear in mind that since Title Data is sharded and cached, it's not immediately available with the updated value at all endpoints. So whenever you update it, you'll have a brief period where some players will get the old values (as well as any player who have already read the data, and so will be using it).

But you originally were asking about having extra per-player data, which definitely would not work in Title Data. Can you explain in more detail what it is you want to do?

What I was saying was that there are a lot of things in the profile, including the other player stats (so, you could use one as a bitfield to contain one or more enums) and Tags (you can set a few custom strings on players with this). The profile is returned with each leaderboard entry, allowing you to use it for rich leaderboard displays.

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

    How can I create team tournaments like Toon Blast game 3 Answers

    Adding a Leaderboard to my UE4 BP Project 1 Answer

    Second post because it's urgent: How can I create team tournaments like Toon Blast game 0 Answers

    Leaderboard/Tournament questions 1 Answer

    Thunderhead Usage and Load Testing 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