question

vutruongwork avatar image
vutruongwork asked

How to store leaderboard values based on a couple of players

Hi, our game is a co-op game, so we want to store leaderboard values based on a couple of players.

Is there a way to achieve this?

Leaderboards and Statistics
untitled.png (41.6 KiB)
1 comment
10 |1200

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

vutruongwork avatar image vutruongwork commented ·

Can anyone here help me?

0 Likes 0 ·

1 Answer

·
Made Wang avatar image
Made Wang answered

If these players are friends, the leaderboards can be obtained through GetFriendLeaderboard and GetFriendLeaderboardAroundPlayer.

Regarding the leaderboards for co-op games, I noticed that you have a duplicate player in 5th and 6th place, which means that this player needs to store two statistics. You can set ProfileConstraints in Request Body and set ShowStatistics to true, so you can get all the statistics of this player when getting leaderboard. But these statistics won't be sorted in the same leaderboard, you need to sort them manually.

2 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.

vutruongwork avatar image vutruongwork commented ·

Each player in our game need to store multiple statistics. The number of statistics of each player is equal to the number of friends they have. And those statistics of each player must be the same as their friends. For example, Player_1 x Player_2 have the same score: 10

As far as I understand, the statistics in PlayFab are per players. This means there is no way to achieve this because PlayFab doesn't support it. Is that true?

0 Likes 0 ·
Made Wang avatar image Made Wang vutruongwork commented ·

If you mean you need to modify the same named statistics for different players at the same time, then PlayFab doesn't provide such an API, you need to modify it individually for each player.

Also, because PlayFab's statistical data is based on the name to generate the corresponding leaderboard, the statistical data of different names will not be sorted in one leaderboard, but you can obtain these data and implement the sorting method by yourself.

0 Likes 0 ·

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.