Hi!
I have followed this template/tutorial:
I’m at the point where players can join a game via matchmaking, but I can’t figure out how many people are supposed to be in a match. In my game, there can be between 2 and 8 players in a match.
I think this is how matchmaking works:
- Players join matchmaker
- Players are added to the match in matchmakerMatched
- match is created after threshold(s) are met
- Players get the matchId
- Players can join the match via matchId
- we eventually get to the matchInit, matchJoinAttempt, matchJoin, matchLoop part on the server
At this point, how do the clients know how many players are supposed to be in a match? How can I tell if all of the matched players have joined?
Obviously, if 8 players have joined, the match is full, and every matched player has joined.
On the server, in the match* eg.: matchLoop methods, I have no idea how many people are supposed to be in the match. I haven’t found a way to query it, and it does not get passed in as a parameter as far as I can tell. In the sample, it is irrelevant, because it is only for 2 players.
Do I have to somehow store this information in a database outside of nakama in the matchmakerMatched method?
I am sure, that I have missed something in your docs. ![]()
Sidenote:
Things that have a very specific lifecycle, like matchmaking, or matches, would greatly benefit from visual guides/diagrams. ![]()
- Versions: Nakama v3.35.1, Windows, Mac, Linux, .NET SDK v3.21.1
- Server Framework Runtime language TS
Edit:
In this sample, the requiredPlayerCount is just a constant 2. The game logic is disconnected from the matchmaking just like in the nakama-project-template.