Overview
GameLiftHost connects an Unreal Engine 4.27 or 5.8 dedicated server to Amazon GameLift. The server reports that it is ready, receives game sessions, validates the players that join, follows FlexMatch backfill, answers health checks and shuts down cleanly when Amazon GameLift asks it to.
- Init SDK, Process Ready, Process Ending: the whole process lifecycle, or fully automatic from the project settings.
- On Start Game Session with id, name, fleet, maximum players, IP address, DNS name, port, game properties and matchmaker data; Activate Game Session.
- Validate Player From Options for Game Mode Pre Login, or automatic validation that kicks players without a valid player session.
- Start Match Backfill / Stop Match Backfill and On Update Game Session.
- On Health Check answered instantly from the last Set Health Status value; On Process Terminate with the termination time.
- Get Fleet Role Credentials (temporary AWS keys so the server can call other AWS services) and Get Compute Certificate.
SDK callbacks arrive on the game thread. Slow calls (player session queries, backfill, credentials, certificate) run on background threads as latent nodes.
Requirements
| Requirement | Details |
|---|---|
| Unreal Engine | 4.27 and 5.8 (verified warning-free on both) |
| Platforms | Win64 and Linux dedicated servers. The plugin compiles in every Win64 and Linux target (editor, client, server) but only starts the SDK in dedicated servers unless the settings allow it. |
| Modules | GameLiftHost (Runtime), GameLiftHostSdk (prebuilt Amazon GameLift Server SDK for C++ 5.6.1 in Source/ThirdParty) |
| Dependencies | No other plugins. OpenSSL and the SDK's other libraries are linked inside the SDK library. |
| AWS | An AWS account with Amazon GameLift. Fleet instances, data transfer and Anywhere computes are billed by AWS. |
Installation
- Install GameLiftHost from Fab into your engine, or copy the
GameLiftHostfolder into your project'sPluginsfolder. - Enable GameLiftHost in Edit > Plugins and restart the editor.
- Open Project Settings > Plugins > GameLiftHost. Enable Auto Init SDK (and Auto Process Ready) for the automatic mode, or call the nodes yourself.
- C++ only: add
PublicDependencyModuleNames.Add("GameLiftHost");to yourBuild.cs. - Make sure your project has a dedicated server target (
<Project>Server.Target.cs) and package it for Win64 or Linux.
Setting up Amazon GameLift
Managed EC2 fleet
- Package the dedicated server: Platforms > Linux (or Windows) with the Server target, Shipping or Development configuration.
- In the project settings enable Auto Init SDK and Auto Process Ready (or call Init SDK with an empty Anywhere struct and Process Ready once the map is loaded). On managed fleets every connection value comes from the environment.
- Upload the packaged folder as a build:
Useaws gamelift upload-build --name MyGame --build-version 1.0 --build-root "C:/Packaged/LinuxServer" --operating-system AMAZON_LINUX_2023 --server-sdk-version 5.6.1 --region us-east-1WINDOWS_2022for a Win64 server. - Create a fleet from the build. Launch path
/local/game/MyGame/Binaries/Linux/MyGameServer(Windows:C:\game\MyGame\Binaries\Win64\MyGameServer.exe) with parameters-log -port=7777. For several server processes per instance give each its own port (-port=7777,-port=7778, ...) and open the UDP port range in the fleet's inbound permissions. - When the fleet is active, game sessions are created by your backend or matchmaker and arrive in On Start Game Session.
-port= on the command line is all you need.Anywhere fleet (testing on your own PC)
- Create a custom location and an Anywhere fleet:
aws gamelift create-location --location-name custom-devpc aws gamelift create-fleet --name MyGameDev --compute-type ANYWHERE --locations "Location=custom-devpc" - Register your PC as a compute. Note
GameLiftServiceSdkEndpointin the answer (the WebSocket URL):aws gamelift register-compute --compute-name DevPC --fleet-id fleet-1234 --ip-address 127.0.0.1 --location custom-devpc - Get an auth token (short-lived: get a new one for every run):
aws gamelift get-compute-auth-token --fleet-id fleet-1234 --compute-name DevPC - Start the server with the values on the command line:
Or from the editor: fill Anywhere Web Socket Url / Fleet Id / Host Id in the settings, enable Allow Outside Dedicated Server, and play with Net Mode: Play As Client (the in-editor dedicated server initializes the SDK). The auth token is never saved: passMyGameServer.exe -log -port=7777 -GLHWebSocketUrl=wss://us-east-1.api.amazongamelift.com -GLHAuthToken=<token> -GLHFleetId=fleet-1234 -GLHHostId=DevPC-GLHAuthToken=as an extra editor launch argument or set it on the Init SDK node at runtime. - Create a game session and a player session to join it:
Then openaws gamelift create-game-session --fleet-id fleet-1234 --location custom-devpc --maximum-player-session-count 4 aws gamelift create-player-session --game-session-id <game session arn> --player-id player1127.0.0.1:7777with the optionPlayerSessionId=<id>from a game client.
Fleet role for Get Fleet Role Credentials
Create the fleet with --instance-role-arn pointing at an IAM role that Amazon GameLift may assume, and give the role only the permissions your server needs (for example one DynamoDB table or one S3 prefix). Trust policy of the role:
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Principal": { "Service": "gamelift.amazonaws.com" },
"Action": "sts:AssumeRole"
}]
}
Get Fleet Role Credentials with that role ARN returns temporary keys for any AWS SDK or signed HTTP request. It works on managed EC2 and container fleets (not on Anywhere computes).
Quick start
Blueprint (Game Instance or Game Mode)
- Enable Auto Init SDK, Auto Process Ready and Auto Validate Players in the settings.
- On Begin Play get the GameLiftHost Subsystem and bind On Start Game Session.
- In the event read Game Session > Game Properties (for example
mapormode), set up the match, then call Activate Game Session. Players can join from now on. - Bind On Process Terminate: save results, tell players, then call Process Ending with Request Exit enabled.
- When the match is over call Process Ending with Request Exit as well: Amazon GameLift starts a fresh process for the next game session.
Manual order
Init SDK → Process Ready → On Start Game Session → Activate Game Session → Accept Player Session per joining player → Remove Player Session per leaving player → Process Ending → exit.
Validating players
Every player gets a player session (id psess-...) from Amazon GameLift before connecting and sends it in the join options. The server accepts it once; unknown, reused or expired ids are rejected. Reserved player sessions time out if the player does not connect within 60 seconds.
C++ Game Mode: Pre Login
#include "GameLiftHostSubsystem.h"
void AMyGameMode::PreLogin(const FString& Options, const FString& Address, const FUniqueNetIdRepl& UniqueId, FString& ErrorMessage)
{
Super::PreLogin(Options, Address, UniqueId, ErrorMessage);
UGameLiftHostSubsystem* GameLift = GetGameInstance()->GetSubsystem<UGameLiftHostSubsystem>();
if (ErrorMessage.IsEmpty() && GameLift && GameLift->IsSdkReady())
{
FString PlayerSessionId;
GameLift->ValidatePlayerFromOptions(Options, PlayerSessionId, ErrorMessage); // non-empty ErrorMessage rejects the join
}
}
void AMyGameMode::Logout(AController* Exiting)
{
UGameLiftHostSubsystem* GameLift = GetGameInstance()->GetSubsystem<UGameLiftHostSubsystem>();
const FString PlayerSessionId = UGameLiftHostSubsystem::GetPlayerSessionId(Cast<APlayerController>(Exiting));
if (GameLift && !PlayerSessionId.IsEmpty())
{
FGameLiftHostError Error;
GameLift->RemovePlayerSession(PlayerSessionId, Error);
}
Super::Logout(Exiting);
}
Blueprint-only projects
Pre Login cannot be overridden in Blueprint. Enable Auto Validate Players: right after a remote player logs in the plugin reads PlayerSessionId from the join URL, accepts it, and kicks the player with the error text when it is missing or invalid. The player session is removed again when the player leaves. Get Player Session Id returns the id of any connected player controller.
Game clients
GameLiftHost is the server half. The game client needs a player session and the address of the game session, which come from Amazon GameLift's client-side APIs (StartMatchmaking, StartGameSessionPlacement, CreateGameSession, CreatePlayerSession) - called from your own backend, or from a game-client matchmaking / session plugin. Any of them works with this plugin as long as the client finally joins with:
Open Level (by Name): Level Name = "<IpAddress or DnsName>:<Port>" Options = "PlayerSessionId=<psess-...>"
C++: PlayerController->ClientTravel(TEXT("203.0.113.10:7777?PlayerSessionId=psess-1234"), TRAVEL_Absolute);
Matchmaking with FlexMatch delivers the teams and player attributes to the server in Game Session > Matchmaker Data (JSON). Use them to place players in teams and, when players leave, to call Start Match Backfill.
Events
Bind them on the GameLiftHost Subsystem (Get GameLiftHost Subsystem). They always fire on the game thread.
| Event | Outputs | Description |
|---|---|---|
| On Start Game Session Event | Game Session | A game session was assigned to this process. Prepare it, then call Activate Game Session (or enable Auto Activate Game Session). |
| On Update Game Session Event | Game Session, Reason, Backfill Ticket Id | Backfill results: Matchmaking Data Updated (new players in Matchmaker Data), Backfill Failed, Backfill Timed Out or Backfill Cancelled. |
| On Process Terminate Event | Termination Time (UTC) | Amazon GameLift will stop the process (scale-in, spot interruption, fleet update). End the match and call Process Ending with Request Exit. |
| On Health Check Event | - | Fires about once a minute. The SDK is answered at once with the last Set Health Status value (default healthy); call Set Health Status to change the following answers. |
Functions
Members of the GameLiftHost Subsystem. Calls that can fail return true/false and an Error (Code + Message).
| Node | Description |
|---|---|
| Init SDK Call | Connects to Amazon GameLift. Anywhere empty = managed fleet (environment). For Anywhere fill Web Socket Url, Auth Token, Fleet Id, Host Id (Process Id is generated when empty); empty fields fall back to the command line, then the settings. |
| Process Ready Call | Reports that the process can host a game session. Port 0 = Default Port, then the listen port. Log Paths empty = the settings, then the engine log file. |
| Activate Game Session Call | Reports that the game session is ready for players. |
| Accept Player Session Call | Validates a joining player's session id. |
| Remove Player Session Call | Frees a player's slot when the player leaves. |
| Validate Player From Options Call | Reads PlayerSessionId from Pre Login options (or a join URL) and accepts it; returns the id and an error message for Pre Login. |
| Get Player Session Id Pure | The PlayerSessionId a connected player controller joined with. |
| Update Player Session Creation Policy Call | Accept All or Deny All new player sessions for this game session. |
| Get Game Session Id Pure | Id (ARN) of the hosted game session. |
| Get Current Game Session Pure | The last game session received (start or update). |
| Get Termination Time Pure | UTC time the process will be stopped; false when nothing is scheduled. |
| Process Ending Call | Reports the end of the process. With Request Exit also destroys the SDK and asks the engine to exit. |
| Destroy SDK Call | Disconnects and frees the SDK; Init SDK may be called again. |
| Set Health Status Call | Healthy or not for the next health checks. |
| Is SDK Ready Pure | True after a successful Init SDK. |
| Get Host State Pure | Not Initialized, Initialized, Process Ready, Game Session Active or Process Ending. |
| Get SDK Version Pure | Version of the included Amazon GameLift Server SDK (5.6.1). |
| Cancel Call | On a latent node's return value: none of its pins fire any more. |
Latent nodes
These calls wait for Amazon GameLift, so they run on a background thread and fire exactly one final pin on the game thread.
| Node | Inputs | Outputs | Description |
|---|---|---|---|
| Describe Player Sessions | Game Session Id, Player Id, Player Session Id, Status Filter, Next Token, Limit | On Success / On Failure (Player Sessions, Next Token, Error) | Give one id; all empty = the current game session. Status Filter: RESERVED, ACTIVE, COMPLETED or TIMEDOUT. Up to 50 per page. |
| Start Match Backfill | Matchmaking Configuration Arn, Players, Ticket Id, Game Session Arn | On Success / On Failure (Ticket Id, Error) | Players = everyone still in the match with their attributes and latencies (up to 40 players, 10 attributes and 20 regions each). New players arrive in On Update Game Session. |
| Stop Match Backfill | Ticket Id, Matchmaking Configuration Arn, Game Session Arn | On Success / On Failure (Ticket Id, Error) | Cancels a backfill request. |
| Get Compute Certificate | - | On Success / On Failure (Certificate, Error) | Path of the TLS certificate (PEM) and the host name it was issued for. The fleet needs certificate generation enabled. |
| Get Fleet Role Credentials | Role Arn, Role Session Name | On Success / On Failure (Credentials, Error) | Temporary access key, secret key, session token and expiration of an IAM role shared with the fleet. Request new ones before Expiration. |
C++ API
// Build.cs: PublicDependencyModuleNames.Add("GameLiftHost");
#include "GameLiftHostSubsystem.h"
UGameLiftHostSubsystem* GameLift = GetGameInstance()->GetSubsystem<UGameLiftHostSubsystem>();
GameLift->OnStartGameSession.AddDynamic(this, &AMyGameMode::HandleGameSession);
FGameLiftHostError Error;
if (GameLift->InitSdk(FGameLiftHostServerParameters(), Error) && GameLift->ProcessReady(0, TArray<FString>(), Error))
{
// waiting for a game session
}
// Background calls: the callback runs on the game thread, Error.Code is empty on success.
UGameLiftHostSubsystem::GetFleetRoleCredentialsAsync(TEXT("arn:aws:iam::123456789012:role/MyGameServer"), FString(),
FGameLiftHostNativeCredentials::CreateLambda([](const FGameLiftHostRoleCredentials& Credentials, const FGameLiftHostError& Error)
{
}));
Also available: DescribePlayerSessionsAsync, StartMatchBackfillAsync, StopMatchBackfillAsync, GetComputeCertificateAsync, ResolveServerPort and IsHostingAllowed.
Types
| Type | Kind | Members |
|---|---|---|
| FGameLiftHostGameSession | Struct | Game Session Id, Name, Fleet Id, Maximum Player Session Count, Ip Address, Dns Name, Port, Game Properties (map), Game Session Data, Matchmaker Data (JSON) |
| FGameLiftHostPlayerSession | Struct | Player Session Id, Player Id, Game Session Id, Fleet Id, Status, Ip Address, Dns Name, Port, Player Data, Creation Time, Termination Time |
| FGameLiftHostServerParameters | Struct | Web Socket Url, Auth Token, Fleet Id, Host Id, Process Id (Anywhere) |
| FGameLiftHostBackfillPlayer | Struct | Player Id, Team, String Attributes, Number Attributes, Latency Ms |
| FGameLiftHostRoleCredentials | Struct | Access Key Id, Secret Access Key, Session Token, Expiration, Assumed Role User Arn, Assumed Role Id |
| FGameLiftHostComputeCertificate | Struct | Certificate Path, Compute Name |
| FGameLiftHostError | Struct | Code, Message (Code empty = success) |
| EGameLiftHostState | Enum | Not Initialized, Initialized, Process Ready, Game Session Active, Process Ending |
| EGameLiftHostUpdateReason | Enum | Unknown, Matchmaking Data Updated, Backfill Failed, Backfill Timed Out, Backfill Cancelled |
| EGameLiftHostPlayerSessionStatus | Enum | Not Set, Reserved, Active, Completed, Timed Out |
| EGameLiftHostPlayerSessionPolicy | Enum | Accept All, Deny All |
Settings
Project Settings > Plugins > GameLiftHost (saved to DefaultGame.ini).
| Setting | Default | Description |
|---|---|---|
| Allow Outside Dedicated Server | Off | Also allow the SDK in the editor and non-server builds (Anywhere testing with a Play In Editor dedicated server). |
| Auto Init SDK | Off | Init SDK as soon as the server world has started. |
| Auto Process Ready | On | With Auto Init SDK: Process Ready right after it. |
| Auto Activate Game Session | Off | Activate Game Session right after On Start Game Session. |
| Auto Validate Players | Off | Accept each remote player's PlayerSessionId after login, kick invalid players, remove the session on logout. |
| Process Ending On Shutdown | On | Process Ending + Destroy SDK when the game instance shuts down. |
| Exit On Process Terminate | Off | After On Process Terminate fired: Process Ending, Destroy SDK and exit. |
| Default Port | 0 | Port reported by Process Ready with port 0. 0 = the net driver's listen port. |
| Log Paths | (empty) | Files uploaded when the process ends (up to 10). Empty = the engine log file. |
| Forward Sdk Log | On | SDK log lines go to LogGameLiftHost. |
| Anywhere Web Socket Url / Fleet Id / Host Id | (empty) | Anywhere defaults. Web Socket Url empty = managed fleet. The auth token is never saved. |
Command line overrides (Anywhere): -GLHWebSocketUrl=, -GLHAuthToken=, -GLHFleetId=, -GLHHostId=, -GLHProcessId=.
Troubleshooting
| Error code | Cause and fix |
|---|---|
NotAllowed | Init SDK outside a dedicated server. Enable Allow Outside Dedicated Server to test in the editor. |
SdkMissing | The SDK library could not be loaded. Check that Source/ThirdParty/GameLiftHostSdk was packaged with the server (Output Log, LogGameLiftHost). |
NotInitialized | Call Init SDK first (or enable Auto Init SDK). |
WebSocketConnectForbidden | Anywhere: the auth token expired or does not match the fleet / compute. Get a new token; Process Id must be unique per run. |
WebSocketInvalidUrl | Anywhere: use the GameLiftServiceSdkEndpoint returned by register-compute. |
ProcessNotReady | Call Process Ready before player calls. |
UnexpectedPlayerSession | Unknown, already used or timed-out player session id. The client must get a new player session. |
GameSessionIdNotSet | No game session yet: wait for On Start Game Session. |
UnsupportedComputeType | The call is not available on this fleet type (for example fleet role credentials on Anywhere). |
OwnedByOtherInstance | Another game instance of the same process (Play In Editor) already initialized the SDK. |
| Health check failures | Make sure the game thread keeps running; On Health Check needs no answer unless you want to report unhealthy. |
Credits
© 2026 Alpha XP — alphaxp.net · Support: support@alphaxp.net. Includes the Amazon GameLift Server SDK for C++ 5.6.1 (Apache License 2.0) with asio (Boost Software License 1.0), websocketpp (BSD-3-Clause), RapidJSON (MIT), spdlog and fmt (MIT), concurrentqueue (Simplified BSD / Boost Software License) and OpenSSL 1.1.1 (OpenSSL License). Built and verified for Unreal Engine 4.27 and 5.8.