question

hendra avatar image
hendra asked

Get Other's User Data for Matchmaking

Hi, i'm trying to make a game like this.

1. Player registers and when successfull, i store data name "ELO" in players data.
2. Let's say we have 5 registered players and each have "ELO" data in players data.
3. Out of the 5 registered players, only 1 is currently playing and trying to find a match.
4. Search through all registered player with the same / similiar ELO value.
5. Get the player's data (Like name, and player's data like status, dmg, etc).

How do i get another player's data?

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

·
brendan avatar image
brendan answered

Well first, I would recommend storing skill in a statistic, since a) it enables leaderboards, and b) you can use a statistic with our matchmaker (https://api.playfab.com/documentation/Client/method/Matchmake). Going that route, you can simply set the statistic on the server, and then players searching on sessions will find the server with a statistic most closely matching their own.

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

hendra avatar image hendra commented ·

Hi, thanks for the reply.

So matchmake can be used where the other user is not online?

Right now, what i'm doing is
1. When user register is complete, i store an ELO value to a statistic and store their properties like (hp, attack, defense) to the players custom data.

2. When a user tries to find a game (by clicking a button), i request GetLeaderboardAroundPlayer to get some random user with similiar ELO.

3. I fetch the playfab ID from GetLeaderboardAroundPlayer response.

4. I request GetUserData by passing the playfab ID i got from GetLeaderboardAroundPlayer response.

Is that the right way to do this?


And also, is there a way to make bulk request?

So instead of calling UpdateUserStatistic to store the ELO and UpdateUserData to store their properties (which is 2 request).


I can make it 1 request but it stores the ELO and the custom data.

0 Likes 0 ·
brendan avatar image brendan hendra commented ·

Matchmake is specifically for use with custom game server hosting (https://api.playfab.com/docs/tutorials/landing-tournaments/custom-game-servers). If you're using custom game servers, you can use statistics to match players into sessions that are closest to their statistic.

For async (and particularly "challence") type systems such as you describe, yes, using GetLeaderboardAroundPlayer is the way to go. You can then store any additional data you need to run the match in player data (again, as you describe), or just store them as statistics on the player account, and then you can have them returned in the player profile info in the leaderboard call.

0 Likes 0 ·
hendra avatar image hendra brendan commented ·

Ahh i see,

Thanks for the help Brendan :D.

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.