question

Oriol Perarnau Arnau avatar image
Oriol Perarnau Arnau asked

Wrong results when Leaderboard Around Character with CharacterType not equal type of given character

Hi,

So we're working on a game and when we ask for the Leaderboard around character with the function:

https://docs.microsoft.com/en-us/rest/api/playfab/client/characters/getleaderboardaroundcharacter?view=playfab-rest

And so we're asking for the characters of type barbarian around the player character for the km travelled, this one being an archer. And it returns a leaderboard but always centered into a specific position, ignoring our original statistics.

So maybe we're wrong, but we think that the Get Leaderboard Around Character only works when the character type is the same that the player's character type. Is this a bug or is it intentionally? And if it is, how can we solve this problem?

Leaderboards and StatisticsCharacters
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 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

Could you please describe your expected behavior? In our test, this API works fine. If you specify the character type in the request body of GetLeaderboardAroundCharacter, it would only return the corresponding type’s leaderboard. The position of characters would be the position within the same type.

In other words, if the character id is “archer”, and the character type is specified as “barbarian”, this API would return the barbarian’s leaderboard that centered on the requested character Id. Then, as this section said, the position of the character defaults to 0 when the character does not have the corresponding statistic. The archer’s statistic value would be 0, it’s by design.

If you remove the CharacterType field from request body, this API would return the leaderboard of all character types, and return this character’s actual statistic value.

4 comments
10 |1200

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

Oriol Perarnau Arnau avatar image Oriol Perarnau Arnau commented ·

All the characters have the statistic. So I'm asking for the km travelled for the barbarian type and I'm passing the archer who has also the km travelled, so the expected behaviour if our archer has 5km travelled, to get the X barbarians that have travelled like 4km, 5km, etc.

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang Oriol Perarnau Arnau commented ·

Thanks for the clarification. For such requirements, you can remove the CharacterType field from request body to request the leaderboard for all types, then extract the part of "barbarians" on the client.

0 Likes 0 ·
Oriol Perarnau Arnau avatar image Oriol Perarnau Arnau Sarah Zhang commented ·

Okay, but what if i want the X barbarian, i have to make a request asking for a lot more characters than really need it, like, what if there's no barbarian near our player? The only solution I can think of is: calling for some characters around and if there are enough barbarians stop, else call for more characters around, and wish that you will find the X barbarians that we want?

0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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