Hello, I apologize in advance for my bad english, I hope I will be able to explain myself correctly.
In the past few days, I’ve been trying to figure out how to make a global matchmaking system, where lobbies with 1 to 4 players connect each other to start a 40 players game.
So far, my ideas and their problems are as follows:
Idea 1: MessagingService: I thought that I could try to make a Peer-to-Peer matchmaking system making it so when a player tries to start a game and there is currently no other matchmaking or if all of the matchmaking servers are full, the player’s server becomes a “Master” server and starts gathering all of the other future requests from other servers until the matchmaking is full, and then starts the game’s server.
Problems: I don’t really know how to manage a “Master” server closing. If the “Master” server leaves the matchmaking, who would the matchmaking ownership go to? How can I be sure that the new owner is still in the matchmaking and won’t leave as the message is being sent? Also, apparently, the MessagingService is not reliable, or at least that’s what many developers are saying
Idea 2: DataStores I could use the same methods used to create ServerLists, just with matchmaking. This way I would have a list of all open matchmakings and be able to make players join them
Problems: Who should run the code to create the server? I could update everyone once the player count reaches the threshold, but how can I update a datastore this fast? And what if there is 1 slot left and 2 players place themselves inside of the matchmaking at the same time? How can I check to make sure that one player is outside of the bounds of the matchmaking lobby? DataStore:OnUpdate() was deprecated but I really don’t see how a Peer-to-Peer system like MessagingService can be a good alternative, they work in such different ways!
Idea 3: Big games The last option is to create 100 players games and hope that at least 40 will join the server-sided matchmaking and won’t just go afk
Problems: The problem here is clear, if too many players go afk in a lobby, 39 players will get stuck. Not only that, but it would also limit a lot the ability to create parties with your friends! If i make it so the game only fills 50 slots by itself, then the probability of players getting stuck will get higher, but if i make it so the server gets filled, people can’t create parties
As you can’t see there doesn’t seem to be a clear “Best path” to follow. All of them have game-breaking problems and I really don’t know where to go from here.
Keep in mind that I need the system to be scalable. The game I’m working on expects anywhere from 15000 to 50000 players online on the release date, so I can’t create my own Node.JS server and expect it to survive. I don’t even have the funds to keep a server capable of managing such a wave of players open.
Please help me find a solution, I’m desperate