question

amazdeh avatar image
amazdeh asked

starting a match after two players joined

I want to start a match after minimum 2 players joined, actually the game is 2 player and I set both min and max players to two in GameMode but still the server starts when one of the players asks for a match and he receives server data to connect to it?
What should I do so server starts after two players are matched and then server info is sent to both?

10 |1200

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

1 Answer

·
brendan avatar image
brendan answered

The way the PlayFab matchmaker works is to find the first available slot in a server and return that to the client. If no slots are available in any server, it starts a new instance and returns the information on that server. To be clear though, there would already be a server host machine running already - that's what the min free slots setting does. It tells us how much capacity needs to be available at any given time, for players looking to join games. This is because the time it takes to get an EC2 machine from AWS, then mount the server image, copy your zip file to it and decompress it into a folder, and finally start the exe takes a significant amount of time, but the servers have to be ready to go in an instant so that players don't have to wait an excessive amount of time before their server is ready.

In your server logic, you need to have some form of lobby that is the "waiting" space for players while they're waiting on the game to start.

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

amazdeh avatar image amazdeh commented ·

Thanks @Brendan
I guessed that, We have the lobby now, we wanted to delete the code for it mostly if possible :)


I have a suggestion for you in general, please have a page in documentation called concepts or something similar which describes features and their parameters so users don't have to look at APIs or different guides to understand the systems.

0 Likes 0 ·
brendan avatar image brendan amazdeh commented ·

So, you're thinking of an "Intro to" guide for each feature area?

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.