Discover how Edgegap works

Discover how Edgegap works

Netcode for GameObjects

Boss Room

Deploy to Edgegap

Published

Published

Published

Boss Room: Run Unity's co-op sample on Edgegap dedicated servers, with Matchmaking

Boss Room: Run Unity's co-op sample on Edgegap dedicated servers, with Matchmaking

Boss Room is Unity's co-op dungeon sample for up to 8 players, built on Netcode for GameObjects (NGO). Edgegap's fork runs it on a dedicated game server, and adds optional matchmaking that puts players in the same dungeon.

Boss Room itself barely changes: same scenes, same prefabs, same Character Select, same Direct IP join. Everything the matchmaker needs lives in Assets/Edgegap/ and adds itself at runtime.

No player hosts the match. A headless Boss Room server runs the dungeon, needs no Unity Gaming Services, Relay or Lobby, and stops its own deployment once the match is empty.

Edgegap's network spans 615+ Edge Cloud locations (learn more). Each server is deployed to the best available location for its players and billed only while the match runs.

Platforms: Windows, macOS and Linux desktop clients (UDP). Tested with Windows clients. Original sample by Unity Technologies, under the Unity Companion License.

How it works

  1. Players press Find Match in the panel on the main menu. Each client sends a ticket to the Edgegap Matchmaker.

  2. The matchmaker groups 2 to 8 players and starts an Edgegap deployment for them.

  3. The server boots, starts through Boss Room's own ConnectionManager on 0.0.0.0 and the gameport port, and logs how many matched players to expect.

  4. When the ticket shows HOST_ASSIGNED, each client joins the server's public IP and external port through ConnectionManager.StartClientIp. Everyone lands in Character Select on the same server, then enters the dungeon together.

  5. When nobody is left (30 s after the last player leaves, or if nobody joins within 120 s), the server stops its own deployment.

What the fork changed:

Path

What it does

Assets/Edgegap/EdgegapBootstrap.cs

Runs before the first scene and adds the components below. No scene edits.

Assets/Edgegap/EdgegapMatchmakingClient.cs, EdgegapMatchmakingDTOs.cs

The Find Match panel: ticket, wait for HOST_ASSIGNED, join through Boss Room's ConnectionManager.

Assets/Edgegap/EdgegapServerLifecycle.cs

Server builds: logs matched and connected players, stops the deployment when the match is empty.

Assets/Edgegap/Resources/EdgegapSettings.asset

Matchmaker on/off, URL, Auth Token, profile, local port, timeouts.

Assets/Scripts/EdgegapServerStarter.cs

Starts the server with StartHostIp("SERVER", "0.0.0.0", port) on the Edgegap port, or 9998 locally.

ConnectionManagement/ changes

Server instead of host (StartServer), no host payload, build-type check removed (listed in the fork's README).

matchmaker-config.json, Dockerfile

Matchmaker profile to upload, and the server image.

No credit card required. Free tier includes the resources to deploy a real game server.

No credit card required. Free tier includes the resources to deploy a real game server.

Two Boss Room heroes, Brave Healer and Silly Rusher, in a blue-lit dungeon in Unity's co-op sample.

Two players in Boss Room's dungeon, on one Netcode for GameObjects server hosted by Edgegap.

Step-by-Step Guide

Run the Sample

1. Before you start

  • A free Edgegap account.

  • Unity 6000.0.54f1 (Unity 6.0 LTS) with Linux Build Support (Mono) and Linux Dedicated Server Build Support, plus the module for your client platform.

  • Docker Desktop, running.

  • Git LFS: run git lfs install before cloning, or the art and the Edgegap settings asset don't download.

  • Clone the fork.

Git: Unity needs a Git client (2.14.0 or newer) on your PATH to install packages from a Git URL, such as the Edgegap plugin. macOS usually has one already (Xcode Command Line Tools); on Windows, install Git.

2. Get a Boss Room server on Edgegap

Matchmaking needs a server that already works on Edgegap. Steps 4 and 5 of the Netcode for GameObjects guide cover building, containerizing and deploying it. What's specific to this fork:

  • Build the server with Tools → Edgegap → Build Linux Dedicated Server. The fork's Dockerfile at the repository root packages Builds/EdgegapServer/.

  • On the app version, one port: name gameport, 7777, UDP. The name must be gameport: the server reads its port from it.

  • Locally (and in docker run), the server listens on 9998 instead.

  • To check a deployment by hand: Start with Direct IP → Join in two clients, with the deployment's public IP (not the host name) and the external port of gameport.

To run the server image locally:

docker run --rm -p 9998:9998/udp ngo-bossroom:local

Two copies on one PC need their own profile, or the server rejects the second one as the same player:

Game.exe -AuthProfile p1

Game.exe -AuthProfile p2

3. Add it to your own NGO game

The fork is a working reference: your coding agent can copy its tested files instead of writing them from scratch. Four changes make an NGO game run on Edgegap with matchmaking:

  1. The server starts itself. In server builds, call StartServer, never StartHost, on 0.0.0.0 and the gameport port (Assets/Scripts/EdgegapServerStarter.cs, StartingHostState.cs).

  2. The server stops itself. It stops its deployment when nobody joins in time or the last player leaves, so billing stops (Assets/Edgegap/EdgegapServerLifecycle.cs).

  3. The client finds a match. It sends a ticket, waits for HOST_ASSIGNED, then joins the assigned IP and port (Assets/Edgegap/EdgegapMatchmakingClient.cs). If your game has its own connection flow like Boss Room's ConnectionManager, join through it so payloads and approval still work.

  4. Nothing in your scenes changes. Assets/Edgegap/EdgegapBootstrap.cs adds the components at startup, configured by EdgegapSettings.asset.

With your agent:

"Load the edgegap skill, then edgegap-ngo. Using github.com/edgegap/netcode-game-sample-unity-ngo-bossroom as the reference, make my Netcode for GameObjects game start a headless dedicated server on the gameport port, stop its deployment when the match is empty, and add a Find Match button that joins the server the Edgegap Matchmaker assigns, through my game's own connection flow."

For each step in detail, by hand, see the Netcode for GameObjects integration guide.

4. Turn on matchmaking in Boss Room

Matchmaking is off by default. Turn it on once a direct connection works:

  1. In the fork's matchmaker-config.json, set application.name and version to your application and version.

  2. In the dashboard, open Matchmaker → Create Matchmaker, upload the file, then Create and Start. Copy its API URL and Auth Token. The Auth Token is safe in game clients: it only allows matchmaking calls.

  3. Select Assets/Edgegap/Resources/EdgegapSettings.asset. Tick Use Edgegap Matchmaker, and paste the Matchmaker Url and Matchmaker Auth Token.

  4. Rebuild the client and start it twice. Press Find Match in the panel on the left of the main menu in both. The status goes searching → match found → joining, then both players land in Character Select on the same server.

The casual profile makes matches of 2 to 8 players, as many as Boss Room's 8 hero seats. It fills up to 8 when it can; after 15 seconds it starts with at least 2. Keep that expansion stage: without it, a match smaller than 8 only starts when the tickets expire, after 5 minutes.

To test without clicks, pass the settings on the command line (<url> and <token> from step 2), with -AuthProfile p2 and -edgegapAutoReady 1 for the second client:

Game.exe -AuthProfile p1 -edgegapMatchmaker true -edgegapMatchmakerUrl <url> -edgegapAuthToken <token> -edgegapFindMatch -edgegapAutoReady 0

When you ship a new server build: new image tag → new app version → in the matchmaker, Stop, edit application.version, Start. Otherwise matches keep deploying the old build.

Known limits

  • Desktop clients only. Boss Room connects over UDP, which browsers can't open. A WebGL build would need Unity Transport's WebSockets and a WS port with TLS Upgrade: not part of this sample.

  • The Find Match panel is a simple overlay, not part of Boss Room's menu. For a real game, call EdgegapMatchmakingClient.FindMatch() and CancelMatchmaking() from your own button and set ShowGUI off.

  • No ticket check on the server. Anyone with the IP and port can join by Direct IP. Checking each client's ticket ID against MM_TICKET_IDS in connection approval is a next step.

  • No joining a match in progress. Players who press Find Match later get a new server; backfill isn't set up.

  • Harmless server errors. The headless server logs NullReferenceException in ClientCharacter.OnAnimEvent and Transform child out of bounds, from Boss Room's client-side visuals. They don't affect play.

  • Free tier: one deployment at a time, and the matchmaker restarts every 3 hours (same URL and token).

What was tested

Tested end to end on Edgegap on 19 October 2026, with Unity 6000.0.54f1, Netcode for GameObjects 1.13.0, Unity Transport 2.5.2 (UDP) and the Edgegap Unity SDK 3.5.6:

  • Direct connection: two Windows clients joined the same Edgegap server by IP and played in the dungeon.

  • Matchmaker: two Windows clients pressed Find Match, were matched, connected and reached Character Select on the same server within 40 seconds of launch, then played in the dungeon.

  • Self-stop: each time, the server stopped its own deployment after the players left.

macOS and Linux clients should work, not tested. The fork's command-line test flags (-edgegapConnect, -edgegapFindMatch, -edgegapAutoReady, -edgegapScreenshots, -edgegapQuitAfter) are listed in EDGEGAP.md.

Frequently Asked Questions

Questions about running Unity's Boss Room with Edgegap's dedicated servers and matchmaking.

Can Boss Room use matchmaking without Unity Gaming Services?

Yes. Edgegap's fork adds an optional Find Match panel that uses the Edgegap Matchmaker. It needs no UGS Matchmaker, Relay or Lobby: the matchmaker starts an Edgegap server and every matched client joins it.

How many players can a Boss Room match have on Edgegap?

The fork's matchmaker profile makes matches of 2 to 8 players, as many as Boss Room's 8 hero seats. It waits up to 15 seconds to fill the match, then starts with at least 2.

Which Unity version does the Boss Room fork need?

Unity 6000.0.54f1 (Unity 6.0 LTS), with the Linux Dedicated Server build modules. Unity hasn't updated Boss Room for later versions, so newer ones can break it.

Does the Boss Room server keep running when nobody plays?

No. The server stops its own Edgegap deployment 30 seconds after the last player leaves, or if nobody joins within 120 seconds, so idle servers cost nothing.

Clients

Learn more from clients who integrated Edgegap

31 case studies are available from studios that moved to Edgegap from another platform.

Key reasons why they chose Edgegap

Discover the impact of Edgegap's automated game server orchestration for a flawless multiplayer experience.

Cost

Pricing

Pricing

Optimize costs and performance with hybrid orchestration

Optimize costs and performance with hybrid orchestration

Optimize costs and performance with hybrid orchestration

Edge Cloud

On-Demand

$0.00115

/ vCPU

/ MINUTE

Billed by the Minute, Only on Usage

Pay only when players play. 0 active servers = $0

Deploy game servers worldwide, per instance, to all 615+ edge cloud locations. Zero commitment.

Simply add a credit card.

Edge Cloud

On-Demand

$0.00115

/ vCPU

/ MINUTE

Billed by the Minute, Only on Usage

Pay only when players play. 0 active servers = $0

Deploy game servers worldwide, per instance, to all 615+ edge cloud locations. Zero commitment.

Simply add a credit card.

Private Fleet (Bare Metal)

Reserved Capacity

$0.0261

/ vCPU

/ HOUR

Billed Monthly, Always On

$280 per host/month (12 mo rate), or $350 monthly

Optimize the cost effectiveness of your game server with egress-free hosting of Private Fleets.

Persistent, available 24/7, exclusive to your studio.

Private Fleet (Bare Metal)

Reserved Capacity

$0.0261

/ vCPU

/ HOUR

Billed Monthly, Always On

$280 per host/month (12 mo rate), or $350 monthly

Optimize the cost effectiveness of your game server with egress-free hosting of Private Fleets.

Persistent, available 24/7, exclusive to your studio.

Your bill varies per rate and usage; which can vary per game type, player count, & more.

Your bill varies per rate and usage; which can vary per game type, player count, & more.

Model your usage with our estimate calculator ->

Model your usage with our estimate calculator ->

Edgegap's features & price: detailed comparison between Edge Cloud & Private Fleets

Edgegap's features & price: detailed comparison between Edge Cloud & Private Fleets

COMPARE

Free Trial

Edge Cloud

Private Fleets

FEATURES

Analytics & Monitoring

Billing Alarms

Click to Expand

28 more rows

Unlocks

Capabilities are unlocked when a credit card is added to the account.

COMPARE

Free Trial

Edge Cloud

Private Fleets

FEATURES

Analytics & Monitoring

Billing Alarms

Click to Expand

28 more rows

Unlocks

Capabilities are unlocked when a credit card is added to the account.

COMPARE

Free Trial

Edge Cloud

Private Fleets

FEATURES

Analytics & Monitoring

Billing Alarms

Click to Expand

28 more rows

Unlocks

Capabilities are unlocked when a credit card is added to the account.