About matchmaking from Unity

Hello, we are setting up a dedicated server and we want to use AB matchmaking from Unity. When using a session template with Type: NONE we are able to make the matchmaking work:
Ticket is created, game session is created, a user can find another, etc. No dedicated server on AB involved.

But then if we create a session template with the Type: DS-AMS the matchmaking creates the ticket but nothing else. We can’t get further than that.

More info: we are calling CreateMatchmakingTicket and when it returns successfully we start listening to SessionV2DsStatusChanged:

_lobby.SessionV2DsStatusChanged += result => OnDSStatusUpdatedNotificationReceived(result);

    private void OnDSStatusUpdatedNotificationReceived(Result<SessionV2DsStatusUpdatedNotification> result)
    {
        if (result.IsError)
        {
            // Do something if SessionV2DsStatusChanged fails
            Debug.Log($"Error SessionV2DsStatusChanged, Error Code: {result.Error.Code} Error Message: {result.Error.Message}");
        }
        else
        {
            var status = result.Value.session.dsInformation.status;
            if (status == SessionV2DsStatus.AVAILABLE)
            {
                string serverIP = result.Value.session.dsInformation.server.ip;
                Debug.Log($"DS Ready, IP: {serverIP}");
            }
        }
    }

But the method OnDSStatusUpdatedNotificationReceived never gets called. Is this expected behaviour? The dedicated servers are not running yet in AB’s infrastructure, so I’d understand if AB returned some error, but it’s not the case; shouldn’t we get at least some kind of error?

I know you probably need more information, so please feel free to ask!

Thanks!

Hi @xalbertus1,

When using the matchmaking service, _lobby.SessionV2DsStatusChanged will only be updated after a user finds a matching match and the session service requests a DS to AMS. Can you share with us your match rule set and your test case for this testing?

Currently, I’m under the impression that the user has not found a match after creating a match ticket. You can read more about matchmaking here:

  1. Matchmaking in Unity
  2. Matchmaking using ByteWars Unity

Hi! Thanks for the response.

I followed the matchmaking documentation in Unity, but as I am not having any feedback from the service I am kind of lost.

Here is the ruleset:

{
    "auto_backfill": false,
    "alliance": {
        "min_number": 1,
        "max_number": 2,
        "player_min_number": 1,
        "player_max_number": 1
    }
}

As for the test case, it’s very simple:

  1. I call matchmaking.CreateMatchmakingTicket
  2. When the ticket has been created, I register to all of these events:
public void ListenMatchmakingMessages()
    {
        // Match started notification
        _lobby.MatchmakingV2MatchmakingStarted += result => OnMatchmakingStartedNotificationReceived(result);

        // Match found notification
        _lobby.MatchmakingV2MatchFound += result => OnMatchFoundNotificationReceived(result);

        // Match timeout notification
        _lobby.MatchmakingV2TicketExpired += result => OnTimeOutNotificationReceived(result);

        //User invited to gamesession
        _lobby.SessionV2InvitedUserToGameSession += result => OnUserInvitedToGameSessionNotificationReceived(result);

        //user joined gamesession
        _lobby.SessionV2UserJoinedGameSession += result => OnUserJoinedGameSessionNotificationReceived(result);

        //DS Status changed
        _lobby.SessionV2DsStatusChanged += result => OnDSStatusUpdatedNotificationReceived(result);

        // Match canceled notification
        // This feature is still in development and will be added soon
    }
  1. I never find a match or get any messages like match found or timeout or anything at all, even though there’s another person looking for a match with the same config.

I was also trying to follow the Byte Wars tutorials to see if I am missing something, but everything looks simillar to what I am doing.

Let me know if you need more info.

Based on your information, you should be able to find a match instantly since the match requirement is at the minimum of 1 team and 1 player. Therefore, the match-found event should be triggered.

To double-check, have you called the _lobby.Connect()? To receive websocket notifications, you need to connect to it first.

If this still doesn’t resolve your issue, I recommend you try creating a Byte Wars namespace and start using our Byte Wars sample. It will help you verify your configuration.

  1. Create Byte Wars namespace
    image
  2. Configure your IAM clients and your game client and game server SDK configuration.
  3. Game Client
    AccelByteSDKConfig.json
{
    "Default": {
        "Namespace": "<game_namespace_id>",
        "UsePlayerPrefs": true,
        "EnableDebugLog": false,
        "DebugLogFilter": "Log",
        "BaseUrl": "https://<game_namespace_id>.prod.gamingservices.accelbyte.io",
        "RedirectUri": "http://127.0.0.1",
        "PublisherNamespace": ""
    }
}

AccelByteSDKOAuthConfig.json

{
    "Default": {
        "ClientId": "<game_iam_client_id>",
        "ClientSecret": ""
    }
}

More details: Install the AGS Game SDK - Initial setup - (Unity module) | AccelByte Documentation

  1. Game Server
    AccelByteServerSDKConfig.json
{
    "Default": {
        "Namespace": "<game_namespace_id>",
        "PublisherNamespace": "",
        "BaseUrl": "https://<game_namespace_id>.prod.gamingservices.accelbyte.io",
        "RedirectUri": "http://127.0.0.1"
    }
}

AccelByteServerSDKOAuthConfig.json

{
    "Default": {
        "ClientId": "<server_iam_client_id>",
        "ClientSecret": "<server_iam_client_secret>"
    }
}

More details: Set up AMS configuration - Dedicated servers with AccelByte Multiplayer Servers (AMS) - (Unity module) | AccelByte Documentation

(post deleted by author)

Using the bytewars namespace I was able to get as far as getting a “MatchFound” message. I’ve since re-configured our game’s namespace to look like bytewars, however we once again get into a state where no messages come through the lobby connection after creating the matchmaking ticket. The only difference I can currently see is that our session template doesn’t have any requested regions while bytewars has us-east-2. I’m unable to add requested regions to our game’s namespace. Please look through the following and tell us what we’re missing:

image