
Local testing to cloud deployment: development workflows in Amazon GameLift

From initial development to scaling for global player bases, Amazon GameLift addresses these challenges by providing robust server hosting and scaling solutions… Let’s explore available development workflows using Amazon GameLift Anywhere… Understanding Amazon GameLift Anywhere: local devel…
In today’s competitive gaming landscape, delivering a seamless multiplayer experience is crucial for an optimal game play experience. Game developers face numerous challenges in managing game servers such as scaling servers to meet player demand, managing game deployment pipelines and optimizing server fleets for costs. From initial development to scaling for global player bases, Amazon GameLift addresses these challenges by providing robust server hosting and scaling solutions.
Let’s explore available development workflows using Amazon GameLift Anywhere. It helps game developers choose and implement the optimal approach to meet business, game and development environment requirements.
Understanding Amazon GameLift Anywhere: local development streamlined
Amazon GameLift Anywhere takes advantage of Amazon GameLift features with developer hosted resources. Anywhere fleets are commonly used as test environments for iterative development or alongside managed fleets in a hybrid hosting solution. The local development and test workflow begins on a local workstations, where development and testing game servers occur before deploying to an Amazon GameLift managed Amazon Elastic Compute Cloud (Amazon EC2) fleet or a container fleet.
Setting up a local Amazon GameLift Anywhere fleet is quick. You will need to create a custom location for a local workstation, and register the local workstation as a fleet compute source. An Amazon GameLift temporary authentication token (AuthToken) is required to connect to Amazon GameLift APIs. The AuthToken is generated with the Amazon Web Services (AWS) Command Line Interface (AWS CLI). Game session activity is replicated by creating a local game session and a test client that connects to the game session. Once you’re ready to transition to Amazon GameLift managed fleets, create an Amazon GameLift managed fleet, then change the game server InitSDK() code call to remove Amazon GameLift Anywhere fleet parameters. Finally, create a build resource and deploy to an Amazon GameLift managed fleet.
The following details steps for local game server development with Amazon GameLift Anywhere.
Local environment prerequisites
- Have local development resources in place to build with Amazon GameLift server SDKs or Amazon GameLift plugins for Unreal Engine or Unity.
- NOTE: Local development with Unreal Engine requires Unreal Editor built from source to package the server components for a multiplayer game.
- Download the latest version of AWS CLI, install, and configure credentials.
- Download appropriate Amazon GameLift server SDK or available Amazon GameLift plugin for Unreal or Unity.
- Install Amazon GameLift plugin for Unreal or plugin for Unity.
Create an Amazon GameLift Anywhere fleet
- In the AWS Management Console navigate to Amazon GameLift, then to Anywhere fleets in the console and select Create Anywhere fleet.
- Enter a Name for the fleet, a Metric group name, and select
- Choose Create location to create custom location.
- Name the location to reflect a local development environment and select Create.
- Choose the created Custom location you just named and select Submit.
- An Amazon GameLift Anywhere fleet will launch with compute type Anywhere.
Alternatively, you can use the AWS CLI to create locations and Amazon GameLift Anywhere fleets. To start, enter the following code:
aws gamelift create-location -–location-name custom-MyLocalMachine
aws gamelift create-fleet --name MyAnywhereFleet --compute-type ANYWHERE –locations “Location=custom-MyLocalMachine”
With the Amazon GameLift Anywhere fleet and custom location created, register the local workstation as a fleet compute using the AWS CLI to connect a local workstation to the Amazon GameLift Anywhere fleet. The IP address should reflect the public IP of the local development workstation.
aws gamelift register-compute --compute-name MyLocalMachine --fleet-id arn:aws:gamelift:us-west-2: 111122223333:fleet/fleet- 2222bbbb-33cc-44dd-55ee-6666ffff77aa --ip-address 10.1.2.3 --location MyLocalMachine
To connect to the Amazon GameLift Anywhere fleet, use the AWS CLI to get an AuthToken for the Amazon GameLift Anywhere fleet. The command response includes the AuthToken string and an ExpirationTimestamp value. Note the ExpirationTimestamp value. It is important to plan to refresh the token before expiration.
aws gamelift get-compute-auth-token --fleet-id arn:aws:gamelift:us-west-2:111122223333:fleet/fleet- 2222bbbb-33cc-44dd-55ee-6666ffff77aa --compute-name MyLocalMachine
Response syntax should read as:
Use the value for webSocketUrl returned by the register-compute command, the AuthToken string, the local location name, Amazon GameLift Anywhere fleet ARN and string for processId as serverParameters in the game server code to connect to the Amazon GameLift Anywhere fleet.
The follow Amazon GameLift C++ SDK integration code snippet uses example values for Amazon GameLift Anywhere serverParameters.
To transition to Amazon GameLift managed fleets, remove or comment out the server parameters and the serverParameter variable in the InitSDK() call. Generate a build resource and deploy to Amazon GameLift managed fleets. ServerParameter values are set with launch, or environment, variables with game server logic determining when to use them.
Local game server testing
With the Amazon GameLift Anywhere fleet created, the local workstation registered and game server integration work done, game servers can be built locally and run while using the Amazon GameLift Anywhere fleet as a compute resource. The fleet supports game server backend integration with Amazon GameLift and allows provisioning of game sessions locally for testing.
Amazon GameLift features such as queues, sessions, and Amazon GameLift FlexMatch are available for use while testing the game server. To launch Amazon GameLift features for testing, create a queue, a FlexMatch matchmaking rule set, a matchmaking configuration, a game session and a player session.
Start with Amazon GameLift queues and create an Amazon GameLift session queue with the AWS CLI.
aws gamelift create-game-session-queue --name "MyQueue" --destinations DestinationArn=arn:aws:gamelift:region: 111122223333:fleet/fleet- 2222bbbb-33cc-44dd-55ee-6666ffff77aa --timeout-in-seconds 600
Create an Amazon GameLift FlexMatch matchmaking rule set and matchmaking configuration.
With a matchmaking rule set defined, create an Amazon GameLift FlexMatch matchmaking configuration referencing the previously created rule set and queue.
aws gamelift create-matchmaking-configuration --name "MyMatchmakingConfig" --description "Basic matchmaking configuration" --game-session-queue-arns "arn:aws:gamelift:us-west-2: 111122223333:gamesessionqueue/MyQueue" --request-timeout-seconds 60 --rule-set-name "MyRuleSet" --notification-target "arn:aws:sns:region:account:MyMatchmakingTopic"
To start matchmaking with a straightforward multi-player scenario using the AWS CLI, reference the previously created matchmaking configuration. Identify test player Ids and a unique ticket-id.
The Amazon GameLift Anywhere fleet now has a queue, matchmaking rule set and a matchmaking configuration. The fleet is ready for game and player sessions.
Create game and player sessions in an Amazon GameLift Anywhere fleet.
aws gamelift create-game-session --fleet-id "fleet- 2222bbbb-33cc-44dd-55ee-6666ffff77aa" --maximum-player-session-count 2
Use the game session ID generated from the create-game-session command to create a player session.
aws gamelift create-player-session --game-session-id "game-1234" --player-id "player-1"
Local testing advantages
The local testing workflow begins with launching your game server process on your development machine. Once running, Amazon GameLift Anywhere provides fleet resources, allowing testing of points of integration. During local testing, game session management implementation is validated confirming proper handling of player connections, disconnections, and session state changes. The test cycle includes verifying the complete player session lifecycle, from initial connection through gameplay and eventual disconnection. Throughout this process, Amazon GameLift Anywhere supports monitoring server logs and metrics to identify issues and optimize performance.
A local development environment offers key advantages for developers. Game server code debugging occurs in near real-time using individual development environments (IDEs) and tools, while testing runs alongside production-like infrastructure resources. This environment allows developers to validate session management logic thoroughly and simulate production game scenarios.
Additionally, monitoring server-client communication patterns and profiling performance metrics verifies that your game meets its performance targets. Developers can execute integration testing with actual Amazon GameLift APIs, validating game servers operate as expected when deployed to production. Player session validation confirms proper authentication and authorization flows, maintaining security and preventing unauthorized access.
Container-based development with Amazon GameLift Anywhere
Developing multiplayer game servers using containers and Amazon GameLift Anywhere combines containerization flexibility with the game infrastructure capabilities of Amazon GameLift. This integration enables consistent environments from development to production. The workflow utilizes Docker containers to package game servers and dependencies, allowing identical operations across environments. This approach supports rapid local testing cycles while maintaining production configurations. Container rebuilds are efficient, and shared configurations eliminate environment inconsistencies.
The development architecture combines Docker containers stored in Amazon Elastic Container Registry (Amazon ECR), Amazon GameLift Anywhere for local testing, Amazon GameLift SDK for service integration, and AWS CLI for resource management. As the development cycle progresses from local testing to cloud deployment, developers can test containerized servers locally using Amazon GameLift Anywhere. Validated containers are pushed to Amazon ECR for deployment to Amazon GameLift managed container fleets. This consistent environment between local and cloud reduces troubleshooting overhead, allowing teams to focus on feature development and optimization.
For local development with containers, Amazon GameLift Anywhere and Amazon GameLift container fleets builds on the requirements of local game server development and adds the need for an Amazon ECR repository. While not required for local development, the repository hosts container images used by Amazon GameLift managed container fleets for production deployments.
If developing with the Amazon GameLift 2.0 plugins for Unreal Engine or Unity, the plugin expands on Amazon GameLift Anywhere integration while streamlining the transition to Amazon GameLift managed Amazon EC2 or container fleets.
In the following example, the Unreal Engine plugin is used to create an AWS user authentication profile, deploy an Amazon GameLift Anywhere feet, and transition a game server build to Amazon GameLift managed container fleets.
Unreal Engine plugin prerequisites
- You’ll need GitHub and Epic Games accounts for accessing the Unreal Engine project on GitHub.
- Unreal Editor versions 5.1, 5.2, 5.3, 5.4, 5.5 built from source.
- Install the Amazon GameLift plug for Unreal.
- For existing AWS accounts and users, an AWS Identity and Access Management (IAM) user with Access key ID and Secret access key is needed.
- An Unreal game server build.
- Docker installed.
In Unreal Editor
- Choose the Amazon GameLift
- Select AWS Access Credentials.
If an AWS account and user are needed:
- Select Go to AWS Management Console.
- If an account and user are available to complete profile setup, choose Add new profile.
The first option will direct you to the AWS Console to create an account and user. Note for existing AWS accounts and users, using Add new profile requires an IAM username, access key ID and Secret access key. These credentials are used to create Amazon GameLift resources.
After successfully adding a profile, bootstrap the profile by clicking on the bootstrap prompt. If bootstrapping was successful, a message will indicate success and a bootstrap status as Active.
With an active profile, local development can use an Amazon GameLift Anywhere fleet, which is supported with the plugin. Utilize existing Amazon GameLift Anywhere fleets or new fleets created with the plugin. Set the game server path and follow the Anywhere fleet workflow path.
After the fleet Is available:
- connect to an Anywhere fleet.
- Register your workstation as fleet compute.
Once the local workstation registration process completes, launch and test the game server using Amazon GameLift Anywhere fleets with queues, Amazon GameLift FlexMatch and game sessions.
When you are ready to transition a game server build to either an Amazon GameLift managed Amazon EC2 or container fleets, the plugin supports these workflows. For containers, the plugin creates a container using Docker, if one does not already exist, and optionally stores the container image in Amazon ECR. Developers then deploy the container to single or multi-location Amazon GameLift container managed fleets by selecting Deploy Container Fleet.
Conclusion
The choice of using Amazon GameLift development workflows fundamentally shapes game development lifecycles and operational efficiency. Amazon GameLift Anywhere serves as an ideal starting point, offering the flexibility developers need for local development and testing. This approach allows teams to iterate quickly using their local development environment.
Container-based solutions build upon this foundation by providing consistency across environments and supporting scalable deployment patterns that grow with your needs. Amazon GameLift Anywhere, combined with Amazon GameLift managed Amazon EC2 and container fleets, offers seamless transitions. Developers can progress from game server local development, to testing in a production-like environment, to production fleets without the cost of production replicated testing and staging environments.
Try out the workflows and tools and let us know what you think. Contact an AWS Representative to know how we can help accelerate your business.
Further reading
Author: Steve Phillips