Getting Started
Get started with Matchmaking quickly and explore example scenarios for various genres.
See Matchmaker In-Depth for detailed explanations and more tips on customization.
Our matchmaking philosophy is driven by player perspective, with core principles of matchmaking:
maximizing match fill rate and social integration (friends and lobbies),
fast matches and high match quality controls (low latency, similar preferences),
high service availability, observability, analytics, and user-friendly error handling.
✔️ Preparation
Testing our Matchmaker is entirely free, no credit card required.
Free Tier allows up to 3 hours of runtime on our shared test cluster, after each restart.
This tutorial assumes you have already:
uploaded and configured your server application on Edgegap,
Getting Started - Servers (Unity),
Getting Started - Servers (Unreal Engine),
successfully connected from a game client to your server on Edgegap.
Matchmaking Architecture
Understanding matchmaking architecture is easy:

Our matchmaker reference architecture involves several flows of data:
Matchmaker In-Depth #📗 API is used by Game Clients to communicate with Matchmaker:
Matchmaker In-Depth #/monitor to check on matchmaking service status,
optionally Matchmaker In-Depth #/locations/beacons to retrieve Ping Beacons.
Deployments API is used to deploy, scale, and manage your Dedicated Servers by Matchmaker.
Netcode Transports are used to communicate between Game Clients and Dedicated Servers:
Edgegap is not involved in this communication.
Optionally, Matchmaker In-Depth #Backfill is used by Dedicated Servers to replace or add more players.
This guide will focus on Matchmaking API and Backfill API.
🍀 Simple Example
Start with a simple example and test the core matchmaking player flow:
creating the matchmaker instance on the shared Matchmaker In-Depth #☁️ Hosting Cluster,
defining rules and settings in your matchmaker Matchmaker In-Depth #📏 Configuration,
testing player flow and managing Matchmaker In-Depth #🎫 Player Tickets with Matchmaker In-Depth #📗 API.
1. Set Up on Free Tier
☑️ Register for your free Edgegap account and open the Matchmaker dashboard page.
☑️ Click on Create Matchmaker first, then input:
matchmaker name - for your own reference, e.g.
quickstart-dev,upload our Simple Example JSON configuration.
🍀 Simple Example (Minimal Recommended Configuration):
Make sure to change the application name and version to match your Apps and Versions.
{
"version": "3.1.0",
"inspect": true,
"max_deployment_retry_count": 3,
"ticket_expiration_period": "5m",
"ticket_removal_period": "1m",
"profiles": {
"simple-example": {
"application": {
"name": "",
"version": ""
},
"rules": {
"initial": {
"match_size": {
"type": "player_count",
"attributes": {
"team_count": 1,
"min_team_size": 2,
"max_team_size": 2
}
},
"beacons": {
"type": "latencies",
"attributes": {
"difference": 100,
"max_latency": 200
}
}
},
"expansions": {}
}
}
}
}Troubleshooting and FAQ:
☑️ If no validation errors appear, hit Create and Start and wait for the process to complete. This will result in a new free cluster starting, with your Simple Example matchmaker.
✅ You may now proceed to the next step.
2. Explore Configuration
As we release updates to Matchmaker, each new version uses Matchmaker In-Depth #Semantic Versioning to clearly communicate the impact of changes by interpreting format major.minor.patch:
🔥
majorversions include breaking changes and require integration review,🌟
minorversions include substantial backwards-compatible improvements,🩹
patchversions include bug fixes and minor improvements.
Use Matchmaker In-Depth #/inspect to better understand and debug possible matchmaking flows while in development. We recommend disabling inspect API for your live matchmaker.
Some deployments may result in Errors. We attempt to resolve this by retrying deployment up to max_deployment_retry_count times automatically (without client confirmation).
To ensure that unexpected client crashes or abandoned tickets do not linger and take up your matchmaker resources, tickets will be cancelled after ticket_expiration_period causing their status to change to CANCELLED and then permanently deleted after ticket_removal_period .
The core of our matchmaking logic is configured in Matchmaker In-Depth #Profiles. Each profile is a completely isolated matchmaking queue, pointing to Apps and Versions #🏷️ App Versions with pre-defined amount of required CPU and memory (RAM) resources.
Matchmaker In-Depth #Rules in the initial rule set must be met for players to be grouped together, each defined by three properties:
name of your choosing, e.g. -
match size,rule type, also known as operator, e.g. -
player_count,and lastly operator attributes, e.g.
team_countormax_team_size.
Player Count Rule
This is a special rule defining how many players need to match to initiate assignment:
team_countrefers to number of teams, 1 team may be used for cooperative or free-for-all modes,min_team_sizerefers to the minimum number of players per team.max_team_sizerefers to the maximum number of players per team.
Our simple example demonstrates a cooperative game with 2 players.
Player Count rule is required and may only be defined once in your initial configuration rules.
Latencies Rule
Use this rule to provide the lowest possible ping for all players.
Latencies rule may only be defined once in your initial configuration rules.
✅ You may now proceed to the next step.
latencies is a special rule matching players within a specific difference range in ping values:
this presents a “soft” solution to splitting your player base, enabling matching with neighboring regions, especially improving match speed for less populated regions,
max_latencyshould be specified to discard locations above a given threshold,
Our example beacons rule above with "difference": 100, "max_latency": 200 initially:
✅ Alice and Bob will match:
Tokyo is discarded (>200 ms),
latency for Chicago within 100 ms absolute difference.
Chicago
✅
75.0
12.3
87.3
Los Angeles
❌
113.2 ❌
145.6
32.4
Tokyo
n/a
n/a
233.2 ❌
253.2 ❌
❌ Alice and Charlie will never match:
no beacons have < 200 ms latency for both players,
Alice lives in North America - Illinois,
Charlie lives in Asia - Japan.
Chicago
n/a
n/a
12.3
215.6 ❌
Los Angeles
n/a
n/a
145.6
238.3 ❌
Tokyo
n/a
n/a
233.2 ❌
24.2
3. Review Instance Details
☑️ Review details of your new matchmaker in our dashboard once it’s initialized:

Status indicates service health, may be ONLINE, OFFLINE, or ERROR.
Identifier helps Edgegap staff find your matchmaker quickly if you need help troubleshooting.
Started at can be useful to track down the latest update time.
Size corresponds to one of our Pricing Tiers.
API URL will be used by Game Clients and Game Servers to communicate with your matchmaker.
Swagger URL is a handy openAPI specification GUI we provide to explore API schema.
Auth Token is a unique secret token used by Game Clients and Game Server for authentication.
Edgegap staff will never ask for your tokens. Regenerate your token if you suspect a security breach.
To test your new matchmaker, you will need the Swagger URL, API URL and Auth Token.
✅ You may now proceed to the next step.
See Matchmaker In-Depth #⏩ Rolling Updates for live games and zero-downtime updates.
4. Test Tickets API
☑️ First, open your Swagger URL to inspect your openAPI schema in the swagger GUI:

☑️ Click on Authorize 🔒, paste your Auth Token, and confirm by clicking on Authorize.

☑️ Scroll down to Ticket API - POST /tickets, expand and click Try it out.

☑️ Preview your Matchmaker In-Depth #🎫 Player Tickets request:
notice
player_ipset tonull- this will cause Matchmaker to use the IP address automatically added to your request (see Matchmaker In-Depth #Server to Server for alternatives),profilerefers to your Matchmaker In-Depth #Profiles,attributesinclude values for your matchmaker rules, in this case for thelatenciesrule,rule
player_countis the only rule which doesn’t require any attributes in player tickets.
☑️ Click Execute and review the response to your player ticket request:
idis your unique matchmaking ticket ID, save this to check on your ticket later,profileconfirming the choice of Matchmaker In-Depth #Profiles,group_idis a unique group ID issued to every ticket, a solo player is represented as a group of 1,see Matchmaker In-Depth #Join as Group for matchmaking with your friends or lobbies,
team_idis a unique team ID issued to every ticket once Matchmaker In-Depth #Matchmaking Process reachesTEAM_FOUNDstatus,see Matchmaker In-Depth #Teams for grouping up players in multiple teams,
each team can contain multiple groups, not exceeding the configured team size,
player_ipis the resolved public IP address of the player, regardless of the identification method,assignmentis set tonullto indicate the ticket has not been matched or assigned to a server,created_atprovides information about when the player ticket was created for game UI usage,statusindicates the current status of the ticket, all tickets start inSEARCHING,see Matchmaker In-Depth #Matchmaking Process for details.

☑️ Create a second ticket by hitting Execute again, so our two players match and a server is started.
☑️ Collapse POST /tickets and open GET /tickets/{ticketId}, then click Try it out.
☑️ Input ticket ID from the response in previous step and click Execute.

☑️ Review the updated assignment for your player ticket:
status changed to
MATCH_FOUNDfirst, while keepingassignmentset tonullto indicate players have matched and a server is being assigned,

☑️ Click Execute again to check on your ticket, and review the updated assignment for your ticket:
status changed to
HOST_ASSIGNEDwithassignmentcontaining details of the assigned server.

☑️ Inspect your new deployment in our dashboard:
notice each deployment is tagged with all ticket IDs and profile for added traceability.

☑️ Try connecting from your game client to the assigned server.
If you’re experiencing high latency, your netcode integration may be configured to simulate network latency. Disable VPN when testing for more realistic conditions and receive a low-latency deployment.
☑️ Once you verify you’re able to connect to your Deployment without issues and are done testing, Stop your Deployment to free up capacity in your account for the next build.
✅ You may now proceed to the next step.
5. Game Integration
As indicated by #Matchmaking Architecture above, Matchmaker integrates:
with Game Client, to manage Matchmaker In-Depth #🎫 Player Tickets,
with Dedicated Server, to:
process player preferences passed through their tickets,
optionally to support Matchmaker In-Depth #Backfill to add or replace players after starting.
☑️ In Game Client, we recommend providing ticket status updates throughout Matchmaker In-Depth #Matchmaking Process to players using in-game UI for best player experience. See:
Unity Developer Tools #⭐ Matchmaking SDK by Edgegap:
import simple example and customize for your needs,
Unreal Engine Developer Tools:
install from Fab Marketplace (free for Personal use),
download example project and customize for your needs.
☑️ In Game Client, ensure you’re handling non-retryable errors:
HTTP 404 Not Found- ticket has been deleted,HTTP 500 Internal Server Error- temporary service outage.
☑️ In Game Server, process player preferences and initial server context. API usage is not required:
Read Injected Environment Variables (Matchmaker) to retrieve initial players’ matchmaking data.
Read Injected Environment Variables (App Versions) for version parameters, settings, and secrets.
Read Injected Environment Variables (Deployment) for deployment information, IP, location, etc...
☑️ Once players connect, Game Server and Game Clients start a loading scene to perform synchronization steps (e.g. selecting and loading a map/scene/level). We recommend a full fledged 3D scene, a lobby-like social UI, or a loading screen with a progress bar, to indicate initialization is progressing.
☑️ Once Game Clients fully loaded, players load/travel to the main gameplay scene.
☑️ Optionally, Game Server may create and manage Matchmaker In-Depth #Backfill and player capacity (add or replace players who leave).
☑️ Ensure your deployment will be stopped properly using Deployments #Injected Environment Variables, if:
no players join the match,
all players have left the match,
match concludes correctly.
🙌 Congratulations, you’ve completed Matchmaking integration! To learn more, keep reading.
🏁 Advanced Example
A full fledged configuration utilizing all matchmaking features including Matchmaker In-Depth #Profiles, Matchmaker In-Depth #Application and Versions, Matchmaker In-Depth #Rules with Matchmaker In-Depth #Rule Expansion may look like this:
🎾 Custom Lobby
Custom lobbies (private lobbies, sandbox levels) are a very popular option for couch multiplayer and testing new features in games before they enter main game modes. These games typically require the least amount of restrictions, but aim to ensure that players can Matchmaker In-Depth #Join as Group.
Matchmaker In-Depth #Backfill may use Custom Lobby profiles to support inviting friends reliably.
Add custom-lobby-example profile in your existing matchmaker to support custom lobbies.
🥛 Backfill Showcase
Building on #🍀 Simple Example, this configuration showcases Matchmaker In-Depth #Backfill with Matchmaker In-Depth #Join as Group.
Use Matchmaker In-Depth #Backfill to replace Seat/Match sessions. Matchmaker only supports Default session type.
To initiate successful backfill:
Server creates Matchmaker In-Depth #/backfills for each team separately, with values:
real
assignmentdata retrieved from Deployments #Injected Environment Variables (deployment).adding
backfill_group_sizeto tickets, listing group sizes up to available team capacity.real
ticketsdata retrieved from Matchmaker In-Depth #Injected Environment Variables (matchmaker),or mock
ticketsdata fabricated to match specific (real) player tickets,
Clients create Matchmaker In-Depth #/tickets or Matchmaker In-Depth #/group-tickets with
backfill_group_sizearray:including value
"1"if the player is matchmaking alone, or number of group members,additionally including value
"new"if players wish to allow starting new games,or omitting value
"new"if players only wish to join a game in progress (backfill).
Matchmaker In-Depth #Matchmaking Process proceeds to assignment and clients connect to the server.
Backfills ignore player_count rule, and always match a single group. Values in backfill_group_size dictate how many players may be matched. Creating one backfill per team ensures team round-robin strategy, with server creating new backfills to fill remaining seats as needed.
Once game server initialization concludes, your server should continually:
Start idle disconnect countdown for each new player (recommend up to 3 min):
Start a loading scene/level while players connect - a full fledged 3D scene, a lobby-like social UI, or a loading screen with a progress bar, to indicate initialization is progressing.
Trigger loading for new players on server initialization.
Trigger loading for players replacing leavers (joining via Backfills).
Keep track of new player connections or existing players leaving over time:
Listen to custom client RPCs containing new player ticket IDs (initial or backfilled), to pair tickets to netcode entities/actors.
Read and verify
assigned_ticketplayer data retrieved from Getting Started.Create new Backfills for unused player capacity (leavers).
Renew expired Backfills, which are deleted after
ticket_expiration_period.
Delete any leftover Backfills once the Deployments #5. Deployment Stopped:
Unity -
OnApplicationQuitcallback,Unreal Engine -
OnWorldDestroyedorPreExitcallback.
See Mirror Seat Management and FishNet Seat Management for player connection monitoring.
⚔️ Competitive Games
Competitive games focus on players competing against each other to achieve victory, whether as individuals (free for all) or teams. Matchmaking is crucial to ensure fair and balanced matches by pairing players or teams of similar skill levels. Maintain the pace of the game by quickly finding opponents with low latency to ensure fair competition.
You may define multiple teams with 1 or more players each, for example:
1v1 fighting game, with team count of 2 and team size of 1, require 2 players per game.
10 player free-for-all, with team count of 1 and team size of 10, require 10 players per game.
20x3 battle royale, with team count of 20 and team size of 3, require 60 players per game.
Define multiple Matchmaker In-Depth #Profiles for game mode specific rules and settings, and expand as needed.
For all matches:
restrict matchmaking latency to prevent matching players far away,
Matchmaker In-Depth #Join as Group for pre-made parties and prevent exceeding team sizes,
slowly relax latency restrictions over time to find more players,
allocate more CPU or memory with different Apps and Versions #🏷️ App Versions for specific profiles,
For casual matches:
omit rank restrictions to maximize match speed and match fill rate,
let players provide their map preferences to find a map suitable for everyone,
specify backfill group size to replace leavers without exceeding team sizes,
remove latency limitations to guarantee a match after 3 minutes (180s) of queue time.
For competitive matches:
restrict rank to only allow opponents with similar skill level,
use rank-up or rank-down ranks to match players at the league's rank extremes.
For the top 1% of high skill matches (challengers):
use numerical skill ratings (ELO) to gain fine control over skill distribution in matches,
wait longer before relaxing latency requirements due to lower amount of players.
Using multiple profiles to separate casual game modes, competitive game modes, and top-tier challenger players allows you to customize rules and expansions for each type of player separately.
🤝 Cooperative Games
Cooperative games require players to work together as a team towards a common goal, or AI opponent. Efficient matchmaking helps align players with similar preferences, gameplay habits, replaces players who leave, and improves Ping Beacons #🟢 Connection Quality to provide a responsive player experience.
With team count 1 and maximum team size of 4, require up to 4 players per match.
Define multiple Matchmaker In-Depth #Profiles for game modes specific rules and settings:
start with minimum of 4 players to keep players in queue and maximize match fill rate,
restrict matchmaking latency to prevent matching players far away,
let players choose a particular game difficulty to suit everybody’s skill level,
let players provide their map preferences to find a map suitable for everyone,
restrict player level difference to require similar degree of game progression,
specify backfill group size to replace leavers without exceeding server capacity,
use moderation flags to separate low-karma players and cheaters from general population,
Matchmaker In-Depth #Join as Group for pre-made parties and to fill teams without exceeding server capacity,
allocate more CPU or memory using different Apps and Versions #🏷️ App Versions for other profiles.
Start with the ideal conditions, and expand restrictions to ensure quick matches:
relax latency restrictions over time to find more players,
increase allowed player level difference to find more players,
decrease minimum team size to require less players and start the game sooner,
server may fill empty slots with AI teammates, or use Matchmaker In-Depth #Backfill to add players later,
set minimum team size to 1 to launch the game solo after 150s of queue time
🎈 Social Games
Social games focus on building connections and relationships between players through collaboration, communication, and shared experience. Efficient matchmaking supports high number of players, maximizes match fill rate, aligns player preferences and gameplay habits, replaces players who leave, and ensures high Ping Beacons #🟢 Connection Quality to provide a responsive player experience.
With team count 1 (free for all) and maximum team size of 50, require up to 50 players per match.
Define Matchmaker In-Depth #Profiles for game modes specific rules and settings:
restrict matchmaking latency to prevent matching players far away,
let players provide their game mode preferences and find a mode suitable for everyone,
specify backfill group size to replace leavers without exceeding server capacity,
use moderation flags to separate low-karma players and cheaters from general population,
Matchmaker In-Depth #Join as Group for pre-made lobbies or to fill teams without exceeding server capacity,
allocate more CPU or memory using different Apps and Versions #🏷️ App Versions for other profiles.
Start with the ideal conditions, and expand restrictions to ensure quick matches:
relax latency restrictions over time to find more players,
slowly decrease minimum team size to require less players and start the game sooner,
server may fill empty slots with AI players, or use Matchmaker In-Depth #Backfill to add players later,
set minimum team size to 1 to launch the game solo after 150s of queue time.
Last updated
Was this helpful?


🎈 Social Game Example