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
  • Sessions in Lyra
  • Fixing Code Issues
  • 1. Generating C++ Project Files
  • 2. Modifying Build Files
  • 3. Disabling The Common Session Subsystem
  • 4. Configuring The Project
  • 5. Build The Project
  • Implementing Authentication
  • Implementing Matchmaking
  • Fix Reservation Cleanup
  1. Guides

Integrating with Lyra Game

PreviousCreating a Level SelectorNextAdvanced

Last updated 5 months ago

The released by Epic Games proved to be popular among indie developers. This section will be helpful for those who want to integrate Kronos Matchmaking into the Lyra project.

Sessions in Lyra

All online features in Lyra are implemented in the . This plugin was designed to be a base for other projects to use as a base when customizing Lyra. Its two main parts are the CommonUserSubsystem which handles user authentication, and the CommonSessionSubsystem which handles basic session operations such as hosting and joining online games.

Unfortunately the tries to do things that Kronos also handles automatically. This results in kind of a conflicting situation where both plugins are trying to do the same thing on their own way. The best option would be to disable the Common User plugin entirely, however this isn't really an option due to the fact that it is integrated into the LyraGameMode and LyraGameInstance classes on a C++ level.

Fixing Code Issues

To get everything working we will need to make some small changes to the C++ code directly.

1. Generating C++ Project Files

  1. Go to your Lyra project folder.

  2. Right click on the .uproject file and select the "Generate Visual Studio Project Files" option. You must have Visual Studio installed to complete this step.

  3. Open the generated .sln file. This is the Visual Studio solution file that's been generated by Unreal Engine.

2. Modifying Build Files

  1. Add "Kronos" to PublicDependencyModuleNames in LyraGame.Build.cs.

  2. Comment out the NativePointerMemberBehaviorOverride line in LyraEditor.Target.cs file by placing two slash (//) characters before it. Currently Kronos does not make use of the TObjectPtr type for backwards compatibility reasons.

3. Disabling The Common Session Subsystem

  1. Open the CommonSessionSubsystem.cpp file. You can press Ctrl+T to quickly find files in the solution.

  2. Find the "Initialize" function. You can press Ctrl+F to quickly find the line.

  3. Comment out the "BindOnlineDelegates" and "FCoreUObjectDelegates::PostLoadMapWithWorld" lines by placing two slash (//) characters before them.

4. Configuring The Project

  1. Override the Online Session class in LyraGameInstance to use KronosOnlineSession. You may have already done this during the previous step, but it is important to do this in Lyra's game instance class since it is integrated into the project on a C++ level.

  2. Open the DefaultEngine.ini file and make sure to set bUseBeacons to false under the CommonSessionSubsystem config section. Kronos uses its own set of Online Beacons for matchmaking so Lyra should not handle this.

5. Build The Project

  1. Now you'll need to rebuild the project. To do this simply press Ctrl+B on your keyboard, or in the top menu press Build -> Build Solution. Please note that this may take a while...

  2. If the build succeeded you can start the project and begin using Kronos Matchmaking!

Implementing Authentication

Since Lyra already handles authentication for us, we will have to make sure that Kronos does not interfere in any way. To do this, go to Edit -> Project Settings -> Kronos Matchmaking, and under authentication enable the "AuthenticateUserAutomatically" and "AuthenticationIsPassthrough" options. The latter is hidden inside the Advanced dropdown.

Implementing Matchmaking

Lyra has its matchmaking functionality started from widget blueprints such as the experience selection screen and the host session screen. You will need to open up those widgets and replace the matchmaking nodes found in them with their Kronos counterparts.

Blueprint nodes for the examples above do not render perfectly on the website, but they will give you a good idea about what you need to change. If you need further assistance please reach out directly.

Fix Reservation Cleanup

Lyra does not use the standard way of disconnecting from online matches through the HandleDisconnect function. I assume Epic did this to allow sending parameters to the main menu map when returning. For now we will have to call DestroyReservationBeacons manually.

Follow the steps outlined in the page of the documentation.

Hook up CreateKronosMatch in "UI/Menu/Experiences/W_HostSessionScreen" for when an experience was selected:

Hook up StartKronosMatchmaking in "UI/Menu/Experiences/W_ExperienceSelectionScreen" for the quickplay button:

Hook up CancelKronosMatchmaking in "UI/Menu/Experiences/W_ExperienceSelectionScreen" for when the widget is deactivated:

Hook up DestroyReservationBeacons in "UI/Hud/W_LyraGameMenu" for when the return button is clicked and the open level call has been made. Maps are always loaded in the next frame so it is safe to handle this at the end:

Configuration
https://blueprintue.com/blueprint/f34jju17/
https://blueprintue.com/blueprint/__brjfzz/
https://blueprintue.com/blueprint/oobjpcza/
https://blueprintue.com/blueprint/busdki-e/
Lyra Sample Game
Common User Plugin
Common User Plugin