Skip to main content
PlayFlow’s matchmaking system supports both traditional symmetric matchmaking (like Fortnite, Counter-Strike) and advanced role-based asymmetric matchmaking (like League of Legends, Overwatch, Dead by Daylight). The system seamlessly integrates with lobbies to provide automated matching based on skill, region, roles, and custom criteria.

Prerequisites

Matchmaking always runs on top of the lobby and player-identity systems, so before starting a search you need:
  • A lobby. Every match request comes from a lobby (even a solo one). See the Lobby Quick Start to create and manage lobbies.
  • A player identity. Lobby and matchmaking calls require an authenticated player. With a client key and an auth provider configured, pass a valid player token; otherwise a trusted player id is used. See Player Authentication.
  • A matchmaking mode. Configure at least one mode in your lobby configuration (below) whose name you pass to FindMatch.

Matchmaking Types

Traditional/Symmetric Matchmaking

Used for games where all players have equal capabilities and teams are symmetrical. Examples include:
  • Battle Royale (Fortnite, PUBG): 100 players, last one standing
  • Team Deathmatch (Counter-Strike, Valorant): 5v5 competitive matches
  • Arena Duels: 1v1 or 2v2 ranked matches
  • Large-scale Battles: 32v32 or 64v64 team warfare

Role-Based/Asymmetric Matchmaking

Used for games where players have distinct roles with unique abilities and responsibilities. Examples include:
  • MOBA Games (League of Legends, Dota 2): Support, Tank, DPS roles with team composition requirements
  • Hero Shooters (Overwatch, Paladins): Role queue with tanks, healers, and damage dealers
  • Asymmetric Horror (Dead by Daylight): 4 survivors vs 1 killer
  • Social Deduction (Among Us, Werewolf): Different roles with hidden information

How Matchmaking Works

In PlayFlow, matchmaking always works through lobbies:
  1. A player creates a lobby (for just themself, or for a party of friends)
  2. Players set their matchmaking data (skill, region, roles)
  3. The lobby host starts the search
  4. The system finds compatible lobbies based on your configuration
  5. When a match is found, a game server automatically starts for all players
This lobby-based approach naturally supports party matchmaking (friends queuing together) while maintaining team cohesion.

Dashboard Configuration

Before writing code, you must configure your matchmaking rules in the PlayFlow Dashboard.
  1. Go to your project’s ConfigurationLobbies tab
  2. Create or edit a lobby configuration
  3. Click the Matchmaking tab
  4. Add and configure matchmaking modes

Traditional Configuration Examples

For tactical shooters like Counter-Strike or Valorant:

Role-Based Configuration Examples

For games like League of Legends with strict role requirements:

Backfill Configuration

Backfill routes newly-queued players into an already-running match that still has open slots, instead of always spinning up a fresh server. Configure it with the backfill object on a mode:
allowBackfill: true is still accepted as a deprecated alias for backfill: { "enabled": true }, but prefer the object form so you can tune the window and skill gate.

Implementation Guide

Here are the steps to implement matchmaking in your game.

Step 1: Set Player Matchmaking Data

Players must set their matchmaking attributes before searching. This includes MMR, regions, and roles (for role-based modes).

Traditional Matchmaking Data

For traditional modes, set MMR and acceptable regions:

Role-Based Matchmaking Data

For role-based modes, also specify your role preferences:
Once the player’s data is set, the lobby host can start the search by calling FindMatch. The mode parameter must match the name of the matchmaking mode you created in the dashboard.

Step 3: Handle Matchmaking Events

After starting the search, subscribe to events to drive your UI.

Step 3.5: CS2-Style “Accept Match” flow (optional)

If the matchmaking mode has matchConfirmation.enabled: true in the dashboard, matches pause at the match_found status waiting for every lobby to explicitly accept. Opt in by subscribing to three extra events and exposing accept/decline buttons.
If any player declines or the deadline expires, every participating lobby returns to waiting (not back to in_queue) — players re-queue manually when ready. This matches how CS2 and League of Legends handle match acceptance. The host can cancel the matchmaking search at any time by calling CancelMatchmaking.

Advanced Features

Role Assignment Algorithm

The role-based matchmaking system uses an intelligent priority-based algorithm to assign players to roles. Roles can be provided as either a single string or a string array for flexibility.
Key Principle: Players with fewer role options get priority assignment to ensure everyone gets a suitable role. This is NOT random - it’s deterministic and fair.

How Priority Assignment Works

1. Specificity First Players with fewer role options are assigned before flexible players:
2. Preference Order Matters When assigned, the system tries roles left-to-right in your array:
3. Tie-Breaking When players have identical preferences, first-come-first-served applies:

Real-World Example

For a MOBA team needing specific roles:

Setting Role Preferences in Code

Edge Case: If too many players are inflexible (single role only) and want the same role, the match will fail. Always encourage some flexibility in your player base!

Spectator Support

Spectators are excluded from team requirements but still receive game server access for observation.

Regional Matchmaking

Players can specify multiple acceptable regions. The system finds matches where players have overlapping regions.

Party Support

The lobby-based approach naturally supports parties. Friends can join the same lobby and queue together:

Troubleshooting

Common Issues

  • Verify all players have set required matchmaking data (MMR, regions, roles)
  • Check that players have overlapping regions in their regions field
  • For role-based modes, ensure you have the exact roles needed for team composition
  • Check dashboard configuration timeout settings
Ensure spectator roles are listed in the excludedFromQueue array in your dashboard configuration:
  • Players with single specific roles are prioritized over flexible players
  • Ensure role names match exactly with dashboard configuration
  • Check that total players match team requirements

Next Steps

Lobby Quick Start

Review the basics of creating and managing lobbies.

Lobby Events Reference

See all events for building responsive matchmaking UI.

Game Servers

Learn about server lifecycle and configuration.