Party Matchmaking doesn't seems to work

I have two players in a opened Party.
Both player register to the onmatchmakermatched hook, waiting for a match to be found.
The party leader is the one adding the matchmakerParty.

socket.addMatchmakerParty(
    party.party_id,
    `*`,
    2,
    2);

Unfortunately the onmatchmakermatched hook is never triggered. I also tried without the wildcard and string properties, but there seems to be a problem when a party is involved. It works when i use the addMatchmaker (without party).

Here are the logs i got in the server:

2024-10-29 23:54:35 {"level":"debug","ts":"2024-10-29T22:54:35.765Z","caller":"server/pipeline.go:65","msg":"Received *rtapi.Envelope_PartyMatchmakerAdd message","uid":"dd33f264-61a2-49f5-bc3e-1d512d512797","sid":"bcabd2db-9648-11ef-b7ec-7106fdcb5b46","cid":"4","message":{"PartyMatchmakerAdd":{"party_id":"39ae75a6-6a25-4ac5-9a93-0de3b6341856.nakama1","min_count":2,"max_count":2,"query":"*"}}}
2024-10-29 23:54:35 {"level":"debug","ts":"2024-10-29T22:54:35.775Z","caller":"server/session_ws.go:397","msg":"Sending *rtapi.Envelope_PartyMatchmakerTicket message","uid":"dd33f264-61a2-49f5-bc3e-1d512d512797","sid":"bcabd2db-9648-11ef-b7ec-7106fdcb5b46","envelope":"cid:\"4\" party_matchmaker_ticket:{party_id:\"39ae75a6-6a25-4ac5-9a93-0de3b6341856.nakama1\" ticket:\"f2a3a3a2-d22e-4442-80ad-e2ffc368b25d\"}"}
2024-10-29 23:54:42 {"level":"debug","ts":"2024-10-29T22:54:42.973Z","caller":"server/pipeline.go:65","msg":"Received *rtapi.Envelope_Ping message","uid":"dd33f264-61a2-49f5-bc3e-1d512d512797","sid":"bcabd2db-9648-11ef-b7ec-7106fdcb5b46","cid":"5","message":{"Ping":{}}}
2024-10-29 23:54:42 {"level":"debug","ts":"2024-10-29T22:54:42.974Z","caller":"server/session_ws.go:397","msg":"Sending *rtapi.Envelope_Pong message","uid":"dd33f264-61a2-49f5-bc3e-1d512d512797","sid":"bcabd2db-9648-11ef-b7ec-7106fdcb5b46","envelope":"cid:\"5\" pong:{}"}

Don’t see any errors showing, nothing seems to happen after the partyMatchMaker is added.

Client: nakama-js 2.8.0
Server: 3.24.0

Hello @Laguigue,

If you have a party of 2 players and a min and max count of 2, I don’t think the matchmaker will ever find a match as the requirements are already fulfilled. From the logs you’re only submitting a single ticket (unless the other is omitted) - to get a match you’d need to increase the max size and submit at least another ticket from a single player, or another party of 2 (but then max size would have to be 4).

Hope this clarifies.

I think i see what you mean, but let me explain a little bit more the context.

In a match, people play against each others. As a player, you can chose to play in a 2, 3 or 4 players game.

If two friends in a Party want to find a match where they play against each other in a “1v1” game, the party leader will select the 2 players game. This is why it’s a minimum 2, maximum 2 players game.

If i understand correctly this specific case of 1v1 can’t be done with the partyMatchmaker. I’m thinking about the leader manually create a match and notify the friend with the matchId so he can join, the same way he’d join a party actually. Would that be correct ?

I think what you’re trying to do is more akin to a lobby system - players are in the lobby and can wait for more players to join, or start the game when the minimum requirements are met, and then play against each other in teams or all-vs-all.

This guide may be helpful to you: Creating a Lobby System - Heroic Labs Documentation

Late reply, but that solution was the right one.
I managed to create a nakama server with typescript, and implement the functions like in the documentation.
I also wrote my own code to create specific features, in the end this gives me a lot more flexibility, thank you very much to you

1 Like