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
  • Creating The Party
  • The Starting Level Param
  • Party Visibility
  1. Usage
  2. Party

Creating Parties

PreviousOverviewNextSending Party Invites

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.

Creating The Party

To create a party (also knows as Party Session), use the CreateKronosParty node. To make the required host parameters simply drag off of the "Host Params" property and search for "make".

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 "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 for the party session.
    // Here's a private party configuration for up to 5 players.
    FKronosHostParams HostParams;
    HostParams.MaxNumPlayers = 5;
    HostParams.bShouldAdvertise = false;
    HostParams.bIsLanMatch = false;
    HostParams.bUsesPresence = true;
    HostParams.bAllowInvites = true;
    HostParams.bAllowJoinViaPresence = true;
    
    // If for some reason private sessions are not suitable for you,
    // you can make the session hidden instead. Hidden sessions can only be found when SpecificSessionQuery is used.
    // Steam for example doesn't allow you to join a friend through the Steam Overlay if he is in a private session.
    // Hidden sessions only make sense with bShouldAdvertise set to true!
    HostParams.bHidden = false;
    
    // Initialize matchmaking params from the host params.
    // Only the host params matter when starting matchmaking in CreateOnly mode.
    FKronosMatchmakingParams MatchmakingParams = FKronosMatchmakingParams(HostParams);
    
    // No matchmaking flags needed.
    uint8 MatchmakingFlags = static_cast<uint8>(EKronosMatchmakingFlags::None);
    
    // Tell the matchmaking that we only want to create a session.
    EKronosMatchmakingMode MatchmakingMode = EKronosMatchmakingMode::CreateOnly;
    
    // Start matchmaking.
    // Notice that we are using NAME_PartySession!
    MatchmakingPolicy->StartMatchmaking(NAME_PartySession, MatchmakingParams, MatchmakingFlags, MatchmakingMode);
}));

If you take a look at the KronosHostParams you will see that it is exactly the same set of parameters used to create matches. This is because internally there is not much difference between matches and parties. They are both just sessions on the backend.

The Starting Level Param

The "Starting Level" parameter is irrelevant when creating parties.

Party Visibility

Whether the party is public or private is dictated by the "Should Advertise" param. You will most likely want to create private parties, and invite your friends into it. To do this, disable "Should Advertise" and enable "Allow Invites".

You can also create hidden sessions by enabling both the "Should Advertise" and "Hidden" params. Hidden sessions are very useful when you want to create a private party, but your Online Subsystem requires sessions to be advertised to be joinable by other players. Hidden sessions can only be found during specific session queries (e.g. following party to a specific session).

Authentication