> For the complete documentation index, see [llms.txt](https://horizongames.gitbook.io/kronos-matchmaking/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://horizongames.gitbook.io/kronos-matchmaking/testing-and-debugging.md).

# Testing & Debugging

## Testing In Editor

You can test all primary features of Kronos directly in the editor with the **Null Online Subsystem** by running two or more players in **Standalone Game** mode.

<div align="center"><figure><img src="/files/X1qNWBTjmhHQ20jgjUth" alt=""><figcaption></figcaption></figure></div>

In order to run multiple games properly, make sure to use **Standalone Game** mode. Another important option is in the *"Advanced Settings"* under the multiplayer options disable **Run Under One Process**.&#x20;

{% hint style="info" %}
**TIP:** You only need to do this to test matchmaking and party functionality! In case you just want to start two players in a specific map to test gameplay functionality, feel free to use your preferred options.

I prefer using the **New Editor Window (PIE)** mode with **Run Under One Process** option enabled when no matchmaking functionality is needed for the test.
{% endhint %}

While testing in the editor be wary of **network ports** hiding each other. For example, if you have two `KronosPartyHost` beacons listening on the same port then they'll basically hide each others channels and only one of them will work. As a general rule of thumb, only one session of the same type should be hosted on the same PC at the same time.

## Using the Null Subsystem

While developing and testing the game inside the editor, you should always use the **Null Online Subsystem**. This is an IP based Online Subsystem that is meant to be used for testing purposes. You can find the necessary configurations for this Online Subsystem in the [**Project Configuration**](/kronos-matchmaking/configuration.md#project-configuration) section of the documentation.

<figure><img src="/files/8Y6dahVmHYEv0VhyRpXj" alt=""><figcaption></figcaption></figure>

I usually have both **Online Subsystems** configured (leaving net drivers as is) and just switch between them before packaging the project. In most cases you don't even have to change anything else in `DefaultEngine.ini`.

{% hint style="danger" %}
**Limitations of the Null Online Subsystem:**

* Session operations are limited to the local network (LAN)
* Session searches are slow
* Session settings are only updated locally, meaning remote players won't see the changes if session settings are updated by the host
* Session invites are not supported
  {% endhint %}

## Debugging

### Viewing Output Logs

One of the best ways to see what's going on behind the scenes is by looking at the logs. I recommend enabling **realtime logging** for the project.

<figure><img src="/files/8thERVdZPjqm4MP2I73t" alt=""><figcaption></figcaption></figure>

Go to **Edit -> Editor Preferences -> Play** and write `-LOG` in the *"Additional Launch Parameters"* field. This will tell the engine to open a separate window that displays the contents of the log in real time for each instance of the game (when using the **Standalone Game** play mode).

The plugin uses a custom log category called `LogKronos`. The verbosity of this category can be increased to display more information by adding the following option to the project's `DefaultEngine.ini` file:

```ini
[Core.Log]
LogKronos=Verbose
```

<details>

<summary><strong>Viewing Logs For Packaged Projects</strong></summary>

The log window can also be used to debug packaged projects. I recommend using a simple batch script to launch the game with logging enabled. Copy the following code into a `.txt` file, replace `"MyGame"` with your project's name, and save the file as `Launcher.bat`.

```batch
@echo off
:: start the game in windowed mode with logging enabled
:: replace "MyGame" with your project's name
start MyGame.exe -ResX=1280 -ResY=720 -WINDOWED -LOG
```

Alternatively, you can create a shortcut to the game's exe, open its properties and write additional launch params at the end of the *"Target"* field.

</details>

### Using The Gameplay Debugger

As of version 1.7.0, you can also use the **Gameplay Debugger** of Unreal Engine to view real-time matchmaking and sessions information directly on the screen.

<figure><img src="/files/R3qQ4gjRAHbJE5PVMEz3" alt=""><figcaption></figcaption></figure>

The **Gameplay Debugger** can be activated with the apostrophe (') key by default, or with the `EnableGDT` console command. The default visibility of the plugin's debug category can be edited in the "Gameplay Debugger" section of the Project Settings.

{% hint style="info" %}
**NOTE:** The Gameplay Debugger will not react to any input if the game is in "UI Only Input Mode" (e.g. in the main menu). In that case, you'll have to **use the console** to open the debugger.
{% endhint %}

### Console Commands

The plugin has some built in console commands that can help with debugging as well. The console can be opened with the tilde (\~) key by default.

* `kronos.LeaveMatch`: Leave the current match and return to main menu.
* `kronos.LeaveParty`: Leave the current party.
* `kronos.SetLobbyTimer`: Change the current countdown time in the lobby.
* `kronos.LobbyStartMatch`: Start the match immediately regardless of lobby state.
* `kronos.DumpMatchmakingState`: Dumps current matchmaking state to the console.
* `kronos.DumpMatchmakingSettings`: Dumps current matchmaking settings to the console.
* `kronos.DumpPartyState`: Dumps current party state to the console.
* `kronos.DumpReservations`: Dumps reservations to the console.
