Discover how Edgegap works

Discover how Edgegap works

Photon Fusion 2

Simple FPS

Deploy to Edgegap

Published

Published

Published

Last reviewed for accuracy

Last reviewed for accuracy

Last reviewed for accuracy

Simple FPS: Run Photon's Simple FPS on Edgegap dedicated servers

Simple FPS: Run Photon's Simple FPS on Edgegap dedicated servers

Simple FPS is Photon's deathmatch shooter sample for Fusion 2. As shipped, one player hosts the match. Edgegap's kit runs each match on its own dedicated game server instead, with no edits to Simple FPS or Fusion files.

Photon Cloud keeps doing what it does: players still find the game through Photon, and they still join from the sample's own Party menu. The only difference is what they type: the server's address and its Photon region.

No player hosts the match: a headless Fusion server runs the game, and every player connects to it directly.

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 it runs.

Platforms: Linux dedicated server (IL2CPP); clients tested on Windows. Unity 6000.3, Fusion 2.1.1, Simple FPS 2.1.1. The kit is MIT licensed. Simple FPS and Fusion come from the Unity Asset Store under their own licences and are not in the repo.

How it works

  1. You deploy the server on Edgegap. It starts as a Fusion server on UDP port 7777 and loads the Deathmatch scene.

  2. It names its Photon session after the deployment's address (for example f68e011bfb01.pr.edgegap.net) and registers it in the Photon region with the best ping from where it runs.

  3. The server logs server started: session=<address> photon_region=<code>.

  4. Players open Party Menu, type the address and region on the Join card, and press Join. Photon Cloud finds the session; the client then connects straight to the Edgegap server.

  5. If the server process exits on its own, the start script stops the deployment, so billing stops.

What the kit adds:

Path

What it does

Assets/EdgegapSimpleFPS/EdgegapFusionBootstrap.cs

Replaces FusionBootstrap on Deathmatch. In a server build, starts a Fusion server on port 7777, names the session after the deployment, marks the scene active on load.

Assets/EdgegapSimpleFPS/EdgegapPartyMenu.cs

Replaces FusionMenuUIParty on Startup. Join takes the deployment address and a Photon region code. Create Game is unchanged.

Assets/EdgegapSimpleFPS/EdgegapServerSceneLoader.cs

Server builds only: skips the Startup menu and loads Deathmatch.

Assets/EdgegapSimpleFPS/Editor/SimpleFpsEdgegapSetup.cs

Tools > Edgegap Simple FPS: check, set up, build the Linux server and a Windows client.

edgegap/Dockerfile, edgegap/start-server.sh

Ubuntu 22.04 image, non-root user. Never prints the environment; stops the deployment when the server exits.

scripts/

Set up, build, package and push, run locally, test with two headless clients.

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 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.

Two armed players among stacked shipping containers in Photon Fusion 2's Simple FPS sample, with the Unity and Photon logos.

Photon's Simple FPS, with each match on its own Edgegap dedicated server.

Step-by-Step Guide

Run the Sample

1. Before you start

  • A free Edgegap account.

  • Simple FPS Multiplayer (Photon Fusion) from the Unity Asset Store, imported into a new Unity project. It brings its own Project Settings.

  • Unity 6000.3 with Linux Dedicated Server Build Support and Linux Build Support (IL2CPP). For clients, Windows Build Support (IL2CPP), which needs Visual Studio's C++ workload.

  • To build the Linux IL2CPP server on Windows, add com.unity.toolchain.win-x86_64-linux and com.unity.sdk.linux-x86_64 in Window > Package Manager > + > Add package by name.

  • Your own Photon Fusion App ID from the Photon dashboard. Each developer needs their own.

  • Docker Desktop.

  • 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 to Simple FPS

Copy Assets/EdgegapSimpleFPS, edgegap/, scripts/, .dockerignore and .gitattributes into your Simple FPS project, next to Assets/. Then in Unity:

  1. In Tools > Fusion > Realtime Settings, paste your Fusion App ID. The Asset Store package also ships a PhotonAppSettings asset in Assets/AssetStoreTools/Resources/ with the publisher's App ID: put yours there too, or delete that copy.

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

  3. Run Tools > Edgegap Simple FPS > Check Project and fix anything it reports.

  4. Run Tools > Edgegap Simple FPS > Set Up Project.

Set Up Project swaps the two components (keeping their settings), adds a Region field to the Party menu's Join card, and sets the build profile to Startup (0), then Deathmatch (1). It changes only scene and build settings, and you can run it again safely.

3. Build the server and push the image

From a terminal (Git Bash on Windows), with the editor closed on the project:

scripts/build.sh server

The first IL2CPP server build takes about 13 minutes. Log in with docker login registry.edgegap.com, using the credentials on the Container Registry page, then package and push with a new tag for every build:

scripts/package.sh registry.edgegap.com/<project>/simplefps <new-tag>

To test on your machine first, run scripts/package.sh then scripts/run-local.sh. Locally, the connection shows as Relayed because of Docker Desktop's network; on Edgegap it's Direct.

If you build with the Edgegap Unity plugin instead, set its Path To Dockerfile to edgegap/Dockerfile. The plugin's default Dockerfile prints the environment, which includes the deployment's delete token.

4. Deploy and join a match

In the dashboard, create an application and a version:

  • your image and tag, with your registry username and token;

  • 1 vCPU and 2 GB to start;

  • one port: 7777, UDP, with the port check off.

Deploy the version close to your players. In the deployment's logs, find:

[edgegap-simplefps] server started: session=<fqdn> photon_region=<code>

Build a client with scripts/build.sh client (or your usual Windows build). Launch it, click Party Menu, type the deployment address (for example f68e011bfb01.pr.edgegap.net) in the code field and the region code (for example us) in the Region field, then click Join. A second player does the same, and both land in Deathmatch on the same server.

If a client doesn't connect, the region most likely doesn't match the one in the server log.

5. Add it to your own Photon Fusion 2 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. These are the changes it made, and what each one is for:

  1. The server starts itself. In a server build (UNITY_SERVER), Assets/EdgegapSimpleFPS/EdgegapFusionBootstrap.cs starts the runner as GameMode.Server on ARBITRIUM_PORT_GAMEPORT_INTERNAL (7777), bound to 0.0.0.0 so clients connect Direct.

  2. The session is named after the deployment. The session name is <ARBITRIUM_REQUEST_ID>.pr.edgegap.net, the deployment's address, so players and tools know what to join. PHOTON_REGION, if set, fixes the region.

  3. Clients load the right scene. Fusion tells clients the scene by build index, so the server is built with the client's scene list (Startup 0, Deathmatch 1) and Assets/EdgegapSimpleFPS/EdgegapServerSceneLoader.cs skips Startup on the server. The server also registers Deathmatch with activeOnLoad: true. Without these two fixes, clients join but throw NullReferenceException in Player.FixedUpdateNetwork every tick.

  4. Players join by address and region. Assets/EdgegapSimpleFPS/EdgegapPartyMenu.cs keeps the typed address as the session name (session names are case-sensitive) and passes the region to Fusion.

  5. The container is safe and stops itself. edgegap/Dockerfile runs the server as a non-root user; edgegap/start-server.sh never prints the environment and stops the deployment when the server exits.

With your agent:

"Load the edgegap skill, then edgegap-fusion (edgegap-fusion-simplefps for Simple FPS itself). Using github.com/edgegap/netcode-game-sample-photon-fusion2-simple-fps as the reference, make my Fusion game start as GameMode.Server in a Linux IL2CPP server build on the Edgegap game port, name the session after the deployment FQDN, keep the server's scene list and active scene the same as the client's, let players join by session name and Photon region, and add a Dockerfile that never prints the environment."

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

6. How players find the server

This sample doesn't use Edgegap's matchmaker. Matchmaking stays on Photon Cloud: a client finds the server by session name, App ID, App Version and Photon region, then connects straight to the Edgegap server.

  • Session name: the deployment's address, <request id>.pr.edgegap.net, from the deployment's logs or the dashboard.

  • App ID and App Version: the server and the clients must be built with the same ones.

  • Region: the server registers in the region with the best ping from where it runs (a Toronto deployment picked cae, Newark us). Clients must type the same code, or Photon can't find the session.

In this sample, players type the address and region into the Party menu by hand. In a shipped game, your own backend or lobby would start the deployment and hand players those two values. The Photon Fusion 2 integration guide covers that setup.

Known limits

  • Players type the address and region by hand. The Party menu is a test-friendly way in, not a full matchmaking flow.

  • Region must match. If the server picks a different Photon region than the client types, the join fails. The PHOTON_REGION override is written but not tested.

  • Ending a match is not tested. The start script stops the deployment when the server exits on its own, but whether Simple FPS's server exits after a match was not checked. Set a max duration on the app version.

  • Server size is a starting point. 1 vCPU / 2 GB is what the test used; the CPU a full match needs was not measured.

  • Licensed files stay out of git. Never commit Simple FPS, Fusion or the sample's third-party assets to a shared or public repository.

What was tested

Tested end to end on Edgegap on 20 October 2026, with Simple FPS 2.1.1, Fusion 2.1.1 (build 2177) and Unity 6000.3.11f1 on Windows 11:

  • A Linux IL2CPP server and a Windows IL2CPP client, built from the kit on an unmodified Simple FPS project.

  • A local container with two clients: both joined, Relayed (expected locally), no exceptions.

  • An Edgegap deployment in Newark (Photon region us) with two clients that joined through the Party menu: connection Direct, 11 to 29 ms, two players, Deathmatch loaded, no exceptions on the clients or the server. An earlier run with the same changes made by hand, in Toronto (cae): Direct, 11 to 24 ms.

To run the same check, copy Assets/EdgegapSimpleFPSTest into the project too, then:

scripts/build.sh client

scripts/test-clients.sh <fqdn> <region>

Two headless clients join through the Party menu; the script exits 0 when every client sees every player and logged no exception. Delete Assets/EdgegapSimpleFPSTest before shipping.

Not tested: the PHOTON_REGION override, more than two players, a match played to its end, whether the server exits after a match, CPU sizing, macOS, and the Edgegap plugin's build button.

Frequently Asked Questions

Questions about running Photon's Simple FPS on Edgegap.

Can Photon Fusion 2 run on a dedicated server?

Yes. A headless Unity build starts the runner as GameMode.Server, registers its session with Photon Cloud, and clients connect straight to it. Photon's Fusion 2 documentation lists Edgegap as a game session hosting provider.

Do I have to change Simple FPS's code?

No. The kit subclasses FusionBootstrap and FusionMenuUIParty and swaps them in the scenes with one menu command. No Simple FPS or Fusion file is edited, so sample upgrades stay clean.

How do players join the Edgegap server in Simple FPS?

From the sample's Party menu: type the deployment address in the code field and the Photon region in the Region field, then press Join. Both values are in the server's log.

Why do clients throw NullReferenceException in Player.FixedUpdateNetwork?

Usually the server was built with only the Deathmatch scene, or the scene isn't active on load. Fusion sends the scene by build index, so build the server with Startup and Deathmatch, as the kit does.

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.