EOS Lobbies vs Sessions, and How to Add Matchmaking

What are EOS Lobbies vs EOS Sessions, and how to add matchmaking with logic to EOS Lobbies
What are EOS Lobbies vs EOS Sessions, and how to add matchmaking with logic to EOS Lobbies
What are EOS Lobbies vs EOS Sessions, and how to add matchmaking with logic to EOS Lobbies

Principales informations

Principales informations

Principales informations

  • EOS Lobbies create persistent, real-time player groups designed for peer-to-peer games, while Sessions act as lightweight logic containers without built-in features.

  • Lobbies include voice chat, host migration, and owner controls, but cannot directly support dedicated servers and thus lack their security – unless combined with Edgegap’s orchestration.

  • Sessions can launch dedicated servers without requiring a player host, but lack the richer features found in lobbies.

  • Using Edgegap’s Matchmaking, developers can pair EOS Lobbies with dedicated servers, enabling matchmaking based on latency, skill, region, or custom attributes (all of which EOS Matchmaking lacks). Adding dedicated servers ensures players security and protection against cheaters & hackers.

  • A full integration flow exists (i.e., authentication, lobby creation, group formation, matchmaking, deployment, backfill, and match teardown) allowing developers to run scalable and secure multiplayer sessions with EOS + Edgegap.

Epic Online Services (“EOS”) lobbies are Epic Game’s solution create a persistent connection between players as to share “player state” with real-time updates.

Specifically in the context of multiplayer games architecture, lobbies are used to pool players together before deploying a game server that is traditionally player-hosted (i.e. peer-to-peer, often nicknamed "P2P"). Player-hosted servers are proven to introduce issues with cheaters and hackers.

In terms of users’ flow, it functions as:

  1. First the players must create a lobby, making it both the first member and owner of the lobby.

  2. Then, the player (or game) makes the lobby “available” for other player(s) to join. It can be made “joinable” either through:

    • A direct invite system or;

    • Most commonly, “discoverable” through a server-browser functionality.

EOS itself is primarily used as the main backend solution for Unreal Engine, such as Unreal 5, whose integration is available in its documentation.

-> Traditionally, EOS Lobbies cannot be used for dedicated servers.

Fortunately, Edgegap’s platform provides the ability to use EOS Lobbies with logic-based matchmaking and dedicate servers (see below how to).

EOS Lobbies vs Sessions

Often confused between each other, EOS offers both “lobbies” and “sessions”. They are similar in nature and, to add to the confusion, share lots of features.

A full breakdown of lobbies and sessions are available within EOS documentation.

Head-to-Head Comparison

The primary difference between the EOS lobbies and sessions is that:

  • Sessions have no features built-in; they are only the “logic” to keep the player count accurate for the session and prevents other players from trying to join the session it is at maximum player capacity. Sessions are managed by the developer and can be used to deploy a dedicated server without any players present.

  • Lobbies have voice, host migration and owner administration rights. However, they are managed via the EOS backend and can only be created by a player (making them more suitable for player-hosted games).

Thus, while Lobbies are more suited for peer-to-peer network multiplayer games, as Epic Games notes, sometimes a player's network is restrictive and does not allow all traffic through their firewall. This can sometimes cause network connection issues for players in lobbies. Which defeats the intended use of lobbies.

Shared Features between EOS Lobbies and Sessions

Lobbies and sessions share these features:

  • Fixed attributes and user attributes that you can populate to best suit your game's needs.

  • Players can search for a lobby or session by the fixed attributes and user attributes that you've marked as public.

  • Players already in the lobby or session can invite other players to join them.

  • Players can join the presence lobby or presence session that a friend is in.

  • Players can join multiple lobbies and sessions at the same time.

EOS Lobbies’ Features

  • Voice chat integration. See EOS Lobby Voice Communications.

  • Host migration: the owner can transfer ownership when they leave or if their connection drops.

  • Owner administration: The owner can remove (kick) players from the lobby.

EOS Sessions Features

No additional features are available within sessions beyond the shared features above.

When to Use EOS Lobbies

Use a lobby service if your game design requires setting player-controlled matchmaking preferences (e.g. character choice, difficulty, map, etc.). As players join and leave the Lobby, they also update the matchmaking group to prepare for finding a match later.

Here is the main decision factors you should consider:

Game Design – Features / Requirements

Pre-Match Lobby (EOS Lobbies)

Matchmaking (with Logic)

Invite friends to play with me

Modify my player/match preferences

View other lobby member preferences

Store and manage custom key-value data

Notify group members that player is ready to play

Show matchmaking progress and find match

Get team assignment for player/group

Retrieve game server connection details

EOS Lobbies & Edgegap Matchmaker

Edgegap and EOS integrate seamlessly to deliver a rich feature set to play together with friends online.

Diagram of EOS integration with Edgegap's matchmaking (with logic) to enable any multiplayer game using EOS lobby to deploy dedicated game servers

1. Integration Prerequisite: Authentication (Security) & Friends List

We recommend a three-layered authentication for maximum security:

  • clients authenticate with Epic Online Services DRM to prevent piracy,

  • clients authenticate with Edgegap matchmaker to mitigate brute force attacks,

  • servers verify client identity against Epic Online Services to prevent impersonation.

Then, use the Epic Online Services (EOS) Friends Interface to retrieve, manage, and subscribe to events for the friends list of a signed-in player of your game (or user of a software application).

2. EOS Lobbies

Using the Lobby Interface, your players can create, join, leave, and manage lobbies.

The lobby and each member can have application-specific, key-value attributes, supported by the EOS_Lobby_Attribute data type. These attributes must be represented as numerical, string, or boolean data. The EOS_Lobby_Attribute data structure contains this information. Lobbies also support adjacent features like ownership migration or Lobby VoIP.

Once the lobby is assembled and ready for matchmaking, lobby owner creates a Group in the Edgegap matchmaker. The owner then saves the returned Group ID as an EOS_Lobby_Attribute which other lobby members can use to create a membership and join the group.

Preview the official Epic Online Services Lobby example for inspiration.

Alternative: Custom Friend Invites

Are Lobbies too complicated for your game? You can also use Custom Invites to add your Epic friends directly into the matchmaking Group, by including the Group ID in your invite sent by the group owner. Each invitee must create their Group membership and upload their attributes.

You may skip to Find Match.

3. Edgegap Matchmaking

Edgegap Matchmaking service complements your EOS catalog by allowing players to:

  • find other players based on criteria like region, latency, skill, or game parameters;

  • search for servers to join based on available capacity [or ping, region, skill, map, mode];

  • start new server if existing servers are full or don't satisfy player criteria.

Find Match

Each member (and owner) sets their matchmaking attributes when creating their membership (or group). Attributes typically include (but not limited to) player data like:

  • ping beacon latency measurement - using Edgegap Ping Beacons,

  • skill rating (ELO/MMR/bracket/league) - with EOS Stats,

  • moderation flags (separate cheater pools) - with EOS Sanctions and EOS Reports,

  • progression metrics - with EOS Stats,

  • map preferences - with Lobby Member Attributes (see above),

  • selected game difficulty (coop games) - with Lobby Attributes (see above).

Once all players set up their memberships and mark themselves ready in the Group, matchmaking beings automatically. Players receive updates as they go by polling their membership every few seconds. Once server is assigned, players connect and proceed to start playing.

Replace Leavers

Optional feature

Use Edgegap Backfill to request additional players to be added to a running match. This may help reduce your server cost (due to higher match fill rate) and improves the social experience (generally preferred over playing against bots).

Match Concludes

As the match completes, use Epic Online Services to upload match replay data, or upload error trace with EOS Player Data from your game server, or update your EOS Stats.

Upload trace and log data.

If you wish to find a new match with your current Lobby, simply create a new Group and restart from beginning.

EOS Lobby Integration – In Depth

The following is the step-by-step integration process to EOS Lobby using Edgegap from our documentation. Make sure to use this version, as it is kept up to date more frequently.

This guide will show you how to integrate Edgegap to work with EOS lobbies in your Unreal game project. Some steps will require you to send requests to our API using a token, and the curl commands provided below will allow you to preview each of their response so that you may determine how to manage them in your code. When using the token in your requests, make sure to keep the token keyword.

You will also need to have an application version already set up on our platform for our project. In this case, we recommend using the Edgegap Unreal plugin to help speed up the testing process. For more information on the plugin, you can read our documentation here.

Warning: As a safety measure, it is not recommended to have the EOS Lobby Owner send requests directly to the Edgegap API in a production environment, due to the client getting access to the API token. You should instead use a separate service to manage these requests.

1. Get and Store the players' public IP

To begin with, each player that joins a lobby - including the Lobby Owner - needs to get their public IP and store it as a Lobby Member property.

curl --location --request GET 'https://api.edgegap.com/v1/ip' \

--header 'Authorization: [EDGEGAP_API_TOKEN]'

2. Create a deployment

Once the Lobby Owner decides that the match is ready to begin, a request needs to be sent to create a new deployment on Edgegap, using the stored public IPs.

curl --location --request POST 'https://api.edgegap.com/v1/deploy' \

--header 'Content-Type: application/json' \

--header 'Authorization: [EDGEGAP_API_TOKEN]' \

--data-raw '{

    "app_name": "[EDGEGAP_APP_NAME]",

    "version_name": "[EDGEGAP_APP_VERSION]",

    "ip_list": [

        "[LOBBY_MEMBER_IP]"

    ]

}'

Afterwards, the Lobby Owner will need to keep polling the deployment, using the request_id provided in the response of the deployment creation request. Once the reply has the deployment's current_status set to READY, the Lobby Owner will need to set the deployment's IP and port values as EOS Lobby Properties.

curl --location --request GET 'https://api.edgegap.com/v1/status/[REQUEST_ID]' \

--header 'Authorization: [EDGEGAP_API_TOKEN]'

3. Connect to the deployment

When the players receive the notification that the IP and port values have been assigned, they can compare them against the client cache and then use them to connect to the server to play the match.

4. End the match and deployment

Once the match is finished, the Lobby Owner will unset the IP and port values from the EOS Lobby Properties, which will notify everyone else to disconnect gracefully from the server. If the application has the configuration to inject environment variables, they can be used to terminate the deployment from within at this time.

To terminate the deployment from outside the server, a request like the curlcommand shown below can be used instead.

curl --location --request DELETE 'https://api.edgegap.com/v1/stop/[REQUEST_ID]' \

--header 'Authorization: [EDGEGAP_API_TOKEN]'

If the players remain in the lobby, the Lobby Owner can then repeat the steps starting at requesting a new deployment in order to initiate a rematch with the same people.

Écrit par

the Edgegap Team

Intégrer Edgegap facilement en quelques minutes

Intégrer Edgegap facilement en quelques minutes

Intégrer Edgegap facilement en quelques minutes