aws / amazon-gamelift-plugin-unreal

The Amazon GameLift Plugin for Unreal contains libraries and native UI that makes it easier to access GameLift resources and integrate GameLift into your Unreal game. You can use the GameLift Unreal Plugin to access GameLift APIs and deploy AWS CloudFormation templates for common gaming scenarios.
https://aws.amazon.com/gamelift/getting-started/
Apache License 2.0
32 stars 18 forks source link

Amazon GameLift Plugin for Unreal Engine

GitHub GitHub release (latest by date) GitHub all releases GitHub release (latest by date)

Compatible with Unreal Engine 5 (versions 5.0, 5.1, 5.2 and 5.3).

Overview

Amazon GameLift is a fully managed service that allows game developers to manage and scale dedicated game servers for session-based multiplayer games. The Amazon GameLift plugin for Unreal Engine provides tools that makes setting up your Unreal project, compatible with UE 5.0, 5.1, 5.2 and 5.3, for hosting on Amazon GameLift quicker and easier. Once installed, you will be able to search the plugin from within the Unreal Engine editor and start using it to integrate Amazon GameLift functionality into your client and server code. The plugin contains functionality to automatically bootstrap your game runtime environment to the AWS Cloud, fully test your game server integration with Amazon GameLift locally, and deploy your game servers on Amazon GameLift.

You can use the following built-in templates to deploy your game for some of the common scenarios.

Each scenario uses an AWS CloudFormation template to deploy your game, creating a stack with the necessary resources. You can view and manage your resource stacks in the AWS Management Console for CloudFormation.

Prerequisites

Install the plugin

Complete the following steps to install and enable the plugin for your multiplayer game project. For more details, see the AWS GameLift documentation.

  1. Build the Amazon GameLift C++ Server SDK. See section below for details.

  2. Install and enable the plugin.

    1. In your game project root folder, create a folder called "Plugins" and copy the "GameLiftPlugin" folder located inside the downloaded Amazon GameLift plugin into this new folder.
    2. In the .uproject file, add the following to the Plugins section:

      {
          "Name": "GameLiftPlugin",
          "Enabled": true
      },
      {
          "Name": "WebBrowserWidget",
          "Enabled": true
      }
  3. Set your project to use the source-built UE editor. Do this step if your game project was created with a non-source-built version of UE. In your game project folder, select the .uproject file and choose the option Switch Unreal Engine Version.

  4. Rebuild the project solution. After completing the previous steps to update your project files, rebuild the solution. Note: if you get an error for not finding header files in the C++ Server SDK similar to fatal error C1083: Cannot open include file: 'aws/gamelift/server/model/DescribePlayerSessionsResult.h': No such file or directory when building the project, or get a path too long warning when unzipping the files in the release bundle, try moving the plugin to a folder closer to the root, or rename the destination folder to a shorter name and extract the files again. Sometimes zip tools might silently skip files due to file path being too long.

Build the Amazon GameLift C++ Server SDK

Before you can use the plugin inside an Unreal game, you need to build the Amazon GameLift server C++ SDK.

To build the Amazon GameLift server SDK:

  1. Open a terminal/command prompt.
  2. Navigate to the GameLift-Cpp-ServerSDK-<version> folder that was included with the Amazon GameLift SDK Release download.
  3. Follow the below instructions for your platform.

Linux

For a quick and easy automated build for Amazon Linux compatible binaries and OpenSSL and OpenCrypto dependencies, see the Building the Amazon GameLift Server SDK for Unreal Engine 5 on Amazon Linux.

If you want to do this manually instead, follow the steps below. This expects you have the correct OpenSSL version that matches your Unreal Engine configured in your Linux environment, and the OpenSSL and OpenCrypto libraries copied to your server build.

  1. Run the following commands
    mkdir out
    cd out
    cmake -DBUILD_FOR_UNREAL=1 ..
    make
  2. Once complete, the following file should have been built
    prefix/lib/aws-cpp-sdk-gamelift-server.so
  3. Copy the file over to the following location in the Unreal plugin folder:
    GameLiftPlugin/Source/GameLiftServer/ThirdParty/GameLiftServerSDK/Linux/x86_64-unknown-linux-gnu/

    Once complete you should have a filepath similar to this example

    GameLiftPlugin/Source/GameLiftServer/ThirdParty/GameLiftServerSDK/Linux/x86_64-unknown-linux-gnu/aws-cpp-sdk-gamelift-server.so 

Windows

  1. Run the following commands
    mkdir out
    cd out
    cmake -G "Visual Studio 17 2022" -DBUILD_FOR_UNREAL=1 ..
    msbuild ALL_BUILD.vcxproj /p:Configuration=Release
  2. The above step produces the following binary files required by the plugin.
    prefix\bin\aws-cpp-sdk-gamelift-server.dll  
    prefix\lib\aws-cpp-sdk-gamelift-server.lib
  3. Copy the files over to this location in the Unreal plugin folder:
    GameLiftPlugin\Source\GameLiftServer\ThirdParty\GameLiftServerSDK\Win64\

    Once complete you should have two filepaths similar to this example

    GameLiftPlugin\Source\GameLiftServer\ThirdParty\GameLiftServerSDK\Win64\aws-cpp-sdk-gamelift-server.dll  
    GameLiftPlugin\Source\GameLiftServer\ThirdParty\GameLiftServerSDK\Win64\aws-cpp-sdk-gamelift-server.lib 

For more detailed instructions on how to build the C++ SDK,, please refer to the README.md file located in the C++ SDK directory.

Amazon GameLift Resources