question

sennenryuzoro avatar image
sennenryuzoro asked

How to achieve a connection of multiple players in 1v1 matches on the same server instance?,

Hello


I am working in Unity on a 1v1 turn-based card game,

where players should connect in matchmaking and play 1v1 games.

I have followed the documentation and this tutorial series,

I've managed to create a server build, upload it, setup a matchmaking queue,

create a ticket in 2 local client Unity editor instances, get a match, and join clients.

But that is a case with only 2 players using 1 server instance,

per matchmaking queue match size (min=2 to max=2).

How can I achieve a connection of multiple players in 1v1 matches on the same server instance?

I expect thousands of simultaneous matches, it would be great if more of them could be run on the same server instance, is this possible using Playfab (how?), and if not, which service do you recommend?

Thank you for your time.

,

unity3dMatchmaking
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

·
JayZuo avatar image
JayZuo answered

We'd suggest always using one server instance for one match. In your scenario, it's 2 players using 1 server instance. However, please note one VM can host multiple server instances. In your build, you may set 10 "Servers per machine" or even more.

What we'd recommend is doing some performance testing of your server to know how well they deal with 'n' instances per VM. You want to tune 'n' to be as high as possible before you see degradations in the client experience and the VM Metrics (preview) can also help you calculate the optimal number of game servers on a specific Virtual Machine SKU (type).

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.

sennenryuzoro avatar image sennenryuzoro commented ·

Hi Jay, thank you for your time,

I appreciate the suggestion, and have a few follow-up questions:

1. Is there still a limit of 60 servers per VM as mentioned in this post?

2. How many VMs can be assigned to a single title at maximum?

3. To put 1. and 2. in other words, is using Playfab for 1v1 2player matches per server instance scalable for thousands of simultaneous matches?

4. Is it possible to create matches with an even number of players and create a "virtual" match using Mirror Networking for Unity and start 1v1 gameplay as each second player enters the queue, or is it overcomplicating of a "simple 2 players per server build instance" case (and I should just go with it)?

5. Is there a documentation describing the flow of matchmaking methods in more detail? Specifically, does Playfab automatically start the server for each queue, or for each match (before PlayFabMultiplayerAPI.GetMatch calls the GetMatchResult response), and at which time? For custom server request I succeeded with calling RequestMultiplayerServerRequest, but since that code isn't used in the matchmaking, I am unsure at which time Playfab starts the server for that case.

Thank you, and have a nice day!

0 Likes 0 ·
JayZuo avatar image JayZuo ♦ sennenryuzoro commented ·

1. Yeah, currently there is a limit of 60 servers per VM. Actually, it's 60 ports per VM.

2. This depends on how many quotas you have. Please see Managing quota changes - PlayFab.

3. Yeah, it's possible. You can have as many VMs as you need.

4. You can choose either way. "2 players per server instance" is the simplest way to implement.

5. PlayFab will allocate the server instance when a match is found. For more details, please see Integrating with PlayFab Multiplayer Servers - PlayFab.

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.