Matthew Odle

Amazon Game Lift: Day One

I’m working on getting back into using AWS tools, and ran across their game hosting tool: Game Lift. It has support for Unity 2019. We’re hosting a game, yo.

Bullets from main tutorial:

  • Each version of your game server is called a build
  • Game servers are deployed into fleets of one or more Amazon EC2 instances (this takes a while)
    • There also seems to be a hard limit of one instance for free (?) tier (Error! Cannot generate the fleet. Reason: Current limit of instance type of c5.large have been reached..)
  • A game client needs to be downloaded (looks like an .exe, back to Windows we go)
  • The client needs to be connected to the server to play the game
  • View the server performance

Fun fact: spinning up a fleet on Linux, then moving to Windows to do the same was not a great idea; limits have been reached. Now to dig around to find where the fleet is so I can nuke it.

Fleets can be seen by clicking the dropdown next to ‘Amazon GameLift’ which has a bunch of options. Fleet lets me see the fleet created by the ‘Custom game server sample’. Other interesting bits are: Builds and Dashboard Builds now has my ‘somegame’ (Linux) and ‘test-server’ (Windows). ‘somegame’ has the fleet assigned. I want to unassign it, and possibly nuke the fleet.

I’m choosing to nuke the build entirely so I can get the full experience of the ‘Custom game server sample’. I’m also nuking the fleet.

While I was flailing with that, I noticed on the ‘Builds’ page that there are some sample aws CLI commands. I’ve poked at the aws CLI before; it might even still be set up.

1
aws gamelift upload-build --name <your build name> --build-version <your build number> --build-root <local build path> --operating-system WINDOWS_2012 --region us-west-2

Now that the fleet is active (that took about 10 minutes), I can take some actions on it. I see ‘Edit fleet’ and ‘Terminate fleet’. I suspected Edit would let me assign it to my new build, but the option is not standing out, so I’m going to just terminate it. I’m not sure how the server sample page would behave if I reassign it behind the scenes anyway.

The delete takes quite a while. Firing up Unity while I wait.


Fleet delete took about 10 minutes.

Back to server sample, new fleet is creating.

Game client download step is next, 115 MB zip file.

Now we’re on to connection steps. There’s a launcher to run, a token to generate, and a time limit to enter that token into the client (1 minute). Nice of them to not allow me to generate the token until the fleet has been built.

After connection, I’ll be able to see player connections, builds, fleets, and server performance. There are some cleanup handlers: after 4 hours of no player activity, the resources will scale to 0, and after 6 months of no activity and no capacity, the fleet will terminate and the build will be deleted. That’s nice of you, AWS (I mean that). Later: Except there’s no grace period at all. I’ve now got a bill for $0.88 for going through the tutorial ($0.219 per fleet per hour). No thanks.

Launched the client. Oh! It’s lumberyard! I’ve heard of this. It’s an AWS game engine.

The token is just some JSON. The game loaded up right away, and I’m driving around a little robot! It’s some kind of robot soccer game. “Generate additional tokens to connect up to eight sample game clients at one time.” I’ll have to try this with the kids.

Update: unfortunately, I am unable to install the Lumberyard game engine due to my small SSD C drive. According to the docs it will require 60GB. There is an option to change the install path, but during installation, the installer is downloading and expanding files onto the C drive (why?!), even though the target directory is the E drive. The tips for cleaning up space are unhelpful, since the SSD is not very large and has Windows taking up most of the space. The tip for repointing the env vars to E:/TEMP simply does not work. My only recourse is to reformat my disks to make the 1TB E drive the C drive instead, which I will not be doing.

Worse, the failed install didn’t properly clean itself up, and left me with 5GB of files somewhere that I didn’t need. I started digging around using cygwin, find, and grep, using one of the filenames that appeared in the installer during install, and found these:

1
2
3
find /cygdrive/c > ~/out.txt
grep -irn 'bin64vc' ~/out.txt
./Users/matt/AppData/Local/Package Cache/{F2BCBBDC-9204-3377-A6A1-EDD5DEDD106B}v1.24.1.0/devBin64vc142.msi

One of the {ASDF... dirs creation time exactly matched the time I last tried to install. I nuked all of these dirs from Package Cache with gusto, and got my 5GB back.

This is the end of the road for Lumberyard for me; they have a long way to go to match the user experience of Unity and Unreal.

Update: 2020-06-04

<< Beyond: Two Souls - Reactions Fixing That Weird Positioning Problem in my Unity Game >>

See Also