question

Cedric Neukirchen avatar image
Cedric Neukirchen asked

CreateMatchmakingTicket - User Attributes (such as ELO/Skill)

Hello everyone,

I had a look today at the Multiplayer Matchmaking documentation and so far so good, it seems rather clear. One thing that strikes me though is that the CreateMatchmakingTicket Request call requires me to specify the ELO/Skill value that is used to match players.

The "I want to Matchmake" call that in the end calls CreateMatchmakingTicket is called on the Client when they click on Matchmaking on the UI. This is all locally. Why would I want my Client to set the skill value of the Matchmaking request? I mean, I would probably have it in the ReadOnlyUserData, which I retrieve when the user logs in. However this can be modified by various cheat programs. This would allow the client to adjust the value, queuing for matches with a fake Skill/ELO value.

Why is this not done by PlayFab on the Server Side? I would have assumed that specifying the value in the Queue Setup would result in PlayFab pulling that data by itself.

Maybe I'm misunderstanding it, but the API says the Creator is required (which makes sense) and in the Quickstart you peeps are showing how Skill/ELO is set in the Attributes.

Further, what exactly is:

Entity = new EntityKey
{
   	Id = "<Entity ID goes here>",
	Type = "<Entity type goes here>",
}

This is part of the Creator Object. I assume the Creator is just the player, so why is it not using the Authenticated Player who issued the call? Is the Entity part required and if yes, what do I type there for type and id (playerId?)?

Cheers,
Cedric
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.

1 Answer

·
Citrus Yan avatar image
Citrus Yan answered

Hi Cedric, first of all, attributes can be specified in two ways, either:

  1. Within the create ticket request
  2. In the player’s entity

It’s better for you to specify the Skill/ELO value in the player’s entity, it’s more secure. You can navigate to the doc Specifying through player entities, this may make more sense for values that persist for a user, or that users cannot be trusted to submit. I think it can clear up your doubt about why skill values are not done by PlayFab on the server-side, actually, it does.

Now, about setting attributes on the client, I believe PlayFab designs it for some reasons. As far as I understand it, it’s probably not for setting values that persist for a user, it’s rather for setting values that are changing due to different situations. Take latency for example, it depends on the network environment and must be specified by the client to provide better game experience for the players. You can check this doc Region Selection rule to find out more.

About the Entity question, yes, Entity Key is required. Entity Keys are used to identify entities in most newer API methods(CreateMatchmakingTicket API is one of them). The “Id” field is a hexadecimal string that identifies an entity, which is not the playerId. The “type” field is a string that indicates the type of the entity, for now, we have 6 built-in entity types such as “master_player_account”, “title_player_account”, etc. Take entity “title_player_account” for example, you can get it using any normal login call(now Entity Key is automatically returned), or by calling the GetEntityToken API method. Anyway, here is the sample Entity Key I retrieved using LoginWithCustomId API:

"Entity": { 


"Id": "37E23F7F8E3CBC92", 
 "Type":
"title_player_account", 
"TypeString": "title_player_account" 


}

To get more understanding about Entity, you may need to navigate to this doc Entity Programming Model (https://docs.microsoft.com/en-us/gaming/playfab/features/data/entities/) to find out more.

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.

Cedric Neukirchen avatar image Cedric Neukirchen commented ·

Hey Citrus, thanks for you quick response.


Having the Skill/ELO value in the Player's Entity is probably want I was expecting.
I see that having the ability to specify other, non-relevant, infos from the client itself (ping), is a good way of using the ticket object.

Now the "SetObjects" call, mentioned in the link you shared, would set the skill value on the PlayerEntity. Looking more into the Object Entity topic, I found that I can see the objects in the player profile under, well, Objects. There it says we can only link 5 objects to the title player.
Is there any data that qualifies for this despite Skill/ELO? Should I make one object called "data" with a nested object "skill" to keep the object count low?

Further the way I expect Skill/ELO to work for us is, that after a Match the DedicatedServer tells PlayFab who won the match and who lost. Based on that, we would recalculate the Skill/ELO values of the players and update them (all in CloudCode). Is it possible to call the SetObjects stuff via CloudCode, specially with accessing the entities of all players?

If possible, the Client should never be able to adjust their Skill/ELO value themselves.

Cheers,
Cedric

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan Cedric Neukirchen commented ·

Hi Cedric,

You can store any other custom data (such as player profile) in the objects for your game logic or any other purpose. If you intend to keep the object count low, it’s a good idea to make a “data” object with a nested object “skill”. It’s better for you keep these objects well organized logically for the ease of later access.

Yes, you can call SetObjects via CloudCode(I understand it as anywhere other than the client, CloudScript, Server API, etc. please correct me if I am wrong). The rough workflow is like this: 1) use GetEntityToken API to get your game title’s EntityToken. 2) Call SetObjects API with the title’s EntityToken retrieved before for Authentication, the parameter “Entity” is the Entity Key of each player, “Objects” is the object you want to set for the player, you get the idea. Anyway, you can have a try, any issues let us know:)

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.