question

robinb avatar image
robinb asked

Use Statistics value of Player Entity for MatchMaking rule

We're tracking player's Elo score (skill rating) through the Statistics feature. A CloudScript updates Elo scores using the PlayerStatistics:

  const request: PlayFabServerModels.UpdatePlayerStatisticsRequest = {
      PlayFabId: playerId,
      Statistics: [
          {
              StatisticName: nameElo,
              Value: elo
          }
      ]
  };
  server.UpdatePlayerStatistics(request);

We're currently integrating MatchMaking (public preview) into the game. The idea is that clients don't send their own stats in the CreateMatchmakingTicketRequest call - rather, we want to use "Attribute Source: Player Entity" to directly pull from the PlayFab User DB.

To my understanding, this only supports retrieving data from Entity Objects (https://docs.microsoft.com/en-us/gaming/playfab/features/data/playerdata/entity-objects), not Entity Statistics (https://api.playfab.com/documentation/server/method/GetPlayerStatistics) though, is that correct?

If so, what's the best way to handle this? Should we just extend our CloudScript that updates statistics to also post the same data to an object as well? Or is there a better way?

Thanks a lot!

Player DataCloudScriptMatchmaking
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.

robinb avatar image robinb commented ·

Update: for now, we've solved it modifying the CloudScript method that calls server.updatePlayerStatistics to also call entity.setObjects, producing a json blob with the same data. The MatchMaker can then use the TitleAccountData's Object for the matching.

This is far from optimal, as we have data duplication (risk for bugs, more data than needed, more difficult to manually edit etc.), but it works for now. I'm still interested in whether there's a cleaner way to use Statistics for MatchMaking criteria.

0 Likes 0 ·

1 Answer

·
Citrus Yan avatar image
Citrus Yan answered

Hi, technically speaking, there is no “Entity Statistics” to offer for now. According to the docs, there are more entity types added in the future, at the present you may have to stick to the workaround. By the way, you could also make a Feature Request about this, here is the link: https://community.playfab.com/spaces/24/index.html

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