Overview
Integrate Nakama matchmaking with i3D.net to spin up dedicated servers on demand. This guide shows how to set up the Arcus SDK on your headless server, configure the Nakama i3D fleet manager, wire matchmaker callbacks so players get connection details automatically, and manage the session lifecycle.
Prerequisites
Before you begin, make sure you have:
- An i3D.net account with registered hosts and an uploaded game server binary.
- A running Nakama server (self-hosted or Heroic Cloud).
- The Arcus SDK for your platform (Unity, Unreal, or C++).
- Go 1.23.5+ for server development.
Architecture overview #
The Nakama–i3D integration uses i3D.net’s One API to allocate servers. When players are matched, the plugin:
- Requests a server allocation from i3D.net.
- Waits for the server to report ready via Arcus.
- Notifies players with connection details.
- Manages the server lifecycle through status updates.
Install the Nakama–i3D plugin #
This guide assumes you already have a Nakama Go runtime project and know how to host a Nakama instance (for example, on Heroic Cloud). The plugin implements Nakama’s Fleet Manager interface for i3D.net and is available as an open‑source module.
Install the plugin #
Add the i3D fleet manager to your Nakama Go module:
| |
Register the fleet manager and matchmaker callback #
Create and register the fleet manager in InitModule:
| |
Create a headless game server #
Your dedicated server must implement the Arcus protocol so i3D.net and Nakama can track status and readiness. This section covers what the integration needs. Use your networking library’s docs for gameplay sync (Nakama authoritative matches, NGO, Mirror, etc.).
Unity #
- Download and import the Unity Arcus SDK.
- Initialize Arcus in your server bootstrap scene or script.
Unreal Engine #
- Install the Unreal Arcus plugin.
- Initialize the Arcus subsystem in your server
GameMode/module.
C++ #
- Follow the C++ integration guide and link the Arcus library.
- Initialize the Arcus client during server startup.
Minimal initialization (Unity) #
| |
Maintain state synchronization #
Arcus keeps state synchronized between your servers and Nakama:
- Servers report readiness before players connect.
- Metadata (map, mode, etc.) from Nakama is passed to the server.
- Lifecycle is coordinated through status updates.
Arcus status lifecycle #
Your server drives state transitions so allocation and player joins are coordinated.
| Status | Name | Meaning |
|---|---|---|
| 0 | Inactive | Not participating. |
| 1 | Setup | Preparing environment. |
| 2 | Starting | Initializing the game server. |
| 3 | Ready | Internal setup; switch to Online (4) when initialization completes. |
| 4 | Online | Available for allocation or reallocation. |
| 5 | Allocated | Reserved for a session; accept players. |
| 6 | Allocating | Allocation in progress; failed allocs trigger server restart. |
Configure i3D services #
Configure via environment variables (recommended) or a local.yml file mounted in your Nakama data directory.
Environment variables #
Set these variables in your Nakama deployment:
| Variable | Required | Description | Default |
|---|---|---|---|
| I3D_APPLICATION_ID | true | i3D application (game) ID | |
| I3D_ACCESS_TOKEN | true | One API token | |
| I3D_USE_BEARER_AUTH | false | Use OAuth2 M2M bearer auth (true/false) | false |
| I3D_CLIENT_ID | Cond. | OAuth2 client ID (when bearer auth enabled) | |
| I3D_CLIENT_SECRET | Cond. | OAuth2 client secret | |
| I3D_AUDIENCE | Cond. | OAuth2 audience | |
| I3D_AUTHENTICATION_URL | Cond. | OAuth2 token URL | |
| I3D_API_URL | false | One API base URL | https://api.i3d.net |
| I3D_RETRY_ATTEMPTS | false | Retry count for allocation requests | 3 |
| I3D_RETRY_DELAY | false | Initial retry backoff (e.g., 1500ms) | 1500ms |
| I3D_RETRY_MAX_DELAY | false | Max backoff delay (e.g., 7500ms) | 7500ms |
Authentication Setup #
Basic Authentication #
For basic authentication, you only need:
I3D_APPLICATION_ID: Your application ID from i3D.netI3D_ACCESS_TOKEN: Your API access token
M2M OAuth2 Authentication #
For enhanced security using OAuth2:
- Set
I3D_USE_BEARER_AUTH=true - Provide your OAuth2 credentials:
I3D_CLIENT_IDI3D_CLIENT_SECRETI3D_AUDIENCEI3D_AUTHENTICATION_URL
Implement matchmaking #
Handle matchmaker events #
Allocate a server when players are matched:
| |
Use allocation filters #
Filter allocations by fleet, region, build, and more:
| |
Available filters #
deploymentEnvironmentId/deploymentEnvironmentNamefleetId/fleetNamehostIdapplicationBuildId/applicationBuildNamedcLocationId/dcLocationNameregionId/regionName
Advanced features #
Health check RPC #
Register a basic health check endpoint:
| |
List active sessions #
Query active game sessions (occupied servers only):
| |
Best practices #
Server lifecycle management #
- Exit after game completion. After players leave, exit the server process. i3D.net restarts it with fresh ports for a clean state.
- Validate connections. Use Arcus to ensure players connect only when the server is ready.
Performance optimization #
- Tune retries. Set retry attempts and delays to meet your latency targets.
- Allocate by region. Use region filters to place servers near players.
- Monitor allocation times. Use the health check RPC and logs to track fleet manager performance.
Limitations #
- List returns only occupied servers. i3D.net focuses on allocation, not session persistence.
- Latency-based allocation isn’t automatic. Implement your own selection logic using region filters.
- Join only validates capacity against
maxPlayers. Player management is handled between clients and game servers.
FAQ #
My game server isn’t receiving metadata from Nakama
Verify your server initializes the Arcus protocol correctly. Check the Arcus SDK docs for your platform.
Players can’t connect to the allocated server
Verify that:
- The server sets status to Allocated (5) before accepting connections.
- The correct ports are configured in your i3D.net deployment.
- Network rules allow player connections.
How do I handle server crashes?
Exit with a non‑zero code other than 134 to trigger an automatic restart. If the server fails to start three times, i3D.net removes the instance. Check the portal for crash logs.
Can I reuse servers for multiple sessions?
Yes. Set status to Online (4) after a game completes. For a clean state, prefer exiting the process.
How do I implement region‑based matchmaking?
Use region filters when creating sessions to place players in their preferred regions. Combine with Nakama matchmaker properties for best results.
