Tips to integrate Amazon GameLift Server SDK into UE4

Environment

  • Visual Studio 2017 (15.5.5)
  • UE4.18.3
  • Amazon GameLift Cpp Server SDK 3.1.7

.

Tips to integrate Amazon GameLift Server SDK into UE4

To build GameLift Server SDK

  1. Basically refer to the official guide:
  1. Change cmake parameter:
  • before:
  • cmake -G "Visual Studio 14 2015 Win64" -DBUILD_FOR_UNREAL=1 ..
  • after:
  • cmake -G "Visual Studio 15 2017 Win64" -DBUILD_FOR_UNREAL=1 -DBUILD_SHARED_LIBS=1 ..
  1. Change boost version:
  1. You may meet an encoding error on gtest-internal.h. Fix it manually:
  1. You’d better run msbuild on x64 Native Tools Command Prompt for VS 2017, not on any normal command prompt.

After building it successfully, you should find:

  • GameLift-Cpp-ServerSDK-3.1.7\out\prefix\lib\aws-cpp-sdk-gamelift-server.lib
  • GameLift-Cpp-ServerSDK-3.1.7\out\prefix\bin\aws-cpp-sdk-gamelift-server.dll

.

To update GameLiftServerSDK Plugin

  1. Since UE4.16, Change the plugin’s constructor:

    // GameLift-Unreal-plugin-3.1.7\GameLiftServerSDK\Source\GameLiftServerSDK\GameLiftServerSDK.Build.cs

    // before
    public GameLiftServerSDK(TargetInfo Target)

    // after
    public GameLiftServerSDK(ReadOnlyTargetRules Target) : base(Target)

  2. Enable exceptions to suppress error C4577, in constructor:

    // GameLift-Unreal-plugin-3.1.7\GameLiftServerSDK\Source\GameLiftServerSDK\GameLiftServerSDK.Build.cs
    public GameLiftServerSDK(ReadOnlyTargetRules Target) : base(Target)
    {
    // …
    if (bHasGameLiftSDK)
    {
    if (Target.Type == TargetRules.TargetType.Server)
    {
    bEnableExceptions = true;
    // …
    }
    // …
    }
    }

.

To integrate GameLiftServerSDK Plugin into your project

  1. Copy the lib/dll files into GameLift-Unreal-plugin-3.1.7\GameLiftServerSDK\ThirdParty\GameLiftServerSDK\Win64 directory(it was initially empty when you unzipped the downloaded sdk zip file).
  2. Copy the whole GameLift-Unreal-plugin-3.1.7\GameLiftServerSDK directory into YourGame\Plugins directory.
  • As a result, you can find the lib/dll files on this directory:
    ** YourGame\Plugins\GameLiftServerSDK\ThirdParty\GameLiftServerSDK\Win64
  1. Update YourGame.uproject and Source\YourGame\YourGame.Build.cs as the official guide, and plus:
  • in YourGame.uproject
    ** You may want to build this plugin only for dedicated server.

     // in "Plugins"
    

    {
    “Name”: “GameLiftServerSDK”,
    “Enabled”: true,
    “WhitelistTargets”: [
    “Server”
    ]
    }

  • in Source/YourGame/YourGame.Build.cs
    ** Add this plugin into PublicDependencyModuleNames,
    ** and enable exceptions, only for dedicated server.
    ** Mention WITH_GAMELIFT explicitly to suppress warning C4668.

     // constructor
    

    public YourGame(ReadOnlyTargetRules Target)
    : base(Target)
    {
    // …
    if (Target.Type == TargetType.Server)
    {
    bEnableExceptions = true;

        PublicDependencyModuleNames.AddRange(new string[]
        {
            "GameLiftServerSDK",
        });
    }
    else
    {
        Definitions.Add("WITH_GAMELIFT=0");
    }
    // ...
    

    }

You should build YourGame successfully.

.

Could anyone verify or confirm these steps, please?

Thank you for sharing this Kyeongho :slight_smile:

Hey @Kyeongho Park. I can confirm these steps! Thanks to them, I could build my project successfully.

There’s just one thing I’d like to note though: watch out by only allowing the server to build the SDK. This could be a problem because you have to reference the plugin on files the client also have, like the GameMode.

Hey guys, anybody know if this is working for UE4 version 4.19?

Your tip is working on Version 4.19 and 4.20 too :wink:

Worked with UE 4.20, GameLift 3.2.1 and without apply fix for sioclient (in this link)

http://thamtututhanhdo.com/movie/mission-impossible-fallout-watch-online-free/

http://thamtututhanhdo.com/movie/watch-bohemian-rhapsody-2018-free-online-fullhd/

Worked for me as well. UE 4.21, GameLift 3.2.1, VS 2017.
Thank you big time!

Just in case: You need git installed in your Windows environment or the second big step (msbuild…) won’t work. This is one of many ways to go

hey could u send me the download link?

To git? It’s already in my post, but in case you missed it: https://gitforwindows.org/ :slight_smile:

Argh!! Sorry, I just tried to delete my silly question but I blew up whole context including your kind reply… I finally succeeded to build, with 38 warnings and no error!! :slight_smile: Installing git was the key. Thank you so much, Caviarail!

no, can u give me the plugin?

You mean this?

nvm, i got it working also do u know how to get gamelift client working?

also i crash when i connect to game lift local u know why? u can contact me on discord

Look here for the Client. For your Crash, I would need a little more info than that.

i ran gamelift local then ran my server and then my server crash
DEDICATED SERVER LOG - Crash - Pastebin.com

nvm, i found out it crashed because i used print string for dedicated server i changed it to UE_LOG and it works now