question

Philip Alexander Prates Machado avatar image
Philip Alexander Prates Machado asked

How to "ranked matchmaking"?

I am quite at loss at how to implement the playfab side of things when it comes to ranked matchmaking. Some questions:

1-I am gonna need to store the ELO or MMR info server side for obvious reasons, i spoke with brendan on discord and he said i should add a statistic, how do i add a statistic to each player in the playfab dashboard?

2- I am gonna need to get this statistic when the player logs in, how do i do that?

3-when the player finishes a match i'm probably gonna need to use a cloud script to get all the players in the ticket for that match and calculate the appropriate elo/mmr changes and update the statistic, how do i do that?

Matchmaking
10 |1200

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

brendan avatar image
brendan answered

Thanks for posting here - the forums are definitely the best resource for technical support in general. Since our matchmaker is designed to allow for a wide variety of matchmaking styles, we don't have a specific one-size-fits-all ELO type system (since our experience has shown that inevitably, developers need to make adjustments based on their own needs). So to do this, yes, you'd add your own statistic that tracks the player's ELO/MMR. Specific to your questions:

1. You would add this using the API calls - specifically, I'd recommend not allowing the client to update statistics (the default), and only updating it from the server. You can set a "base" ELO value on the player account on login using a PlayStream Rule that fires on the player_added_title event, setting the statistic to your default.

2. On any login, you can retrieve stats via the InfoRequestParameters. Alternately, you could just call GetPlayerStatistics.

3. You'd want to have the server that hosted the match drive this. It's going to need to update other statistics for the players as a result of the match in any case, so doing the calculation there and posting them as part of that would be the way to go.

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.

Philip Alexander Prates Machado avatar image Philip Alexander Prates Machado commented ·

1- So just to make sure, there is no way to add a custom statistic through the dashboard? that seems kinda odd. With that rule it is safe to assume that old accounts would not have an ELO statistic only the accounts created after i set that playstream event?

2- this seems pretty straight forward.

3- so no need to use cloud script, just use the server to update the value, not sure if unreal ships the server code with the client code so im gonna have to check that to see if there is no security issues.

0 Likes 0 ·
Philip Alexander Prates Machado avatar image
Philip Alexander Prates Machado answered

So here is what i did so far, let me know if i am doing things as they are supposed to be.

I went into the dashboard, created a new matchmaking rating leader board and set the playstream event "player_added_title event" to add 1200 (just an arbitrary number copied from league of legends).

This should set the players MMR to 1200 when they create a new account correct?


I was under the impression that "statistics" were different from leaderboards but after searching the dashboard i found that when you try to change a "statistic" playstream asks for a leaderboard value, so i am assuming they are the same thing? i should just use a leaderboard for the match making rating correct?


I am going to need to update the MMR after each game so i am assuming "GetPlayerStatistic" is more suitable to be called every time a game ends since the login stuff only get updated once when you login.

So now it is where i am a bit lost, i need the server to drive the mmr calculation but they are running on your end, so i am assuming i need to do this in my unreal server build.
So how i am imagining this is i simply call the appropriate function when the game ends and it updates the mmr accordingly, i looked into it and saw 1 function that might do the job, "Update Player Statistics" is this the one that i should use? i am a bit confused since there's 2 of them, one in the client and other in the server version of the blueprint nodes.

Edit: after running around with this a bit ive come to the conclusion that there is not safe way for me to update the MMR in the server instance, the only way i could do that would be by passing either the raw MMR when i connect to the server (not safe because players could connect with the wrong mmr) or the player ID(still not safe and getting the mmr statistic could fail leading to bad mmr calculations), so i am a bit lost on how to do this.

I imagine the best way possible would be to somehow get the ticket of the match (but i would still have to pass the ticket ID as an argument and the the callback could fail) and calculate the changes based on that?

What did you guys envision when creating playfab to solve this?

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.