Discover how Edgegap works

Discover how Edgegap works

/

/

Incremental Sample

PurrNet

Incremental Sample

Deploy to Edgegap

Published

Published

Published

Last reviewed for accuracy

Last reviewed for accuracy

Last reviewed for accuracy

Incremental Sample: Run PurrNet's Incremental game on Edgegap dedicated servers, with Matchmaking

Incremental Sample: Run PurrNet's Incremental game on Edgegap dedicated servers, with Matchmaking

PurrNet's Incremental sample is a small multiplayer Unity game: dash through trees, vacuum up the loot, bring it back to your base and buy upgrades. Edgegap's fork runs it on dedicated game servers, so no player hosts.

The game itself doesn't change: scenes, prefabs and gameplay code stay as PurrNet wrote them, apart from one line. Everything Edgegap-specific lives in its own Assets/Edgegap/ folder and adds itself when the game starts. In the Editor, play mode keeps PurrNet's usual host and ParrelSync clone flow.

What's new in the fork:

  • Optional matchmaking. Off by default: clients connect to an address and port. Turn on the Edgegap Matchmaker, and players click Find Match instead.

  • Servers that stop when players leave. Each server stops its own deployment 30 seconds after the last player leaves, or after 120 seconds if nobody joins. Idle servers don't cost money.

Edgegap's network spans 615+ Edge Cloud locations (learn more). With the matchmaker on, each server starts at the best available location for its players and is billed only while it runs.

Platforms: Windows, macOS and Linux desktop builds (UDP). Original game by PurrNet, MIT licence; art by Kenney.nl.

How it works

  1. The Linux dedicated server starts PurrNet’s server on UDP port 7777 and waits for players.

  2. Direct connection (default): each client enters the server's host and port and clicks Connect.

  3. Matchmaker (optional): each client clicks Find Match and sends a ticket. The Edgegap Matchmaker groups 2 to 4 players, starts a server near them and sends every client its address.

  4. Players chop trees, collect wood and buy upgrades on the same server.

  5. When everyone has left, the server waits 30 seconds, then stops its own deployment.

What the fork changed:

Path

What it does

Assets/Edgegap/EdgegapBootstrap.cs

Runs before the scene loads. In builds, turns off PurrNet's auto start and adds the components below.

Assets/Edgegap/EdgegapServerLifecycle.cs

Server builds: starts the server on 0.0.0.0:7777, logs the player count, stops the deployment when the server is empty.

Assets/Edgegap/EdgegapConnectPanel.cs

Client builds: address and port, or Find Match. Reloads the scene when the connection drops.

Assets/Edgegap/EdgegapMatchmakingClient.cs, EdgegapMatchmakingDTOs.cs

Matchmaker mode: creates a ticket, waits for its server, connects.

Assets/Edgegap/Resources/EdgegapSettings.asset

All settings: mode, ports, matchmaker URL and Auth Token.

Assets/Edgegap/Editor/EdgegapPluginBuild.cs

Runs the Edgegap Unity plugin’s Build server from the command line, for scripted tests and CI.

.dockerignore, matchmaker-config.json

Server image and matchmaker configuration.

ResourceSpawner.InitSeed

The one upstream change: runLocally: true, so the dedicated server spawns trees.

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.

PurrNet's Incremental sample from above: a player among low-poly trees and loot, next to the PurrNet cat logo.

Incremental Sample from Purrnet, where the player chop trees and returns the loot to its base, using Edgegap's dedicated server hosting and orchestration.

Step-by-Step Guide

Run the Sample

1. Before you start

  • A free Edgegap account. No credit card is needed to test.

  • Unity 6 (6000.3.x) with Linux Build Support (Mono) and Linux Dedicated Server Build Support, plus the module for your client platform.

  • Docker Desktop, running.

  • Clone the fork and open it in Unity.

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. Play locally first

Open the project in Unity 6, then Tools → Edgegap Server Hosting. Sign in with Edgegap (or paste a token from Get token) and Validate, then Build server. It lands in Builds/EdgegapServer/.

Containerize with Docker: image name purrnet-incremental, tag left empty (the plugin uses the current UTC time), default Dockerfile.

Test Your Server Locally: set Optional Docker Run Parameters to -p 7777:7777/udp, then Deploy local container.

The log shows Edgegap Server | Starting server on 0.0.0.0:7777. The plugin passes mock Edgegap variables, so the server exits 120 seconds after start if nobody joins, or 30 seconds after the last player leaves. Click Terminate before the next local run.

Build the client (File → Build Profiles, any desktop platform) and start it twice. Each window shows the connect panel with 127.0.0.1 and 7777. Click Connect in both. The server logs Edgegap Server | 2 player(s) connected.

3. Put the server on Edgegap

Still in the plugin window, select Upload to Edgegap:

Enter an Application Name, for example purrnet-incremental, then Upload image and Create app version.

The plugin pushes the image to your Edgegap registry, creates the application if needed, and opens the dashboard’s version form with the image and tag filled in.

Keep the version name the plugin proposes (the image tag).

Every build gets a new tag, never latest.

On the version form:

  • One port: replace the form’s default port with name gameport, 7777, UDP.

  • If the form asks for registry credentials, use the username and token from the Container Registry page, or deployments can’t pull the image.

4. Play on an Edgegap server

Select Deploy to cloud in the plugin (or Deploy on the version page). When the deployment is ready, note its host (<id>.pr.edgegap.net) and the external port of gameport. It changes on every deployment.

Start two clients, enter that host and port, and click Connect. Once both players leave, the server stops its own deployment after 30 seconds. Stop last deployment in the plugin stops it right away.

For scripted tests, clients can connect straight away from the command line:

Game.exe -screen-fullscreen 0 -edgegapAddress <id>.pr.edgegap.net -edgegapPort <external port> -edgegapConnect

5. Add it to your own PurrNet game

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

  1. The Edgegap Unity SDK. Packages/manifest.json adds com.edgegap.unity-sdk from its Git repository.

  2. A server that starts and stops on its own. Assets/Edgegap/EdgegapBootstrap.cs turns off PurrNet’s auto start in builds; EdgegapServerLifecycle.cs starts the server on port 7777 and stops the deployment when it’s empty.

  3. A client that connects to an address it gets at runtime. EdgegapConnectPanel.cs for direct connection, EdgegapMatchmakingClient.cs for Find Match. Or call FindMatch() from your own Play button.

  4. Server logic that doesn't need a host. An [ObserversRpc] that sets up server state needs runLocally: true. Without it, the Incremental sample's server never spawned a tree.

Then build, containerize and upload the server with the Edgegap Unity plugin, and create the app version as in step 3.

With your agent:

"Load the edgegap skill, then edgegap-purrnet. Using github.com/edgegap/netcode-game-sample-unity-purrnet-incremental as the reference, add the Edgegap bootstrap, server lifecycle, connect panel and matchmaking client to my PurrNet project, fix any ObserversRpc that sets up server state, and check it works locally with one server and two clients."

For each step in detail, by hand, see the PurrNet integration guide.

6. Turn on matchmaking (optional)

The matchmaker is off by default. Turn it on once direct connection works:

  1. In matchmaker-config.json, set application.name and version to your application and version.

  2. Dashboard → Matchmaker → Create Matchmaker → upload the file → Create and Start.

  3. In Assets/Edgegap/Resources/EdgegapSettings.asset, tick Use Edgegap Matchmaker, and paste the matchmaker's API URL and Auth Token. The Auth Token only allows matchmaking calls, so it's safe in the game client.

  4. Rebuild the client, start it twice and click Find Match in both. The status goes from searching to match found to joining to connected, both on the same server.

The casual profile matches 2 to 4 players. After 20 seconds it also accepts a single player, and tickets expire after 30 seconds. The lone-player case wasn’t tested: if no server comes in time, the panel shows “No match found in time, try again.” Test with two clients, or play alone by direct connection.

Shipping a new server build? In the plugin, Upload to Edgegap → Rebuild from Source builds, containerizes and pushes with a fresh tag; save the new app version, then in the matchmaker Stop → Edit application.version → Start. For CI, edgegap/deploy-action creates the new version from an existing one, smoke-tests it and promotes it.

To add matchmaking to your own PurrNet game, follow the PurrNet integration guide.

Known limits

  • Desktop only. The sample uses UDP, which browsers can't open. WebGL would need PurrNet's WebTransport and a WebSocket port with TLS Upgrade. Not tested.

  • Clients are trusted. As upstream, movement and harvesting are owned by the clients (PurrNet's permissive network rules). A competitive game should use stricter rules.

  • No join in progress. Players who arrive after a match starts aren't added to it (no backfill), and the server doesn't check the client's matchmaker ticket (MM_TICKET_IDS).

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

What was tested

Tested end to end on Edgegap on 15 October 2026 with Unity 6000.3.11f1, PurrNet v1.22.0-beta.11 (commit a311c06), the PurrNet UDPTransport and Edgegap Unity SDK 3.5.5. The fork pins both packages to these versions, so every clone builds the same code. On 29 October 2026 the server moved to port 7777 and to the Edgegap Unity plugin 3.2.1; the plugin build was checked in a local container, not yet on Edgegap with clients.

  • Direct connection: two players connected and played on the same Edgegap server.

  • Matchmaker: both players were matched onto the same server about 35 seconds after clicking Find Match.

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

Frequently Asked Questions

Questions about running PurrNet's Incremental sample on Edgegap.

Do I need matchmaking to run the PurrNet Incremental sample on Edgegap?

No. It's off by default: clients connect to a server's host and port. Turn on the Edgegap Matchmaker in the sample's settings asset when you want players to click Find Match instead.

Does the Edgegap fork change PurrNet's sample?

Only one line. ResourceSpawner.InitSeed gets runLocally: true, so a dedicated server spawns trees. Everything else lives in Assets/Edgegap/ and adds itself at runtime, so the scene isn't modified.

When does the sample's game server stop?

It stops its own Edgegap deployment 30 seconds after the last player leaves, or 120 seconds after it starts if nobody joins. You only pay while players are on it.

Can the PurrNet Incremental sample run in a browser?

Not yet. It uses UDP, which browsers can't open. A WebGL build would need PurrNet's WebTransport and a WebSocket port with TLS Upgrade on Edgegap, which hasn't been tested.

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.