<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mindattic.com/wiki/docs/index.php?action=history&amp;feed=atom&amp;title=Unity.Multiplayer%2Farticles%2Fhosting%2Fgamelift</id>
	<title>Unity.Multiplayer/articles/hosting/gamelift - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mindattic.com/wiki/docs/index.php?action=history&amp;feed=atom&amp;title=Unity.Multiplayer%2Farticles%2Fhosting%2Fgamelift"/>
	<link rel="alternate" type="text/html" href="https://mindattic.com/wiki/docs/index.php?title=Unity.Multiplayer/articles/hosting/gamelift&amp;action=history"/>
	<updated>2026-12-05T14:51:37Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.3</generator>
	<entry>
		<id>https://mindattic.com/wiki/docs/index.php?title=Unity.Multiplayer/articles/hosting/gamelift&amp;diff=918&amp;oldid=prev</id>
		<title>Docs Sync: md2wiki: sync from MindAttic.Docs</title>
		<link rel="alternate" type="text/html" href="https://mindattic.com/wiki/docs/index.php?title=Unity.Multiplayer/articles/hosting/gamelift&amp;diff=918&amp;oldid=prev"/>
		<updated>2026-11-29T20:36:50Z</updated>

		<summary type="html">&lt;p&gt;md2wiki: sync from MindAttic.Docs&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Hosting on AWS GameLift (GameLift) =&lt;br /&gt;
&lt;br /&gt;
A managed-fleet profile (UM-T30), and the odd one out in this table in two ways at once: it is the only profile that is both provisioned once (a fleet that stays up, like GenericVps/RunPod/every UM-T26-T28 profile) &amp;lt;strong&amp;gt;and&amp;lt;/strong&amp;gt; allocated per match (like Edgegap/Gameye, UM-T29). mp-host&amp;#039;s &amp;lt;code&amp;gt;GameLiftProvisioner&amp;lt;/code&amp;gt; uploads your build and creates the fleet; &amp;lt;code&amp;gt;Unity.Multiplayer.Core.GameLiftMatchAllocator&amp;lt;/code&amp;gt; then creates one game session (and one player session per seat) per match on that fleet, same as every other &amp;lt;code&amp;gt;IMatchAllocator&amp;lt;/code&amp;gt; adapter. The fleet itself is never a Docker container -- GameLift&amp;#039;s classic EC2 fleets run the build&amp;#039;s executable directly.&lt;br /&gt;
&lt;br /&gt;
== Three pieces ==&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;strong&amp;gt;Runtime&amp;lt;/strong&amp;gt; -- &amp;lt;code&amp;gt;GameLiftServerHost&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;unity/.../Runtime/Hosting/GameLift&amp;lt;/code&amp;gt;) drives the GameLift Server SDK&amp;#039;s lifecycle: &amp;lt;code&amp;gt;InitSDK&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ProcessReady&amp;lt;/code&amp;gt; (with &amp;lt;code&amp;gt;OnStartGameSession&amp;lt;/code&amp;gt; calling &amp;lt;code&amp;gt;ActivateGameSession&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;OnProcessTerminate&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;OnHealthCheck&amp;lt;/code&amp;gt;), &amp;lt;code&amp;gt;AcceptPlayerSession&amp;lt;/code&amp;gt;/ &amp;lt;code&amp;gt;RemovePlayerSession&amp;lt;/code&amp;gt; as players join and leave, and &amp;lt;code&amp;gt;ProcessEnding&amp;lt;/code&amp;gt; on a clean shutdown. It is compiled in only when the GameLift Server SDK package is installed (it defines &amp;lt;code&amp;gt;MINDATTIC_GAMELIFT&amp;lt;/code&amp;gt;); &amp;lt;code&amp;gt;NetBootstrap&amp;lt;/code&amp;gt; attaches it automatically, right after &amp;lt;code&amp;gt;ServerHost&amp;lt;/code&amp;gt;, so a game adds nothing to its own code. Without the package installed, &amp;lt;code&amp;gt;GameLiftServerHost.Attach&amp;lt;/code&amp;gt; is a documented no-op and the exact same build still runs fine on every other host in this table.&lt;br /&gt;
# &amp;lt;strong&amp;gt;mp-host&amp;lt;/strong&amp;gt; -- &amp;lt;code&amp;gt;GameLiftProvisioner&amp;lt;/code&amp;gt; zips the &amp;lt;code&amp;gt;GameLift&amp;lt;/code&amp;gt;-profile server package (no Docker image: &amp;lt;code&amp;gt;IProvisioner.RequiresContainerImage&amp;lt;/code&amp;gt; is false for this one), uploads it as a GameLift build, waits for it to go &amp;lt;code&amp;gt;READY&amp;lt;/code&amp;gt;, then creates a fleet of EC2 instances running it plus a simple-routing alias. This is a one-time (or per-update) step, exactly like provisioning a VPS for GenericVps.&lt;br /&gt;
# &amp;lt;strong&amp;gt;Matchmaking&amp;lt;/strong&amp;gt; -- &amp;lt;code&amp;gt;GameLiftMatchAllocator&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;Unity.Multiplayer.Core&amp;lt;/code&amp;gt;) implements the UM-T29 &amp;lt;code&amp;gt;IMatchAllocator&amp;lt;/code&amp;gt; contract against the fleet mp-host created: &amp;lt;code&amp;gt;AllocateAsync&amp;lt;/code&amp;gt; starts a game session and waits for it to go &amp;lt;code&amp;gt;ACTIVE&amp;lt;/code&amp;gt;, publishing a join code the usual way; &amp;lt;code&amp;gt;CreatePlayerSessionAsync&amp;lt;/code&amp;gt; (beyond the shared &amp;lt;code&amp;gt;IMatchAllocator&amp;lt;/code&amp;gt; contract -- GameLift is the one provider here that needs a reservation per player before they connect) reserves a seat for one player.&lt;br /&gt;
&lt;br /&gt;
== Setting up the Unity side ==&lt;br /&gt;
&lt;br /&gt;
Install the GameLift Server SDK package in your project (from AWS&amp;#039;s GameLift SDK download, added as a local or Git package -- check the exact package id/version against what you installed and adjust &amp;lt;code&amp;gt;Unity.Multiplayer.asmdef&amp;lt;/code&amp;gt;&amp;#039;s &amp;lt;code&amp;gt;versionDefines&amp;lt;/code&amp;gt; entry if it differs from &amp;lt;code&amp;gt;com.amazonaws.gamelift@5.0.0&amp;lt;/code&amp;gt;, which is what this integration was written against). Once it&amp;#039;s installed, &amp;lt;code&amp;gt;MINDATTIC_GAMELIFT&amp;lt;/code&amp;gt; is defined automatically and &amp;lt;code&amp;gt;GameLiftServerHost&amp;lt;/code&amp;gt; activates itself -- nothing else to wire up.&lt;br /&gt;
&lt;br /&gt;
A player&amp;#039;s &amp;lt;code&amp;gt;ConnectionPayload.PlayerToken&amp;lt;/code&amp;gt; (the same field every profile already uses to give a reconnecting player its seat back) doubles as the GameLift player session id when running under GameLift: your matchmaker gets that id from &amp;lt;code&amp;gt;CreatePlayerSessionAsync&amp;lt;/code&amp;gt; below and must hand it to the player to send as their player token when they connect. &amp;lt;code&amp;gt;GameLiftServerHost&amp;lt;/code&amp;gt; reads it back off the connected client&amp;#039;s seat (&amp;lt;code&amp;gt;NetSession.TryGetSeat&amp;lt;/code&amp;gt;) to call &amp;lt;code&amp;gt;AcceptPlayerSession&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;RemovePlayerSession&amp;lt;/code&amp;gt; -- no new wire field, no change to connection approval.&lt;br /&gt;
&lt;br /&gt;
== Setting up mp-host ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;md-code&amp;quot;&amp;gt;mp-host credentials set-aws --access-key-id &amp;amp;lt;AKIA...&amp;gt; --secret-access-key &amp;amp;lt;secret&amp;gt; --region us-east-1&lt;br /&gt;
mp-host credentials set-cloud-options --profile GameLift --name my-fleet \&lt;br /&gt;
  --opt ec2InstanceType=c5.large --opt fleetType=ON_DEMAND --opt concurrentExecutions=1&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The AWS credential is shared with &amp;lt;code&amp;gt;AwsEc2&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;AwsLightsail&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;ec2InstanceType&amp;lt;/code&amp;gt; (default &amp;lt;code&amp;gt;c5.large&amp;lt;/code&amp;gt;) and &amp;lt;code&amp;gt;fleetType&amp;lt;/code&amp;gt; (default &amp;lt;code&amp;gt;ON_DEMAND&amp;lt;/code&amp;gt;; &amp;lt;code&amp;gt;SPOT&amp;lt;/code&amp;gt; is cheaper but can be reclaimed) are optional, same as every other launch option in this table. &amp;lt;code&amp;gt;concurrentExecutions&amp;lt;/code&amp;gt; (default &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;) is how many game-server processes run per instance; this provisioner only supports &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; cleanly, since more than one process per instance needs each to be launched with a distinct port and &amp;lt;code&amp;gt;GameLiftProvisioner&amp;lt;/code&amp;gt; does not attempt that -- a later extension if you need the extra density.&lt;br /&gt;
&lt;br /&gt;
Then build and deploy, from a &amp;lt;code&amp;gt;GameLift&amp;lt;/code&amp;gt;-profile Unity build (&amp;lt;code&amp;gt;MindAttic &amp;gt; Multiplayer &amp;gt; Build Server Package &amp;gt; GameLift&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;-serverProfile GameLift&amp;lt;/code&amp;gt; in batch mode):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;md-code&amp;quot;&amp;gt;mp-host deploy --profile GameLift --name my-fleet --package ./build/GameLift \&lt;br /&gt;
  --rendezvous-url n/a --public-address n/a&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(&amp;lt;code&amp;gt;--rendezvous-url&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;--public-address&amp;lt;/code&amp;gt; are required by mp-host&amp;#039;s shared argument parser for every profile, but GameLift ignores them: a matchmaker resolves each match&amp;#039;s join code directly from &amp;lt;code&amp;gt;GameLiftMatchAllocator&amp;lt;/code&amp;gt;, never through the rendezvous service. Pass any placeholder.) &amp;lt;code&amp;gt;--image&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;--tag&amp;lt;/code&amp;gt; are accepted but unused too, since there is no Docker image for this profile.&lt;br /&gt;
&lt;br /&gt;
Add &amp;lt;code&amp;gt;--dry-run&amp;lt;/code&amp;gt; first to see every GameLift API call (&amp;lt;code&amp;gt;CreateBuild&amp;lt;/code&amp;gt;, the S3 upload, &amp;lt;code&amp;gt;CreateFleet&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;CreateAlias&amp;lt;/code&amp;gt;, ...) mp-host would make, without spending anything. Build your package on a Linux or macOS Unity Editor (or CI runner) if you can -- zipping on Windows loses the Unix executable bit on &amp;lt;code&amp;gt;start.sh&amp;lt;/code&amp;gt;/the dedicated-server binary that the Linux fleet needs, though &amp;lt;code&amp;gt;GameLiftProvisioner&amp;lt;/code&amp;gt; compensates by marking those two files executable in the zip&amp;#039;s own metadata regardless of what bit the filesystem had, so a Windows-built package still works.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;mp-host status&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;logs&amp;lt;/code&amp;gt; work a little differently here: there is no single box to SSH into or container to tail, so &amp;lt;code&amp;gt;logs&amp;lt;/code&amp;gt; prints the fleet&amp;#039;s own activation/capacity/error events instead, and the deploy pipeline&amp;#039;s join-code wait always times out with a warning -- there is no &amp;quot;the&amp;quot; join code for a fleet, only one per game session once a matchmaker allocates one (see below). &amp;lt;code&amp;gt;mp-host update&amp;lt;/code&amp;gt; is a blue/green swap: it builds and uploads a new build, creates a new fleet from it, waits for &amp;lt;code&amp;gt;ACTIVE&amp;lt;/code&amp;gt;, then repoints your existing alias at the new fleet; the old fleet (and its build) are left running -- &amp;lt;code&amp;gt;mp-host destroy --server-id &amp;amp;lt;old serverId&amp;gt; --yes&amp;lt;/code&amp;gt; once you&amp;#039;ve confirmed the new one serves matches correctly. &amp;lt;code&amp;gt;mp-host destroy&amp;lt;/code&amp;gt; deletes the alias, fleet and build together.&lt;br /&gt;
&lt;br /&gt;
== Allocating a match ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;md-code lang-csharp&amp;quot;&amp;gt;var api = new HttpGameLiftApiClient(accessKeyId, secretAccessKey, region); // the AWS account mp-host used&lt;br /&gt;
var joinCodes = new RendezvousJoinCodeService(new RendezvousClient(rendezvousUrl), rendezvousSecret, serverAdvertisement: null);&lt;br /&gt;
var allocator = new GameLiftMatchAllocator(api, joinCodes, fleetId: &amp;quot;fleet-0123456789abcdef0&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
MatchAllocation allocation = await allocator.AllocateAsync(new MatchRequest(&amp;quot;match-42&amp;quot;, maxPlayers: 8));&lt;br /&gt;
// hand allocation.Code (or allocation.Endpoint) to players who already have a seat reserved below ...&lt;br /&gt;
&lt;br /&gt;
foreach (PlayerIdentity player in players)&lt;br /&gt;
{&lt;br /&gt;
    string playerSessionId = await allocator.CreatePlayerSessionAsync(allocation, player.PlayerToken);&lt;br /&gt;
    // tell this player to connect with PlayerToken = playerSessionId (overriding their usual reconnect token)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// ... match plays out; the server calls ProcessEnding itself (GameLiftServerHost) once it&amp;#039;s done ...&lt;br /&gt;
await allocator.ReleaseAsync(allocation); // revokes the join code; GameLift has no API to force the session to end&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;fleetId&amp;lt;/code&amp;gt; is what &amp;lt;code&amp;gt;mp-host deploy&amp;lt;/code&amp;gt; printed as part of its &amp;lt;code&amp;gt;serverId&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;GameLiftServerId.Split&amp;lt;/code&amp;gt;); pass an &amp;lt;code&amp;gt;aliasId&amp;lt;/code&amp;gt; instead when you want the allocator to keep working across an &amp;lt;code&amp;gt;mp-host update&amp;lt;/code&amp;gt;&amp;#039;s fleet swap without changing. Note &amp;lt;code&amp;gt;ReleaseAsync&amp;lt;/code&amp;gt; only revokes the join code -- GameLift has no API call to force a game session to end from the outside, only the server process itself (via &amp;lt;code&amp;gt;ProcessEnding&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;GameLiftServerHost&amp;lt;/code&amp;gt;) actually does that, so tell the game to wrap up on its own terms (your own RPC or admin command) rather than expecting &amp;lt;code&amp;gt;ReleaseAsync&amp;lt;/code&amp;gt; to kill it.&lt;br /&gt;
&lt;br /&gt;
== Cost notes ==&lt;br /&gt;
&lt;br /&gt;
GameLift bills three things: the EC2 instance-hours behind your fleet (the same on-demand/spot rates as plain EC2, plus a small per-vCPU-hour GameLift surcharge on top -- verify the current rate for your instance family against the [https://aws.amazon.com/gamelift/pricing/ GameLift pricing page]), data transfer out to players (the same roughly &amp;lt;strong&amp;gt;0.07 GB per player-hour&amp;lt;/strong&amp;gt; rule of thumb as the &amp;lt;code&amp;gt;aws-ec2.md&amp;lt;/code&amp;gt; guide, at EC2&amp;#039;s standard egress rate), and nothing extra for game/player sessions themselves -- those are free; you only pay for the fleet capacity they run on. Unlike Edgegap/Gameye, a GameLift fleet keeps costing money between matches the moment it is &amp;lt;code&amp;gt;ACTIVE&amp;lt;/code&amp;gt;, because the instances are provisioned up front, not spun up per match: size the fleet (instance type and count) for your expected concurrent match count, and &amp;lt;code&amp;gt;mp-host destroy&amp;lt;/code&amp;gt; a fleet you are not actively matchmaking onto, the same as you would any other always-on profile in this table. Verify GameLift&amp;#039;s current regions, instance families and build/fleet API shape against their live docs before depending on this for a public launch -- this is also why the real-provider smoke tests (&amp;lt;code&amp;gt;tests/Core.Tests/GameLiftSmokeTests.cs&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;tests/Hosting.Cli.Tests/Smoke/GameLiftSmokeTests.cs&amp;lt;/code&amp;gt;) are opt-in rather than part of every build.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;md2wiki-crumb&amp;quot;&amp;gt;Part of [[Unity.Multiplayer]].&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;md2wiki-source&amp;quot;&amp;gt;From [https://github.com/mindattic/Unity.Multiplayer/blob/main/docs/articles/hosting/gamelift.md Unity.Multiplayer/docs/articles/hosting/gamelift.md] via MindAttic.Docs; synced automatically, so edit the repo, not this page.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Unity.Multiplayer]]&lt;/div&gt;</summary>
		<author><name>Docs Sync</name></author>
	</entry>
</feed>