Reservation

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

About Reservations

The reservation system ensures that all players who want to join a game will have a free slot in the session at the time of connection. This prevents other players from taking their place in the session while connecting. This is important when a group of friends want to join a game together, or when someone with longer loading times attempt to join. Here is a simple overview of how reservations look behind the scenes:

In the image above you can see that "Player1" and "Player2" were in a party before they joined the game. Meanwhile "Player3" joined the game solo without a party.

Using Reservations

Whether a session uses reservations is determined by the SETTING_USERESERVATIONS session setting. When this setting is enabled, the session will make use of reservations automatically. No additional code is required. Reservations are enabled by default.

Only Game Sessions make use of reservations. Please visit the Matchmaking page for more information about sessions.

When hosting a reservation enabled session, a KronosReservationHost beacon will be initialized automatically during game mode initialization. This beacon is responsible for handling reservation requests.

When joining a reservation enabled session, reservations will be requested automatically during the joining process using a KronosReservationClient. Reservations will be made for the local player and each party member. If the reservation request fails, the session is deemed invalid and matchmaking continues.

The Host Reservation

The Host Reservation is a set of reservations that will be registered immediately when a KronosReservationHost is created.

In order to keep the reservation system in sync with the session, the host reservation must be set properly before changing maps (e.g. from lobby to game) in a multiplayer environment. Of course this is only relevant if reservations are enabled for the session.

Imagine that you are hosting a match for your friends. After finishing the current match, you simply want to change maps and continue playing. The issue is that your KronosReservationHost beacon will be destroyed once you begin changing maps, and your friends who are already in the session won't request a reservation again since they are already in the session. So in order to keep the reservation system in sync with the session, you (the host) must set the host reservation to one that includes everyone in the current match before initiating the map change.

If the host reservation is empty, a reservation will be made for the local player. Once host reservation is registered, it will be consumed - meaning it is reset to an empty reservation.

As of version 1.7.0, you can simply use the CopyRegisteredReservations function. It is intended to be used as the host reservation before changing maps in a match.

Completing Reservations

Completing a reservation means that the given player has arrived in the game, so his reservation no longer needs to be timed out. Reservations are completed automatically when a player has loaded the map and joined the game. The exception to this is when the host uses seamless travel to change maps (e.g. from lobby to game). Whether seamless traveling is used is set in the game mode.

When seamless traveling is used, the host must complete the reservation of each seamless traveling player when they arrive on the new map. Of course this is only relevant if reservations are used during the match.

For Blueprint projects, the game mode's OnSwapPlayerControllers event is a good place to complete the reservation of seamless traveling players. C++ projects can override the game mode's InitSeamlessTravelPlayer function directly.

Last updated