Discover how Edgegap works

Discover how Edgegap works

Photon Fusion 2

BR200

Deploy to Edgegap

Published

Published

Published

BR200: Run Photon's Fusion 2 battle royale on Edgegap dedicated servers

BR200: Run Photon's Fusion 2 battle royale on Edgegap dedicated servers

BR200 is Photon's third-person battle royale sample for up to 200 players, built on Photon Fusion 2. It can already run as a headless dedicated server. Edgegap's kit runs that server on Edgegap, one deployment per match.

The kit changes no BR200 or Fusion code. Players still find matches through Photon Cloud, with your own Photon App ID. Only the server moves: it runs on Edgegap instead of a player's machine, and clients connect to it directly instead of through a Photon relay.

Edgegap's network spans 615+ Edge Cloud locations (learn more). Each server is deployed to the best available location for its players and stops itself when the match ends, so billing stops too.

Photon's Fusion 2 documentation lists Edgegap as a game session hosting provider.

Platforms: Linux dedicated server (Docker, linux/amd64). Tested with Windows clients, built on Windows 11 with Unity 6000.3.11f1. The kit is MIT-licensed; BR200 comes from the Unity Asset Store and stays under the Asset Store EULA and Photon's terms. The repository contains no BR200 or Fusion code.

How it works

  1. You start an Edgegap deployment with the players' public IPs. Edgegap places it near them.

  2. The kit's start script reads Edgegap's variables and launches BR200 with its own options: -dedicatedServer, bind address 0.0.0.0, port 7777/UDP, and the deployment's address as the session name.

  3. The script picks the Photon region nearest the deployment. The server registers its session with Photon Cloud in that region.

  4. Clients use the same Photon App ID, App Version and region, find the session by name (or in the Menu's server list), and connect Direct to the Edgegap server.

  5. When the match ends and BR200 exits, the script asks Edgegap to stop the deployment.

What the kit adds:

Path

What it does

Assets/EdgegapBR200/Editor/BR200ServerBuilder.cs

Adds Tools > Edgegap BR200: checks the project (IL2CPP server, Linux toolchain, unsafe code, scenes, App ID, Peer Mode) and builds the Linux Server to Builds/EdgegapServer.

edgegap/Dockerfile

Ubuntu 22.04 image that runs the server as a non-root user.

edgegap/start-server.sh

Maps Edgegap's ARBITRIUM_* variables to BR200's command-line options, picks the Photon region, forwards stop signals, stops the deployment at the end of the match.

.dockerignore, .gitattributes

Send only the server build to Docker; keep Linux line endings.

scripts/

Build, package and push, run locally, run the tests in a container.

examples/

An app version body and a deployment request for the Edgegap API.

tests/start-server.test.sh

46 checks on the start script. No Unity needed.

Photon Fusion 2

x

Edgegap

Fully Endorsed by

Fully Endorsed by

Listed in Photon's Fusion 2 docs

Listed in Photon's Fusion 2 docs

Photon's Fusion 2 documentation lists Edgegap as a game session hosting provider for Fusion dedicated servers.

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.

BR200 main menu with a soldier character, from Photon Fusion 2's battle royale sample, with the Unity and Photon logos.

Photon's BR200 battle royale, with each match on its own Edgegap dedicated server.

Step-by-Step Guide

Run the Sample

1. Before you start

  • A free Edgegap account.

  • BR200 from the Unity Asset Store. The repository is a kit and doesn't include the game.

  • Unity with the Linux Dedicated Server build module. Tested with Unity 6000.3.11f1, BR200 2.1.0 and Fusion 2.1.1.

  • Your own Photon Fusion App ID from the Photon dashboard. Each developer needs their own; the kit never ships one.

  • Docker Desktop.

  • Optional: the Edgegap Unity plugin, if you'd rather build and upload from the editor.

  • Clone the kit.

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. Add the kit and set up Photon

Copy Assets/EdgegapBR200, edgegap/, scripts/, .dockerignore and .gitattributes into the BR200 project root, next to Assets/.

Then in Unity:

  1. Tools > Fusion > Realtime Settings: paste your Fusion App ID and note the App Version. Server and clients must share the App ID, App Version and Photon region, or they won't find each other.

  2. Tools > Fusion > Network Project Config: set Peer Mode to Single.

  3. The server must use IL2CPP, BR200's default. On a Mono server, BR200's RPCs fail and players never get a character. To build Linux IL2CPP on Windows with Unity 6000.3 or later, add com.unity.toolchain.win-x86_64-linux and com.unity.sdk.linux-x86_64 in the Package Manager (+ > Add package by name).

  4. Run Tools > Edgegap BR200 > Check Project and fix what it reports.

You don't edit the Loader scene or any script: the server's mode, address, port, session and region all come from the command line.

3. Build the server and put it on Edgegap

Build the Linux server from a terminal (Git Bash works on Windows), or with Tools > Edgegap BR200 > Build Linux Server. The IL2CPP build took 56 minutes in our test:

scripts/build-server.sh

Package and push the image. Log in first with the credentials from the Container Registry page:

scripts/package.sh registry.edgegap.com/<project>/br200

If you use the Edgegap plugin instead, point its Containerize step at edgegap/Dockerfile and keep the build path Builds/EdgegapServer.

In the dashboard, create the application br200 and a version with the tag the script printed:

  • One port: name gameport, 7777, UDP.

  • Restart policy never. The deployment ends when the match ends.

  • Max duration a little above your longest match (60 minutes in the example).

  • 1 vCPU and 2 GB to start. A full 200-player match hasn't been sized yet.

examples/app-version.json holds the same settings for the API.

4. Start a match and connect

Test the image on your own machine first, with the same variables a real deployment gets:

scripts/run-local.sh eu

Locally, clients show the connection type Relayed: a client on the same machine can't reach Docker Desktop's address directly. On Edgegap, the same image gives Direct.

Then start a deployment from the dashboard, the plugin or the API (examples/deploy-request.json), with the players' public IPs. Its FQDN, such as 0a1b2c3d4e5f.pr.edgegap.net, is also the BR200 session name. The first log lines show the bind address, the public address and the Photon region the server chose.

To join, open the scene set as the Loader's Batch Mode Scene, and in the Standalone Manager set Game Mode Client, Server Name and Session Name to the FQDN, and Region to the server's region. Then play. (Joining from the Menu scene's server list should work too, but wasn't tested.)

BR200 starts a 120-second waiting timer when the server boots. Connect as soon as the deployment is Ready.

In a connected client, press Tab: the overlay's CT (connection type) should say Direct.

5. Add it to your own Fusion game

The kit is a working reference: your coding agent starts from files that already ran on Edgegap, so it builds on a tested setup instead of guessing.

For BR200, the kit changes no game code (see the table in "How it works"). For your own Fusion game, these are the parts to carry over:

  1. Run headless in GameMode.Server. Start the runner as a dedicated server from command-line options or environment variables (edgegap/start-server.sh shows the mapping).

  2. Bind 0.0.0.0. Set StartGameArgs.Address to 0.0.0.0 on the fixed port (7777/UDP). Fusion finds the public address itself and clients connect Direct. 127.0.0.1 forces Photon relays; the deployment's public IP fails to bind.

  3. Name the session after the deployment. Use the FQDN (<ARBITRIUM_REQUEST_ID>.pr.edgegap.net) so clients can find it through Photon.

  4. Pick the Photon region near the deployment, from ARBITRIUM_DEPLOYMENT_LOCATION (the script's auto mode).

  5. Stop when the match ends. Call ARBITRIUM_DELETE_URL with ARBITRIUM_DELETE_TOKEN when the server exits, and never print the environment.

  6. Build the server with IL2CPP and containerize it with edgegap/Dockerfile as a model.

With your agent:

"Load the edgegap skill, then edgegap-fusion. Using github.com/edgegap/netcode-game-sample-photon-fusion2-battleroyale-200 as the reference, make my Fusion 2 game run as a headless GameMode.Server on Edgegap: bind 0.0.0.0 on port 7777/UDP, use the deployment FQDN as the session name, pick the Photon region nearest the deployment, stop the deployment when the match ends, and build an IL2CPP Linux server image."

For each step in detail, by hand, see the Photon Fusion 2 integration guide.

6. How players find the server

Matchmaking stays on Photon Cloud. The Edgegap deployment is the game server: it registers its session with Photon, and clients find it by session name, App ID, App Version and region. You don't need Edgegap's matchmaker for this sample, and it hasn't been tested with Fusion.

  • Session name: the deployment's FQDN by default. Set BR200_SESSION to change it.

  • Region: auto (default) picks the Photon region nearest the deployment. Set BR200_REGION to a code such as eu if your clients use a fixed region, or limit auto with BR200_REGION_ALLOWLIST. best lets Fusion ping instead.

  • Match settings: BR200_MAX_PLAYERS (1 to 200), BR200_MODE (battleRoyale, deathmatch or elimination), BR200_SCENE, set on the app version or on one deployment.

Your game's backend or lobby decides when to start a deployment and hands players the session name and region. For that flow in your own game, see the Photon Fusion 2 integration guide.

Known limits

  • 200 players not tested yet. The test ran two-player matches. CPU and memory for a full 200-player match haven't been sized: 1 vCPU / 2 GB is only a starting point.

  • One map tested. Only GenArea7 ran on Edgegap.

  • Menu join not tested. Clients joined with the Standalone Manager. The Menu's server list should work, but wasn't tested.

  • Windows build host only. Building on macOS or Linux hasn't been tested.

  • 120-second timer. BR200 starts its waiting timer when the server boots; players who join later count as eliminated.

  • Server must be IL2CPP. A Mono server builds in minutes but breaks BR200's RPCs.

What was tested

Tested end to end on Edgegap on 19 and 20 October 2026, with BR200 2.1.0, Fusion 2.1.1 (build 2177), Unity 6000.3.11f1, Windows 11 and Docker Desktop. Clients were headless Windows IL2CPP builds.

  • Build: Check Project and Build Linux Server produced an IL2CPP Linux server in 56 minutes.

  • Local container: two clients joined with no exceptions (CT Relayed, as expected locally).

  • Edgegap: deployments in Toronto (region cae) and Newark (region us). Two clients joined each one with CT Direct. In a two-player Battle Royale, one client left, the other got Game Over, and the deployment stopped on its own 2.5 minutes after it started.

  • Start script: 46 checks, no Unity needed:

bash tests/start-server.test.sh

Frequently Asked Questions

Questions about running Photon's BR200 on Edgegap.

Do I have to change BR200's code to run it on Edgegap?

No. BR200 already takes command-line options for a dedicated server. Edgegap's kit adds an editor build tool, a Dockerfile and a start script that pass those options, and changes no BR200 or Fusion code.

Does BR200 on Edgegap use Edgegap's matchmaker?

No. Matchmaking stays on Photon Cloud. The Edgegap server registers its session with Photon, and clients find it by session name and region, then connect Direct to the server.

Why does my client show CT Relayed?

On Edgegap, it usually means the server binds 127.0.0.1. Bind 0.0.0.0, as the kit does. In a local Docker Desktop test, Relayed is expected; the same image gives Direct on Edgegap.

Can the BR200 server be built with Mono?

It builds, but BR200's RPCs fail on a Mono server and players never get a character. Build the server with IL2CPP, BR200's default.

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.