question

Raf avatar image
Raf asked

What's the best way to get a custom segment of players based on the user's current stats?

Hi there,

I have an asynchronous PVP feature in my game where the player can attack a specific enemy team from a list I provide them. I'm wanting this list to include some opponents harder than them and some easier (based on team power).

Currently, I'm using the leaderboard system and finding players around the user in power but I'm wanting these options to be more extreme (100 players might have nearly identical team power for example). Is there a better way to do something like this? Essentially I'm wanting a way of getting a player 20% stronger and 20% weaker.

Thanks!

Player DataCloudScriptLeaderboards and Statistics
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

>> Is there a better way to do something like this? Essentially I'm wanting a way of getting a player 20% stronger and 20% weaker.

There is no such API that can directly return a player list which 20% stronger than a specific player. PlayFab Player Segments filter conditions do not support statistics filtering which takes a specific player as the baseline. Besides, there a number limit of PlayFab Player Segments that may affect your use. Generally, for Essential tier users, the number of segments cannot exceed 10. PlayFab Player Segments would not be the best practice for this case. API GetLeaderboardAroundPlayer or GetLeaderboard return the “StatValue” of every player in the list, this “statistics value” can be used for calculation directly. So you can consider to request the leaderboard lists then filter the segments you need via calculation on CloudScript or on your own clients.

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.

Raf avatar image Raf commented ·

Thanks, Sarah! That's kind of what we were suspecting. GetLeaderboardAroundPlayer should work for us just fine though. I appreciate the help. Cheers

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.