question

emaalouly1 avatar image
emaalouly1 asked

Photon + PlayFab matchmaking parties (invite friends)

Hello all,

I have been using photon for a while now and I decided to add a mathmaking system similar to the one in League of Legends where players can invite their friends into a room and then matchmake together to find other players. Unfortunately photon doesn't support parties, so each player will end up in another room. I searched the web for a solution and found out that PlayFab would help with this along with photon, so I downloaded it and been trying to tweak this thing to work but haven't been able to make it work, nor could I find a solution for it online.

I have already made the login with playfab and photon, and players can get into the same room with photon, but matchmaking them with other random players is the problem left.

Anyone have implemented this before can guide me on the idea of how to do it? Or can give me a good solution for it?

Thanks!

FriendsMatchmaking
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

Matchmaking in Photon is always done using the Photon matchmaking logic - the current matchmaker in PlayFab is for getting players into dedicated server sessions (hosted game servers). The Exit Games team may have additional recommendations, but one way to do this would be by having one player do the matchmaking call, checking the players count on the room to ensure there's enough room, and having the other players follow.

I would also recommend adding a value in Title Data to control how many retries you do, as well (player joins one Room, but finds that someone else did, so now there's not enough room left, so he searches again). After retrying that many times, you would create a new Room instead, so that others can join that game instead. Depending on your player concurrency and session length, the frequency with which that condition (finding a room, but not getting all the other players in fast enough) could occur will be pretty variable. Setting it too high could result in taking too long to get a game, while setting it too low could result in teams only ever playing against players who aren't joining as a team.

Another thing you could do (depending on your game's requirements) is to set a Room property for "only parties" or "prefer parties" and use it as part of your matchmaking logic, so that teams search first for those Rooms (and non-teams search with that property set to false).

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

emaalouly1 avatar image emaalouly1 commented ·

Thank you @Brendan Vanous! u've guided me into the direction I needed to start. I will start implementing it as soon as i'm done with my friends list system.

0 Likes 0 ·
emaalouly1 avatar image emaalouly1 commented ·

Well I have taken @Brendan and @Hamza Lazaar's advice and successfully joined players in parties together. Now I have encountered a new problem which is setting players into teams. I want the parties to be allocated into the same team (ex: Teams of 10 vs 10), but if let's say a party of 9 players is joined with another party of 9 and another party of 2, that's 20 players, but the party of 2 will have to be split into separate teams.

Is there any way I can set a filter for this before joining a random room? Or am I obliged to kick the party of 2 and wait for 2 single players to join?

0 Likes 0 ·
brendan avatar image brendan emaalouly1 commented ·

While you can use slot reservation in Photon matchmaking, you are correct that you can't reserve them as a team. Just starting with the 9 player search at the start, the team leader doing the search could find a session with 9 slots open, but 4 are on one team and 5 on another. Still, there are a few ways to handle this, such as matchmaking players into team lobbies where the max player count is for one team. So, a player creating a new lobby would actually create two - one for each team - and then collapse that to one room to start the game session.

0 Likes 0 ·
emaalouly1 avatar image emaalouly1 brendan commented ·

I didn't quite understand how can a player create lobbies? I think you mean rooms. so I need to make double reservation: First the host of the 9 player team starts random matchmaking searching for a room of maximum 10 players, then when the room is full, I switch to another matchmaking searching for a room of maximum 20 players reserving 9 slots. is that what you meant?

P.S.: I am currently doing the matchmaking logic on the client side. is there a way I can do it on the server side (cloud script)?

0 Likes 0 ·
Show more comments
Hamza Lazaar avatar image
Hamza Lazaar answered

Hi @emaalouly1,

As @Brendan Vanous suggested, best way is to let a single player do the matchmaking for the team or group of friends.

You can do this w/ or w/o PlayFab it's up to you.

A nice Photon feature that could help you is "Slot Reservation", give it a try.

You may find inspiration from this thread. It's about how to achieve skillbased (ELO) matchmaking in Photon but the concept is the same: break the process into steps and let a single player handle it.

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.

emaalouly1 avatar image emaalouly1 commented ·

I've been looking for a feature like the "Slot Reservation" u've suggested but couldn't find one. THANKS A LOT @Hamza Lazaar! it's a great feature to use in matchmaking parties.

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.