question

Philip Alexander Prates Machado avatar image
Philip Alexander Prates Machado asked

Party matchmaking (steam and unreal) and best practices.

I have successfully implemented a soloQ with playfab? and now i want to do a party queue, for example me and 2 other friends in a party of 3 join a match, i am currently using steam for lobbys.

My first question is, when you create a ticket in the request you have to add "members to match with", this is an array of json objects, how would i go about creating this json objects in UE4 BP's (an example blueprint would be greatly depreciated)? also what is the best way to get those member values? i looked around and found 2 nodes that might do the job "get play fab ID's from steam IDs" and a "make clientGetPlayfabIDsFromsSeamIDsRequest", using those is best practice or is there something that i am missing?

Second question is, after the other members join the match making ticket with "Join Matchmaking Ticket" node do i need to call "Get Matchmaking Ticket" periodically on the party members (not party leader) OR i can just pass the ticket result through the steam lobby and have the other members connect through that? that would save some api calls but can it have bad results some how? what is the recommended way to do this?

Thanks in advance.

unrealMatchmaking
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 answered

I ended up using steam lobbies to pass the entity to the other party leader, the steam functions are "setLobbyMemberData" and "getLobbyMemberData", with your login result u can "getObjectField(Entity)" on the entitty token and THEN use the parse node from the playfab plugin.

After that just have your party leader get the values and use the "split" node from FString to get whatever info you need.

10 |1200

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

Seth Du avatar image
Seth Du answered

For the Q1, I have written a sample.

  • Event Graph

    https://blueprintue.com/blueprint/qo47m84b/

    • Functions

    1. CreateEntityKey

    https://blueprintue.com/blueprint/qomxc2i6/

    2. CreateMatchWith

    https://blueprintue.com/blueprint/0nkuztiz/

    3. CreateCreator

    https://blueprintue.com/blueprint/0ovf0t88/

    • Variables
    • 1. MemberToMatchWith

      Array of PlayFab JSON Object

      2. EntityKey

      PlayFab JSON Object

      3. SelfEntity

      PlayFab JSON Object

            Please feel free to change the title ID and title_player_account in my sample code. Still, using C++ can be more straightforward.

            In addition, to get member values, which are title player accounts, you may create a SharedGroup so that the data can be stored in SharedGroupData. In addition, I think using GetPlayFabIDsFromSteamIDs should be fine but please remember to call GetTitlePlayersFromMasterPlayerAccountIds after that because the matchmaking ticket requires Title player account. In terms of this scenario, there are many workaround solutions you can choose.

            For the Q2, it is still recommended having non-leader members to refresh the ticket state until it shows matched.


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

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

          I already got the "Creator" key and matchmaking working with a single player i just need to understand what is the best way to get the other players into the array.

          I am already using steam lobbies so a shared group would be redundant, i will just share through steam.

          My issue is more of a "how to parse the data" i guess, correct me if i am wrong but this is how i am currently seeing things, i get the entity key from a player login - convert it to string - pass it through steam to the party leader, party leader receives the strings and transforms them into the array of json objects.

          If this is correct, how do i transform the strings back to an array of json for the ticket?(first time using json)

          Can i just pop those strings into "GetTitlePlayersFromMasterPlayerAccountIds" and retrive the nescessary json object?

          Thank you.

          0 Likes 0 ·
          Seth Du avatar image Seth Du ♦ Philip Alexander Prates Machado commented ·

          I am not sure how Steam handles invitation information. If JSON can be contained in messages, you may use the C++ codes or MarketPlace Plugin to deserialize the JSON string, then convert it to PlayFab JSON object.

          In terms of this question, I believe you may find dedicated support from UE4 community.

          In addition, if players can directly send title_player_account ID to the creator, it seems to be unnecessary to have additional GetTitlePlayersFromMasterPlayerAccountIds API call, you may directly construct "Member to match with" Object Array locally.

          0 Likes 0 ·
          Philip Alexander Prates Machado avatar image Philip Alexander Prates Machado Seth Du ♦ commented ·

          But even if i send the title_player_account ID to the creator will it sufice to make the player list array? the player array is made of json objects, wont i need an identity for each player to put into that array? the issue is not how to pass information about about the other players, but how that formation is then transformed into an usable array of json objects...

          0 Likes 0 ·
          Show more comments

          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.