question

Markus Henschel avatar image
Markus Henschel asked

Matchmaking with Server Allocation

Hi,

I'm playing around with Matchmaking and I can successfully queue and get into a match. For now I just deployed to one region and added a fixed latency value for that region into the "latencies" matchmaking attribute. This seemed to be required for the mandatory region selection rule in matchmaking.

To be able to deploy to different regions (only one per build for now) I added all the playfab regions into the latencies array with the same latency value too. Suddenly I could not connect anymore. The clients where getting the "Waiting for Server" status but never got into a match.

I narrowed it down to one region in the latencies arrays that caused this: "SouthAfricaNorth". As soon as this region is part of the latencies attribute server allocation doesn't work for me anymore.

Do you have any idea why this happens?

Also I'm wondering how the client is supposed to get to the relevant regions to ping them to get latency values. The only API I found was GetGameServerRegions but what should be supplied as "BuildVersion"?

Regards

Markus

Matchmaking
10 |1200

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

brandon@uprootstudios.com avatar image
brandon@uprootstudios.com answered

@Markus Henschel I just tested with our application and can't reproduce your issue with the region "SouthAfricaNorth". We tried adding that region to our latencies list, and we could still get the match and connect to our servers. Are you using Servers 2.0?

Also, I don't think there's a built-in API for getting latencies. The one you're referring to (GetGameServerRegions) seems to be for the old legacy matchmaking system.

The way we're doing it now (we use Unity, but it might be easier in other engines) is by using the ListQosServers API to get the list of QoS Beacons from PlayFab, compare that list with the list of Azure regions we're deployed in, then sending a UDP datagram to each endpoint and measuring the time it takes to get a valid response. You can read more about that here

If you are using Unity, you can look into various different ways of opening UDP sockets and sending/receiving UDP messages. We're using an open-source socket manager, which you can read more about here

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

Markus Henschel avatar image Markus Henschel commented ·

Hi Brandon!

Thanks for testing. Yes, we are using Multiplayer Server 2.0. I did some more testing and I think it might not be directly related to that specific region. I again could not get into a match after trying right now with SouthAfrikaNorth being removed (even though I could repo it previously multiple times). So I removed all the regions again and only left the one we are deploying to right now and it worked again.

Might it be possible that if latency info for regions is supplied that no build is currently deployed to a region without builds get selected for matchmaking? Then it would not find any servers in it. There might also be a corner case when all latencies are the same value?

If this theory is correct it would mean the client somehow has to know the list of valid regions it should supply latency information for. I hope sombody can shed some light on how this works internally so I can get to the core of the problem.

Thanks for sharing how you calculate the latency values. I guess we will implement something similar.

Regards

Markus

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan Markus Henschel commented ·

Can you share your title id? We'd like to get more details about your build/queue configurations, like what's the value of the "Maximum servers" and "Standby servers" you set for each region, the details of Region Selection Rule configuration, etc.

0 Likes 0 ·
Markus Henschel avatar image Markus Henschel Citrus Yan commented ·

Hi, please see my anser below.

0 Likes 0 ·
Markus Henschel avatar image
Markus Henschel answered

Sure. Our title id is 625F3. Currently the "Default" queue we created works with providing those regions with a latency value of 150 from the client:

const char* Regions[] = 
{
	"AustraliaEast",
	"AustraliaSoutheast",
	"BrazilSouth",
	"CentralUs",
	"EastAsia",
	"EastUs",
	"EastUs2",
	"JapanEast",
	"JapanWest",
	"NorthCentralUs",
	"NorthEurope",
	"SoutheastAsia",
	"WestEurope",
	"WestUs",
	//"ChinaEast2",
	//"ChinaNorth2",
	//"SouthAfricaNorth"
};

If I add any of the commented out regions the clients keep hanging in the "Waiting for Server" state in matchmaking.

When I tested the behavior I used this queue configuration to get into the match with just 2 clients:

"MatchmakingQueue": {
    "Name": "Default",
    "MinMatchSize": 2,
    "MaxMatchSize": 2,
    "ServerAllocationEnabled": true,
    "BuildId": "15578e92-f80b-4d0c-ae5e-b385a374e58c",
    "Rules": [
        {
            "Type": "RegionSelectionRule",
            "MaxLatency": 1000,
            "Path": "latencies",
            "Weight": 1,
            "Name": "RegionSelectionRule"
        }
    ]
}

(Our currently deployed "Default" queue allows more players and has a player expansion over time rule that I deleted.)

The build that this queue references has only one Region "WestEurope" with:

Build name: PT_J2_191125.1015
Build: ID15578e92-f80b-4d0c-ae5e-b385a374e58cBuild 
Virtual machine size: Standard_D1_v2 (1 core)
Servers per machine:1
Platform: Windows
Standby servers: 4
Maximum servers: 8

Thanks for looking into this. Please let me know if you need more information.

Markus

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

Citrus Yan avatar image Citrus Yan commented ·

So you are saying that if you add any one of these regions ("ChinaEast2", "ChinaNorth2", "SouthAfricaNorth") for the client then it will keep hanging in the "Waiting for Server" state in matchmaking? Is it possible that when you added one of these regions, there happens to be no servers available (all 8 servers are active)? Were other regions available in the build 15578e92-f80b-4d0c-ae5e-b385a374e58c?, I mean all these regions:

{ "AustraliaEast", "AustraliaSoutheast", "BrazilSouth", "CentralUs", "EastAsia", "EastUs", "EastUs2", "JapanEast", "JapanWest", "NorthCentralUs", "NorthEurope", "SoutheastAsia", "WestEurope", "WestUs" };

0 Likes 0 ·
Markus Henschel avatar image Markus Henschel Citrus Yan commented ·

So you are saying that if you add any one of these regions ("ChinaEast2", "ChinaNorth2", "SouthAfricaNorth") for the client then it will keep hanging in the "Waiting for Server" state in matchmaking?

Yes. This is what I was experiencing.

Is it possible that when you added one of these regions, there happens to be no servers available (all 8 servers are active)?

No. When I tested there were enough servers in Standby on WestEurope

Were other regions available in the build 15578e92-f80b-4d0c-ae5e-b385a374e58c?, I mean all these regions:

{ "AustraliaEast", "AustraliaSoutheast", "BrazilSouth", "CentralUs", "EastAsia", "EastUs", "EastUs2", "JapanEast", "JapanWest", "NorthCentralUs", "NorthEurope", "SoutheastAsia", "WestEurope", "WestUs" };

No we just had WestEurope in the build.

Again, thanks for having a look. Let me know if I can provide any more info.

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan Markus Henschel commented ·

Hi @Markus Henschel,

Referring to this doc: "The latency measurements passed into the region selection rule should match the regions where the build is active." Could you please try keeping a one-to-one relationship between the latency measurements passed into the region selection rule and the regions in the build? And see whether the "Waiting for server" issue still occurs?

0 Likes 0 ·
Show more comments
Markus Henschel avatar image Markus Henschel commented ·

@Citrus Yan It worked fine so far with supplying ping times for all the regions except the ones I mentioned.

Regarding the docs saying supplied pings for regions should match the regions actually being in the build:

How would the client know what regions are in a build with Multiplayer 2.0 ? Well, sure, we can put that information in the client. But then for adding more regions we have to update the client which seems wrong. We deploy the same builds to different queues with different regions being allocated.

Is there a client API for this? I found an API doing this for the old Multiplayer API but it required a build version. If this would exist the next question would be how should the client know the build version/id? It is a property of the queue. If I'm overlooking something please point me to the API that is supposed to be used for getting the regions to ping.

Regards

Markus

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan Markus Henschel commented ·

So, you mean those regions ("ChinaEast2", "ChinaNorth2", "SouthAfricaNorth") are still unavailable? In other words, the clients will keep hanging in the "Waiting for Server" state in matchmaking.

This API ListBuildSummaries can return all multiplayer server builds for your title, including their associated regions. If you need to call it from the client-side, you'll need to enable game client access from the Game Manager API Features settings, which allows game client to request list of builds with player entity token.

0 Likes 0 ·
Markus Henschel avatar image Markus Henschel Citrus Yan commented ·

Yes. I just tested again. I added back those regions (have been commented out for weeks now) and clients are stuck in "waiting for server" in matchmaking.

About "Allow Clients to start games": What execactly would this do? Could clients then start servers in the cloud?

0 Likes 0 ·
Show more comments

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.