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 dean · Aug 05, 2016 at 03:44 PM · Leaderboards and Statistics

Leaderboard Ordering with Min Aggregation

I have just set up a Min leaderboard, ie, from scores submitted the leaderboard regards a smaller value as better and ignores any larger values.

However when I pull down the leaderboard, it is still ordered from highest to lowest and so are the players Positions.

Surely a leaderboard with Min Aggregation should return results in order of lowest to highest, since we regard a lower value as better? At least, all the systems I have worked with do.

Can get around this client side, but I thought I would point it out anyway.

Comment
evan
Meltdown Interactive Media

People who like this

2 Show 2
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 Dominic Williamson · Oct 30, 2019 at 06:04 AM 0
Share

+1 for me too for this feature request

avatar image Matt McElligott · Nov 01, 2019 at 03:01 PM 0
Share

+1 for this feature as well. I think it should at least be an option on the Min Aggregation Leaderboards. Awesome workaround though, thank you @ottolb!

,

+1 for this feature as well. I think it should at least be an option on the Min Aggregation Leaderboards. Awesome workaround though, thank you @ottolb!

7 Replies

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Brendan · Aug 05, 2016 at 03:50 PM

Correct - all leaderboards are returned in highest to lowest order. While I tend to agree that a Min aggregation leaderboard would probably be better returned as lowest to highest, our commitment to no breaking changes means that we can't change the behavior of the default return. What we are considering for a future update is providing a new leaderboard queries (or possibly an optional parameter on the existing ones) to allow specifying ascending or descending ordering.

Comment

People who like this

0 Show 12 · 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 dean · Aug 06, 2016 at 07:37 PM 0
Share

Yup. I figured it would be too late to change at this stage.

Another leaderboard setting for Ordering would do the trick.

I was hoping to fix this client side, buy changing the Position to (Total Entries - Position). But then I realised that I don't know what the Total Entries is unless I have the entire leaderboard downloaded. So the Position is kinda useless for me now :-(

avatar image ottolb dean · Aug 08, 2016 at 09:33 PM 2
Share

Hi Dean,

right now I just submit the score multiplied by -1. And then return the correct value when get leaderboard lists.

So it'll ordered in the right way

avatar image colinchiu · Mar 10, 2017 at 09:55 PM 0
Share

Is there a roadmap of when we might be able to see leaderboard sorting order a parameter we can set?

,

Is there a roadmap for when we might see leaderboard sorting order as an optional parameter?

avatar image Brendan ♦♦ colinchiu · Mar 11, 2017 at 12:04 AM -1
Share

Sorry, but until something is in active development, we really can't speculate on a release date, as that would run the risk of someone taking a dependency on a date we can't guarantee. Also, we prioritize in part based upon the number of developers who have asked for a given feature, and to be honest, we haven't had very many requests for this to date.

avatar image Chris · Mar 28, 2017 at 02:28 AM 0
Share

I also need this, and hope it will soon be implemented...

avatar image hampusbankler · Oct 02, 2017 at 04:20 PM 0
Share

I was looking for this as well. In a racing gamemode, it makes sense to store the time (where low is better). I'll try @ottolb's solution with the -1 multiplier for now. Nice workaround that I didn't think about! Thanks!

avatar image hampusbankler hampusbankler · Oct 06, 2017 at 05:08 PM 0
Share

One problem with the workaorund though, is that if you press the trashcan to delete an entry, it will set the entry value to 0 instead of something like int.MinValue. This will make the "deleted" entries come up on top, requiring client side filtering.

avatar image Brendan ♦♦ hampusbankler · Oct 06, 2017 at 06:30 PM 0
Share

Yes, if you're using this workaround, you would need to "clear" a player's statistic by setting it to the max value, instead.

Show more comments
avatar image lsummers · Feb 25, 2018 at 05:33 AM 0
Share

Ouch, this is the second time in a row I've come to this forum for a critical feature, only to find it missing. I'm confused why the aggregate minimum even exists if the leaderboards can't be returned.


I don't want to mess with my score results, and there is no way to query the number of entries in the leaderboard. So is the only solution then to pull the (entire) leaderboard, and only take off the last entry? Well, I suppose the good news it isn't like there are a lot of gulf-style scoring games. I know I know, it isn't a priority to the PlayFab team and isn't going to be added anytime soon. Just, frustrating that happens a lot on here.

avatar image Brendan ♦♦ lsummers · Feb 25, 2018 at 06:02 AM -1
Share

Sorry, but there are a great many features on the list of things we'd like to do, but we have to prioritize. Our prioritization is based on the number of developers that are asking for a feature, the impact the feature will have for all developers, and our own strategic decisions (PlayStream, for example, enables a massive range of live game operations mechanisms, but wasn't something developers specifically asked for - it was simply clear that it would be a major game-changer for our development community, so we prioritized it). And since we haven't had a ton of requests for descending-ordered leaderboards, it hasn't been prioritized.

The min aggregation method is available for the same reason it was when Xbox Live added leaderboards (and also only had descending sort) - because there were cases where it was useful, and it was low-hanging fruit.

But to be clear, no, it is not possible to pull the entire leaderboard. That would mean generating a massive number of API calls per player, which could get your title throttled or blocked. If a feature is something you need, I'd recommend adding it (or liking it, if it's already there) in our Feature Requests space.

avatar image lsummers Brendan ♦♦ · Feb 25, 2018 at 06:40 AM 0
Share

I mean well with what I am about to say, but putting a 2 year old feature request into your companies backlog and waiting for it to one day be addressed is not a proper use of my time and undermines the purpose of a BaaS.

A BaaS should simplify and scale back-end services. When trivial functionality is missing then it stops serving that basic purpose.

This is only one of many trivial items that is over 2 years untouched and really has no excuse to remain unresolved. Sorting ascending, descending. And basic CRUD operations - these are not feature requests, this is prototyping 101, and should have failed any QA process I've ever seen. I started working with PlayFab a few days ago to assess its viability and I'm not impressed.

There are open source / free alternatives (nakama / deployd / etc) raw services (firebase etc) and competitors (gamesparks etc) that don't have this incomplete prototype problem. This feels like a staffing or money issue. I'm not sure PlayFab is production ready... and it questions the risk of reliance - IMHO of course

avatar image

Answer by adeel3786 · Aug 04, 2018 at 05:07 PM

Just came across this post and was going through the same issue. My game is best on time so the quicker the time, the higher the player should rank. I tried using the x by -1 but the issue with the "0" value was a long and necessary process to handle. However, I managed to overcome this by reversing the order of the statistics gathered from PlayFab.

I'm Using Unreal Engine, so my values get stored into an Json array. There is a simple node called "Reverse for each loop".


Solution:

Once I gathered my leaderboard data into an array[1], I created another function with the reverse loop node and before my very eyes it reversed the order into another array[2]. I then fed array[2] to fill my leaderboard. :) Happy times.




Comment
Meltdown Interactive Media

People who like this

1 Show 6 · 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 Brendan ♦♦ · Aug 05, 2018 at 12:30 AM 0
Share

Can you clarify what you mean by "fed array[2]"? The design of the system is that each client would be triggering (usually to Cloud Script, but it could be via a custom game server) the update of a player's statistics. It sounds like your solution involves writing stats for all players in the game at once, which isn't supported.

avatar image lsummers Brendan ♦♦ · Aug 05, 2018 at 12:33 AM 0
Share

To be fair, nothing is supported in this thread including min score support in general.

So. There's that.

avatar image Brendan ♦♦ lsummers · Aug 05, 2018 at 12:42 AM 0
Share

Actually, no - you can easily store inverse scores and simply invert them for display. That's a common technique used by racing games in this type of leaderboard - store the time as (max time - player's time). That gets you the correctly ordered list of players, in a descending score leaderboard.

We will be supporting ascending score leaderboards in a future release. In the short term, our goal is to work with developers to help them achieve their design goals within the existing system.

Show more comments
avatar image

Answer by evan · Jun 28, 2019 at 09:46 AM

+1 for this feature request

Comment

People who like this

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

Answer by Andreas Gullberg Larsen · Aug 06, 2019 at 12:34 AM

I came here for the same feature request, however, I had not thought of the simple workaround of storing inverse scores. I believe that should work for me, so thanks for the tip.

Comment
Dominic Williamson
robinzinser

People who like this

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

Answer by Davit Datunaishvili · May 11, 2020 at 07:33 AM

I had the same issue and fixed it by setting maximum value as a default and multiplaying to -1

Okay, but I do not understand why it is so difficult to make aggregation leaderboard and float numbers as an option.

I mean, I am sure PlayFab has professional programmers. I do not believe that it is very difficult thing to fix but at the same time it is very important for users. Can't you spend some hours for fixing these important issues for all these years?

Weird!

Comment

People who like this

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

Answer by Chris · May 11, 2020 at 09:33 AM

I agree! This wait for a feature for over 5 years is getting ridiculous...

That's a pretty simple feature to implement, and frankly I don't understand that it hasn't been thought of from the beginning...

And for the "not breaking things" sake, just add a boolean argument to the call, specifying minAggregation, defaults at false....

We shouldn't have to "hack" this in.

Comment
Rodrigo

People who like this

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

Answer by beharstudios · Jun 05 at 02:52 AM

Came across this thread in the need for this feature. I've worked with 3 leaderboard APIs so far and it was a fundamental feature to control the order in all of them.
@brendan this feature has been asked 6 years ago. Clearly something is wrong with the prioritization process if such a small feature hasn't been implemented yet (I assume it's a week worth of work plus testing?).
You can probably do a data query to see how many users upload results with a minus sign to understand the demand, but then again, isn't it just faster to implement it?

Hopefully we can get a better ETA for that matter.

Thanks,

Noam

Comment

People who like this

0 Show 1 · 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 beharstudios · Jun 05 at 04:29 AM 0
Share

BTW- I tried the inversed method and it creates a different problem- I can't easily look at the leaderboard in the Web portal and read the scores and look for potential cheats. This is pretty annoying.
Please folks, we not asking for much, let's just add this boolean to the request.

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

    9 People are following this question.

    avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

    Related Questions

    How to manage daily, weekly, monthly , All time leader board for single statistic? 1 Answer

    Statistic limits? Usage in 24 hours? 1 Answer

    Best Approach for getting leaderboards (Login by FB) 1 Answer

    GetFriendLeaderboardAroundPlayer not returning Facebook friends. 2 Answers

    How to implement a per-level leaderboard? 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