Plugin Documentation

GameLiftHost
Amazon GameLift dedicated servers for Blueprints and C++

Run your Unreal Engine dedicated server on Amazon GameLift: process lifecycle, game and player sessions, FlexMatch backfill, health checks and fleet role credentials on managed EC2, container and Anywhere fleets, with the Amazon GameLift Server SDK for C++ included.

v1.0
UE 4.27 & 5.8
Win64 & Linux servers
Category Networking
Alpha XP

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

RequirementDetails
Unreal Engine4.27 and 5.8 (verified warning-free on both)
PlatformsWin64 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.
ModulesGameLiftHost (Runtime), GameLiftHostSdk (prebuilt Amazon GameLift Server SDK for C++ 5.6.1 in Source/ThirdParty)
DependenciesNo other plugins. OpenSSL and the SDK's other libraries are linked inside the SDK library.
AWSAn AWS account with Amazon GameLift. Fleet instances, data transfer and Anywhere computes are billed by AWS.

Installation

  1. Install GameLiftHost from Fab into your engine, or copy the GameLiftHost folder into your project's Plugins folder.
  2. Enable GameLiftHost in Edit > Plugins and restart the editor.
  3. Open Project Settings > Plugins > GameLiftHost. Enable Auto Init SDK (and Auto Process Ready) for the automatic mode, or call the nodes yourself.
  4. C++ only: add PublicDependencyModuleNames.Add("GameLiftHost"); to your Build.cs.
  5. Make sure your project has a dedicated server target (<Project>Server.Target.cs) and package it for Win64 or Linux.
Nothing runs on clientsThe SDK library is loaded and started only when a dedicated server calls Init SDK, so the same project can ship its game client with the plugin enabled.

Setting up Amazon GameLift

Managed EC2 fleet

  1. Package the dedicated server: Platforms > Linux (or Windows) with the Server target, Shipping or Development configuration.
  2. 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.
  3. Upload the packaged folder as a build:
    aws 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-1
    Use WINDOWS_2022 for a Win64 server.
  4. 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.
  5. When the fleet is active, game sessions are created by your backend or matchmaker and arrive in On Start Game Session.
PortProcess Ready with port 0 reports the settings' Default Port, or else the port the server's net driver really listens on, so -port= on the command line is all you need.

Anywhere fleet (testing on your own PC)

  1. 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"
  2. Register your PC as a compute. Note GameLiftServiceSdkEndpoint in 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
  3. 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
  4. Start the server with the values on the command line:
    MyGameServer.exe -log -port=7777 -GLHWebSocketUrl=wss://us-east-1.api.amazongamelift.com -GLHAuthToken=<token> -GLHFleetId=fleet-1234 -GLHHostId=DevPC
    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: pass -GLHAuthToken= as an extra editor launch argument or set it on the Init SDK node at runtime.
  5. Create a game session and a player session to join it:
    aws 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 player1
    Then open 127.0.0.1:7777 with the option PlayerSessionId=<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)

  1. Enable Auto Init SDK, Auto Process Ready and Auto Validate Players in the settings.
  2. On Begin Play get the GameLiftHost Subsystem and bind On Start Game Session.
  3. In the event read Game Session > Game Properties (for example map or mode), set up the match, then call Activate Game Session. Players can join from now on.
  4. Bind On Process Terminate: save results, tell players, then call Process Ending with Request Exit enabled.
  5. 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.

Use one of the twoDo not combine Auto Validate Players with your own Accept Player Session for the same players: a player session can only be accepted once.

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.

EventOutputsDescription
On Start Game Session EventGame SessionA game session was assigned to this process. Prepare it, then call Activate Game Session (or enable Auto Activate Game Session).
On Update Game Session EventGame Session, Reason, Backfill Ticket IdBackfill results: Matchmaking Data Updated (new players in Matchmaker Data), Backfill Failed, Backfill Timed Out or Backfill Cancelled.
On Process Terminate EventTermination 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).

NodeDescription
Init SDK CallConnects 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 CallReports 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 CallReports that the game session is ready for players.
Accept Player Session CallValidates a joining player's session id.
Remove Player Session CallFrees a player's slot when the player leaves.
Validate Player From Options CallReads 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 PureThe PlayerSessionId a connected player controller joined with.
Update Player Session Creation Policy CallAccept All or Deny All new player sessions for this game session.
Get Game Session Id PureId (ARN) of the hosted game session.
Get Current Game Session PureThe last game session received (start or update).
Get Termination Time PureUTC time the process will be stopped; false when nothing is scheduled.
Process Ending CallReports the end of the process. With Request Exit also destroys the SDK and asks the engine to exit.
Destroy SDK CallDisconnects and frees the SDK; Init SDK may be called again.
Set Health Status CallHealthy or not for the next health checks.
Is SDK Ready PureTrue after a successful Init SDK.
Get Host State PureNot Initialized, Initialized, Process Ready, Game Session Active or Process Ending.
Get SDK Version PureVersion of the included Amazon GameLift Server SDK (5.6.1).
Cancel CallOn 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.

NodeInputsOutputsDescription
Describe Player SessionsGame Session Id, Player Id, Player Session Id, Status Filter, Next Token, LimitOn 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 BackfillMatchmaking Configuration Arn, Players, Ticket Id, Game Session ArnOn 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 BackfillTicket Id, Matchmaking Configuration Arn, Game Session ArnOn 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 CredentialsRole Arn, Role Session NameOn 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

TypeKindMembers
FGameLiftHostGameSessionStructGame Session Id, Name, Fleet Id, Maximum Player Session Count, Ip Address, Dns Name, Port, Game Properties (map), Game Session Data, Matchmaker Data (JSON)
FGameLiftHostPlayerSessionStructPlayer Session Id, Player Id, Game Session Id, Fleet Id, Status, Ip Address, Dns Name, Port, Player Data, Creation Time, Termination Time
FGameLiftHostServerParametersStructWeb Socket Url, Auth Token, Fleet Id, Host Id, Process Id (Anywhere)
FGameLiftHostBackfillPlayerStructPlayer Id, Team, String Attributes, Number Attributes, Latency Ms
FGameLiftHostRoleCredentialsStructAccess Key Id, Secret Access Key, Session Token, Expiration, Assumed Role User Arn, Assumed Role Id
FGameLiftHostComputeCertificateStructCertificate Path, Compute Name
FGameLiftHostErrorStructCode, Message (Code empty = success)
EGameLiftHostStateEnumNot Initialized, Initialized, Process Ready, Game Session Active, Process Ending
EGameLiftHostUpdateReasonEnumUnknown, Matchmaking Data Updated, Backfill Failed, Backfill Timed Out, Backfill Cancelled
EGameLiftHostPlayerSessionStatusEnumNot Set, Reserved, Active, Completed, Timed Out
EGameLiftHostPlayerSessionPolicyEnumAccept All, Deny All

Settings

Project Settings > Plugins > GameLiftHost (saved to DefaultGame.ini).

SettingDefaultDescription
Allow Outside Dedicated ServerOffAlso allow the SDK in the editor and non-server builds (Anywhere testing with a Play In Editor dedicated server).
Auto Init SDKOffInit SDK as soon as the server world has started.
Auto Process ReadyOnWith Auto Init SDK: Process Ready right after it.
Auto Activate Game SessionOffActivate Game Session right after On Start Game Session.
Auto Validate PlayersOffAccept each remote player's PlayerSessionId after login, kick invalid players, remove the session on logout.
Process Ending On ShutdownOnProcess Ending + Destroy SDK when the game instance shuts down.
Exit On Process TerminateOffAfter On Process Terminate fired: Process Ending, Destroy SDK and exit.
Default Port0Port 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 LogOnSDK 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 codeCause and fix
NotAllowedInit SDK outside a dedicated server. Enable Allow Outside Dedicated Server to test in the editor.
SdkMissingThe SDK library could not be loaded. Check that Source/ThirdParty/GameLiftHostSdk was packaged with the server (Output Log, LogGameLiftHost).
NotInitializedCall Init SDK first (or enable Auto Init SDK).
WebSocketConnectForbiddenAnywhere: the auth token expired or does not match the fleet / compute. Get a new token; Process Id must be unique per run.
WebSocketInvalidUrlAnywhere: use the GameLiftServiceSdkEndpoint returned by register-compute.
ProcessNotReadyCall Process Ready before player calls.
UnexpectedPlayerSessionUnknown, already used or timed-out player session id. The client must get a new player session.
GameSessionIdNotSetNo game session yet: wait for On Start Game Session.
UnsupportedComputeTypeThe call is not available on this fleet type (for example fleet role credentials on Anywhere).
OwnedByOtherInstanceAnother game instance of the same process (Play In Editor) already initialized the SDK.
Health check failuresMake 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.