Idea

brendan avatar image
brendan suggested

Leaderboards - Questions and suggestions

10 |1200

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

1 Comment

·
brendan avatar image
brendan commented

vallcrist
started a topic on Sun, 30 August 2015 at 1:18 PM

Hello everyone, I'm trying to use Playfab in one of my projects and I've hit some issues with the leaderboard system so far :

1 - The project is supposed to have a ranking system where each player has a score ( think elo system ), and based on this score we should have 3 leaderboards, world leaderboard, friends leaderboard and country leaderboard.

World and friends is ok, since playfab already gives me that by default, the main problem is the country one. I haven't found a way yet to create a leaderboard with a segment of the userbase, of course I could make every player have 2 stats, elo and elo_COUNTRY_CODE, but i feel that wouldn't be the correct way to do it, and it would get really tiresome if I had to keep track of different leaderboards.

2 - When getting leaderboards result, what we get is simply position, score, display name and playfab id.

The problem with this is, our project does not use the display name, as that's supposed to be unique and we don't want that so the player display name is actually a public data field called "player_name", we also use facebook integration and we would like to show the users picture in the leaderboards, but for that we need to know his facebook's id in our game.

In order to get both informations we have to make a playfab api call, and since playfab does not have a "bulk get user data" call, for each and every player i want to show in the leaderboard I have to make a playfab api call, and I imagine this is going to get heavy if I have a scrollable or paginated leaderboard where I want to show a lot of the entries.

I have 2 suggestions that could make this better, first one is make the GetLeaderboards call also return public data and possible integrations the player has, second one is make a batch api call for getting user informations so we can bundle a bunch of ids together in order to save api calls / processing time


9 Comments
johntube said on Sun, 30 August 2015 at 2:08 PM

Hi @vallcrist,

I support your suggestion of having GetUserAccountInfo and GetUserCombinedInfo for multiple users : GetUsersAccountsInfo and GetUsersCombinedInfo that take an string array of PlayFabIds instead of a single PlayFabId string.

CloudScript is not a solution to the problem described here since it consumes API calls anyway. But it could save a lot of RTTs in one.

Meanwhile, you could only "request what's on the screen" : you don't have to get all the data of the whole leaderboard list. Instead make the necessary API calls for the players present in the screen and add more only when scrolling.

I think you should make a new post in Features Request section.


Brendan Vanous said on Mon, 31 August 2015 at 11:18 AM

Thanks, guys - I've moved this to the Feature Request forum, for clarity. Having additional options to get more info on players for the leaderboards is indeed something that's on our backlog. I'll add these notes to that item, to make sure we're thinking through all the needs in this space when we start in on that.


vallcrist said on Tue, 01 September 2015 at 7:50 PM

Hey @Brendan, thanks for the quick answer.

What about my first issue, could you tell em if there's anything I can do differently or if you guys plan to add such a functionality in the near future?


Brendan Vanous said on Tue, 01 September 2015 at 11:30 PM

Hi again,

So your initial issue was that you wanted geo-localized leaderboards. Right now, you would indeed need to do this by having distinct statistics for each country, as we have global and friend-based leaderboards. We prioritize in part based upon the most-needed features of our community, which is why this has been moved to the Feature Suggestions area. At the moment, this is not on our priority list, as few people have asked for it. So as I said, I would plan on using the multiple stat version for now.

Brendan


vallcrist said on Wed, 02 September 2015 at 12:23 AM

I see, thank you brendan. :)


johntube said on Wed, 02 September 2015 at 1:11 PM

hey vallcrist,

This is just a suggestion:

Instead of saving data to UserData try TitleData this will let you do "bulk load". For instance I'm saving players' avatars as base64 string in UserData and now I'm moving it to TitleData with this key format: "{PlayFabId}_avatar".

Regards,

Hamza


Brendan Vanous said on Wed, 02 September 2015 at 1:31 PM

That's potentially problematic as the title scales, though. An Avatar per person - and note that this would result in Avatars even for players who have since stopped playing the game - would result in an excessive amount of data as you grow to thousands of users. We're working on providing some clearly defined limits for our ToS, but for this specific design, you would have an increasing delay in the response as the number of items being returned grows (there's no getting around the physics of data queries), and you'd eventually hit a hard limit of total data which can be returned (likely to be around 5MB, but again, we'll publish all the details on these limits as soon as we can).

Brendan


johntube said on Wed, 02 September 2015 at 4:30 PM

So Brendan what do you suggest ? Deprive users who do not want to link facebook or Google+ from the right to a personalized profile picture ? use another 3rd party service to host uploaded pictures ? use the Admin API call in client application ?

this is a related feature request


Brendan Vanous said on Wed, 02 September 2015 at 6:04 PM

Nothing prevents a title from having personalized profile pictures in PlayFab. What I read the suggestion to mean was, store a picture for each player in Title Data, and read that for all players. If it's being limited to a subset of players (requesting the pictures only for those players, using their PlayFab IDs as they Keys), that could work, though it would be simpler to use Shared Group Data to do this, since you can write to that from a Server API call - that makes it possible to let the player update their picture using Cloud Script (since it takes an Admin call to write to Title Data, it would have to be either a tool the developer uses, or a server they run). But what I was highlighting was that the "bulk load" needs to be done in a limited manner - don't try to load all pictures for all users, or you'll rapidly run into size issues as you scale your title up to large numbers of people.

Brendan

10 |1200

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

Write a Comment

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

Your Opinion Counts

Share your great idea, or help out by voting for other people's ideas.

Related Ideas