This guide is specifically designed for technical teams migrating from Hathora Cloud to AccelByte Multiplayer Servers (AMS). It maps the core API concepts and outlines the code-level changes required for a successful transition.
1. Architectural Concept Mapping
While both platforms are container-native orchestrators, they use different terminology for similar resources.
|
Hathora |
AccelByte AMS Equivalent |
Description |
|
App |
Namespace |
The logical boundary for your game environment. |
|
Build |
Image |
The uploaded game server files. AMS calls this an "Image," but it is not a container image in the traditional sense — it is the raw server build, downloaded by the watchdog at runtime. |
|
Fleet + Deployment |
Fleet |
These two Hathora concepts collapse into one in AMS. A Fleet in AMS is bound to a specific Image at creation — the Image is immutable and cannot be changed later. To roll out a new version, you create a new Fleet (often cloned) with the updated Image, then retire the old one. |
|
Room |
Session |
A single running match or game session. |
|
Process |
Dedicated Server (DS) |
The individual running instance of your game server. |
2. Step-by-Step Migration Workflow
Step 1: Integrating with the Watchdog
In AMS, the server communicates with a local agent called the Watchdog.
The SDK: Use the AGS Game SDK (Unity or Unreal Engine plugins), which automatically takes care of connecting to the watchdog and periodic heartbeats
The Ready Signal: signal the watchdog when the server is done with any initialization or preparation work and is ready to be allocated to a game session.
Details: See the Code-Level Changes section for specific implementation examples and required launch arguments.
Step 2: Build & Upload
Step 3: Infrastructure Configuration
Create and configure your Fleets in the Admin Portal.
The primary difference in scaling logic is how the platforms handle capacity. Hathora relies on resource utilization (vCPU), whereas AMS uses a Buffer system for more predictable availability.
Reference: For a deep dive into regional settings and instance types, see Create fleets to deploy dedicated servers.
3) Code-Level Changes
A. Launch Arguments & Port Discovery
Hathora injects connection details via environment variables (e.g., HATHORA_DEFAULT_PORT) or their GetConnectionInfo API. In contrast, AMS uses argument substitution to pass data directly to your server executable at startup.
AMS Launch Logic: In the Admin Portal, you configure the launch command using placeholders like ${default_port} and ${dsid}. AMS replaces these with actual values when the server instance spins up.
# ${dsid} and ${port} are placeholders which AMS will replace at runtime.
# Add engine-specific flags as needed (e.g., -log for Unreal Engine).
./MyServer.exe -dsid=${dsid} -port=${default_port}
B. Implementing the "Ready" Signal
Your server must notify the AMS Watchdog once it has finished loading assets and is ready to accept player connections.
Hathora (SDK):
import { HathoraCloud } from "@hathora/cloud-sdk-typescript";
// Hathora detects readiness via the container status or custom health checks
AMS (AGS Game SDK):
For AccelByte, you must explicitly call the "Ready" message. Below are the standard snippets for Unity and Unreal:
AccelByteSDK.GetServerRegistry().GetAMS().SendReadyMessage();
AccelByteOnlineSubsystemPtr->GetServerApiClient()->ServerAMS.SendReadyMessage();
Full Integration Guide: For detailed setup instructions and additional engine-specific logic, refer to the Integrate Dedicated Servers with the SDK documentation.
C. The Claiming Flow (Backend Side)
The way you connect a player to a server changes.
Claim Endpoint (Custom Backends Only):
Integration Resources:
4) Lifecycle Comparison
In AMS, the Watchdog manages the server lifecycle based on specific states. Unlike Hathora, which often relies on external health checks, AMS relies on messages from the game server to explicitly communicate its readiness status via the AGS Game SDK.
|
State |
Hathora Behavior |
AMS Watchdog Behavior |
|
Startup |
Container starts. |
Server starts in Creating state. |
|
Readiness |
Determined by health check. |
Server calls Ready via SDK. State moves to Ready. |
|
Allocation |
createRoom called. |
The backend calls Claim. State moves to In Session. |
|
Termination |
Process exits or is killed. |
Server process exits or is killed |
Drain Handling
When a fleet is updated or scaled in, AMS sends a Drain signal. To prevent players from being kicked mid-match, your server should listen for this signal, finish the current session, and then exit gracefully.
AccelByteSDK.GetServerRegistry().GetAMS().OnDrainReceived += () => {
// finish current match, stop accepting new players, then exit
};
AccelByteInstance->GetServerApiClient()->ServerAMS
.AddOnAMSDrainReceivedMulticastDelegate(
ServerAMS::FOnAMSDrainReceived::CreateLambda([&]() {
// if in session, finish the session and exit, else cleanup and exit right away
}));
Integration Resources:
5) Summary Checklist
Validation Tip: Run your server locally with the AMS Local Watchdog simulator (available in the AccelByte docs) to test the heartbeat logic before uploading to the cloud.