# Starting The Match

When enough players are present in the lobby and everyone is ready, the `LobbyGameMode` will transition into the `MatchStarted` state and the `OnMatchStarted` event will be called. The lobby can also be started immediately via the `StartMatch` function.

## Traveling To The Match

Once the match is started, we can travel to a new map where the actual match will be played.

{% hint style="warning" %}
**IMPORTANT:** Before traveling to a new level we always have to make sure that the Host Reservation is set properly! For more information please refer to [**The Host Reservation**](/kronos-matchmaking/usage/reservations/the-host-reservation.md) section of the documentation.
{% endhint %}

We can travel to a new map by using the `ServerTravelToLevel` function. The "Travel URL" should be the name of the map that we want to open. The map name can be given in the following formats (without the quotes):

* Short package name: "MyMap"
* Long package name: "/Game/Maps/MyMap" (recommended)

{% tabs %}
{% tab title="Blueprint" %}

<figure><img src="/files/T875dlCc1srlDKwyjrZt" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="C++" %}

```cpp
#include "KronosStatics.h"
#include "KronosReservationManager.h"
```

```cpp
void AMyKronosLobbyGameMode::OnMatchStarted()
{
    Super::OnMatchStarted();
    
    // Set the host reservation before traveling.
    // This ensures that everyone in the lobby will have a valid reservation when they join the new map.
    UKronosReservationManager* ReservationManager = UKronosReservationManager::Get(this);
    if (ReservationManager->IsReservationHost())
    {
        const TArray<FKronosReservation> Reservations = ReservationManager->CopyRegisteredReservations();
        ReservationManager->SetHostReservations(Reservations);
    }
    
    // Travel to the new map.
    UKronosStatics::ServerTravelToLevel(this, TEXT("MyMap"));
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
In packaged projects you can only travel to maps that were included for packaging. You can do this by going to **Project Settings -> Packaging** and in the advanced options look for the "List of maps to include in a packaged build".
{% endhint %}

## Updating Session Settings

You might want to update the **Session Settings** of the match before traveling to the match. For example if players can join matches mid game, then you probably want to update settings such as the "Playlist", "Map Name", and "Game Mode" to match the current state of the game.

The next section of the documentation explains how to [**Update Session Settings**](#updating-session-settings).

## Starting The Match From Console

While in the lobby, you can use the `kronos.LobbyStartMatch` console command to start the match regardless of how many players are in the lobby. This can be very useful when you are testing the game alone.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://horizongames.gitbook.io/kronos-matchmaking/usage/lobby/starting-the-match.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
