Why does backfilling slowly work

Hello

I have a question about why a spectator is slowly backfilled after a rating and a expansion rule are added to my matchmaking rule. Without the rating and the expansion rule, backfilling is fast. I posted another question including the same matchmaking rule. I guess you guys are familiar with my matchmaking rule.

There are 2 cases.

  1. As long as low ranked players are matched by Matchmaker, a spectator is quickly backfilled within 5 seconds.
  2. If distance between players is high, a spectator is slowly backfilled 50 seconds after the spectator submits a matchmaking.

There is a distance rule for Spectator. MaxDistance is 200. It’s like no distance rule because maximum rating in my game is 200. It means my matchmaking rule for Spectator doesn’t need a rating.

This is my matchmaking rule.

{
    "ruleLanguageVersion" : "1.0",
    "playerAttributes" :
    [
        {
            "name": "GameMap",
            "type": "string",
            "default": ""
        },
        {
            "name" : "WantsToBe",
            "type" : "number",
            "default" : 0
        },
        {
            "name": "Rating",
            "type": "number",
            "default" : 50
        }
    ],
    "teams" :
    [
        {
            "name" : "Players",
            "maxPlayers" : 5,
            "minPlayers" : 5
        },
        {
            "name" : "Spectators",
            "maxPlayers" : 5,
            "minPlayers" : 0
        }
    ],
    "rules":
    [
        {
            "name": "SameGameMap",
            "description": "Only match players when they're in the same map",
            "type": "comparison",
            "operation": "=",
            "measurements": ["flatten(teams[*].players.attributes[GameMap])"]
        },
        {
            "name" : "PlayerSelection",
            "description" : "Only users that request playing as Player are assigned to the Player team",
            "type": "comparison",
            "measurements" : ["teams[Players].players.attributes[WantsToBe]"],
            "referenceValue" : 0,
            "operation" : "="
        },
        {
            "name" : "SpectatorSelection",
            "description" : "Only users that request playing as Spectator are assigned to the Spectator team",
            "type": "comparison",
            "measurements" : ["teams[Spectators].players.attributes[WantsToBe]"],
            "referenceValue" : 3,
            "operation" : "="
        },
        {
            "name": "TeamBalance",
            "description": "",
            "type": "distance",
            "measurements": [ "min(teams[Players].players.attributes[Rating])" ],
            "referenceValue": "max(teams[Players].players.attributes[Rating])",
            "maxDistance": 20
        },
        {
            "name": "SpectatorBalance",
            "description": "",
            "type": "distance",
            "measurements": [ "min(teams[Spectators].players.attributes[Rating])" ],
            "referenceValue": "max(teams[Spectators].players.attributes[Rating])",
            "maxDistance": 200
        }
    ],
    "expansions":
    [
        {
            "target": "rules[TeamBalance].maxDistance",
            "steps":
            [
                {
                    "waitTimeSeconds": 10,
                    "value": 20
                },
                {
                    "waitTimeSeconds": 20,
                    "value": 40
                },
                {
                    "waitTimeSeconds": 30,
                    "value": 60
                },
                {
                    "waitTimeSeconds": 40,
                    "value": 80
                },
                {
                    "waitTimeSeconds": 50,
                    "value": 100
                },
                {
                    "waitTimeSeconds": 60,
                    "value": 200
                }
            ]
        }
    ]
}

Why is the spectator slowly backfilled as long as distance between players is high.

Any help is appreciated!!

Hey, so the reason why backfilling is slow when the distance between players’ ratings is high is that backfilling works similarly to regular matchmaking. When you “backfill”, you are essentially making a new matchmaking ticket. The difference is that this time, you have one ticket with five players on it. So with your rule set, this one ticket alone can result in a match. However, because this is a “backfill” ticket, the ticket won’t literally result in a new match alone unless at least one other ticket gets paired with it. In your case those “other” tickets would be for clients who want to be spectators.

The problem is that since this backfill ticket still functions normally like a regular matchmaking ticket, if your ticket has five players with a lot of distance between their ratings, then a match won’t be able to be made with the new spectators and the original players right away with the original rule set. Only after applying the rule set expansions, will a potential match be made with the original players. To test this out, I would recommend keeping track of how long it took for the original match to be made since the youngest individual matchmaking request started, and compare it to how long it took for the backfill request to finish since the youngest spectator matchmaking request that got paired with the backfill request started. It should be about the same amount of time.

If I made any incorrect statements, then I hope someone on here can correct me, but this is my understanding.

Thank you and I have more question related to your explanation but first of all, I have 2 questions related my matchmaking rule.

If a potential game takes 1 minute to be made, a spectator is backfilled, 1 minute after the spectator’s ticket is submitted. This is true. I already tested it like what you mentioned.

What I’m curious about is that before there was no distance rule for Spectator, only Player had the distance rule. My question is that even though Spectator doesn’t have the distance rule, why does “Backfilling” work like regular matchmaking? This is my first question.

Later the distance rule was added for Spectator like a picture below, but before it didn’t exist in my matchmaking rule.
image

200 is a maximum rating. 200 seems like no rating but the result is the same as what you mentioned and no distance rule for Spectator.

My second question is that is there a way to quickly backfill spectators in my matchmaking rule even if a regular matchmaking takes 1 minute to be created?

I appreciate your help.

With regards to your first question, you kind of already answered it. The 200 rating maximum distance rule for the spectators doesn’t really affect backfill because backfill is treated like regular matchmaking. 200 seems to already be such a big number that it won’t have much impact in cases of backfill, considering that backfill typically involves matchmaking tickets with a group of 5 players in your case. And why is backfill treated like regular matchmaking? Good question, I am not even sure myself.

As for your second question, I would recommend switching to manual backfill. Because with manual backfill, you can define the specific players in the matchmaking backfill request. And in this case, you can modify the value you set for the rating attribute for each player in that request to be some kind of mock value, for e.g., the same value for all 5 players, so that the rule expansions don’t have to be applied for a match to be made with the original 5 players and some additional spectators. Keep in mind though, that this strategy is really only affective when the match is full, because I am only accounting for scenarios where you want to backfill a match of 5 players with spectators. If you have a match with less than 5 players, maybe after some players leave, and you want to backfill that, then I would recommend using the actual rating values when making a manual backfill request since you may still want to preserve the rating balance between the players when getting actual players to backfill an existing match.

Thank you for your explanation. I have considered your explanation for 2 days. Now I get how the matchmaking works but there is something that I don’t know.

You mentioned “you can modify the value you set for the rating attribute for each player in that request to be some kind of mock value”
It may seem to be as if I can modify the rating attribute in a matchmaking rule after it’s pushed to GameLift. How can I modify it?

I already set up a manual backfill because I don’t know how to set up an automatic backfill. A dedicated server calls StartMatchBackfill() and StopMatchBackfill() in GameLiftServerSDK. I think that both of APIs are for the manual backfill. So from what I understand about you explanation, I’m currently using the manual backfill. So it’s fine but the rating attribute needs to be modified to make the backfill faster, doesn’t it?

Is it common to modify the rating attribute in a way to use GameLift matchmaking?

I appreciate your fast answer but it’s tough for me to understand GameLift matchmaking because I can’t see the matchmaking inside.

What you said sounds right. As for whether or not it is “common”. I am not very sure, it was just something I thought of in the spur of the moment to bypass the rule that currently makes backfill slow. At the end of the day, it’s a design question. The mock rating idea is just one of many. For example, another one is you can also use another matchmaker with a different rule set, specifically designed for backfill requests. And then make your backfill request go through that new matchmaker. In my opinion, there’s no “right” way of going about this since it really depends on your use case.

I’m currently considering your answer to fix the slow backfill issue. I think it takes days. Regardless of how I deal with the issue, I’ll be back to say “Thank you” but probably I’ll have more questions.

I have not enough time to improve the slow backfill.
I’ll take look at it later.

Thanks Chris.