Kronos Matchmaking
Buy NowContact
  • About
    • Kronos LTS
    • Support
    • Accolades
  • Examples
    • Playable Demo
    • Sample Project
    • Example Content
  • Configuration
  • Testing & Debugging
  • Usage
    • Getting Started
    • Authentication
      • Authenticating Users
      • Customizing The Auth Widget
      • Creating Custom Auth Tasks
    • Matchmaking
      • Overview
      • Creating Matches
      • Starting Matchmaking
      • Canceling Matchmaking
      • Using Skill Ratings
      • Sending Match Invites
      • Joining Matches
      • Leaving Matches
    • Party
      • Overview
      • Creating Parties
      • Sending Party Invites
      • Joining Parties
      • Managing Party Players
      • Party Player Actors
      • Leaving Parties
    • Reservations
      • Overview
      • Using Reservations
      • The Host Reservation
      • Completing Reservations
    • Lobby
      • Overview
      • Lobby Setup
      • Set Players Ready
      • Lobby Player Data
      • Starting The Match
      • Updating Lobby Session
      • Leaving The Lobby
    • Widgets
  • Guides
    • Creating a Level Selector
    • Integrating with Lyra Game
    • Integrating with EIK
  • Advanced
    • Steam Sockets
    • Reconnect Parties
    • Custom Party Variables
    • Player Groups
  • Changelog
    • API Upgrades
    • Legacy
Powered by GitBook
On this page
  • Matchmaking
  • The Host Params
  • The Min Slots Required Param
  • The Playlist Params
  • Elo Skill Rating Params
  • Extra Query Settings
  1. Usage
  2. Matchmaking

Starting Matchmaking

PreviousCreating MatchesNextCanceling Matchmaking

Last updated 10 months ago

In order to access online features, the player must be logged in with the Online Subsystem. Please visit the page for more information.

Matchmaking

You can start matchmaking by using the StartKronosMatchmaking node. To make the required matchmaking parameters simply drag off of the "Matchmaking Params" property and search for "make". You can also do the same for the "Host Params".

There is no hard requirement on where you need to call this from. Most games will probably have this hooked to the OnClicked event of a widget button.

#include "KronosMatchmakingManager.h"
#include "KronosPartyManager.h"
#include "KronosMatchmakingPolicy.h"
// Get the matchmaking manager.
UKronosMatchmakingManager* MatchmakingManager = UKronosMatchmakingManager::Get(this);

// Request a new matchmaking policy. This operation is async!
// If matchmaking is in-progress, it will be canceled first.
MatchmakingManager->CreateMatchmakingPolicy(FOnCreateMatchmakingPolicyComplete::CreateLambda([this](UKronosMatchmakingPolicy* MatchmakingPolicy)
{
    // Parameters to be used when matchmaking results in creating a session.
    FKronosHostParams HostParams;
    HostParams.StartingLevel = TEXT("MyMap");
    HostParams.Playlist = TEXT("TeamDeathmatch");
    HostParams.MaxNumPlayers = 4;
    HostParams.bShouldAdvertise = true;
    HostParams.bIsLanMatch = false;
    HostParams.bUsesPresence = true;
    
    // Parameters to be used for matchmaking.
    FKronosMatchmakingParams MatchmakingParams;
    MatchmakingParams.HostParams = HostParams;
    MatchmakingParams.Playlist = TEXT("TeamDeathmatch");
    MatchmakingParams.MaxSearchAttempts = 3;
    MatchmakingParams.MaxSearchResults = 20;
    MatchmakingParams.MinSlotsRequired = UKronosPartyManager::Get(this)->GetPartySize();
    MatchmakingParams.bIsLanQuery = false;
    MatchmakingParams.bSearchPresence = true;
    
    // Flags for matchmaking (e.g. use EKronosMatchmakingFlags::NoHost if you don't want matchmaking to result in hosting).
    uint8 MatchmakingFlags = static_cast<uint8>(EKronosMatchmakingFlags::None);
    
    // Start matchmaking.
    // Notice that we are using NAME_GameSession!
    MatchmakingPolicy->StartMatchmaking(NAME_GameSession, MatchmakingParams, MatchmakingFlags, EKronosMatchmakingMode::Default);
}));

After matchmaking is complete the player will join the game automatically. We do not need to do anything else.

The Host Params

The "Host Params" can be left empty if the NoHost option is enabled in the "Matchmaking Flags".

The Min Slots Required Param

The "Min Slots Required" param tells the matchmaking system to ignore sessions that do not have at least X amount of open slots. We can use the GetPartySize node to easily determine how many slots we need. This node returns the number of players in the party, or 1 if the player is not in a party. By using this we basically avoid sessions that we would not fit.

The Playlist Params

The "Playlist", "Map Name", and "Game Mode" params are purely cosmetic information used for session filtering. When these parameters are given for the matchmaking, sessions have to match their corresponding params to be considered for joining. If left empty, all sessions will be considered as valid. As an example I'm going to set my playlist params to the following (without the quotes):

  • Playlist: "PVP"

  • Map Name: -

  • Game Mode: "Deathmatch"

I have intentionally left the "Map Name" empty so that it will not be considered. I just want to find a "Deathmatch" game, I do not care which map it is currently being played on.

Elo Skill Rating Params

Extra Query Settings

The "Extra Query Settings" param allows you to add custom Query Settings that the matchmaking will use during session searches. These settings are essentially filters that will compare against the session's corresponding Session Setting.

IMPORTANT: Different Online Subsystems may not support all types of query settings. The Steam Online Subsystem for example does not support bool settings.

It is important to note that Kronos has a two layer session filtering process. First, sessions will be queried by the Online Subsystem using the given settings. Once sessions are found, all results will be filtered again. This was necessary due to the Null Online Subsystem not handling query settings.

Query settings registered with the "Extra Query Settings" param are used for filtering at both layers automatically. However, if you are not registering query settings through this param, then you have to override the FilterSearchResult function of the KronosMatchmakingSearchPass in C++ and handle your query settings manually. Again, you only need to do this if you are not using the "Extra Query Settings" param.

The "Host Params" is going to be used if the matchmaking results in creating a new session. It is the same set of parameters that you use to create matches with. For more information please refer to the section of the documentation.

Please refer to the section of the documentation.

Creating Matches
Using Skill Ratings
Authentication