Integrate Amazon GameLift from 4.15

Buy GameLiftSample

 GameLift GameSessions Demo

GameLift FlexMatch Demo

Features

Supported Amazon Linux 16/12/ 2018

AmazonLinux.png

Supported UE4 4.25 07/05/ 2020

Supported UE4 4.24 11/12/ 2019

Supported UE4 4.23 06/09/ 2019

Supported UE4 4.22 04/04/ 2019

Supported UE4 4.21 09/11/ 2018

Added new features UE4 4.20 01/11/ 2018
GameProperty
https://docs.aws.amazon.com/gamelift/latest/apireference/API_GameProperty.html

  • It needs GameMode and MapName properties to travel. Maxplayers will be Max count which is gamelift player session count.
  • You can add more gameproperies and retrieve them by OnStartGameSession delegate.
    GameProperty

Dedicated server settings for autoscale

  • GameLift is checking health in every 60 seconds. Dedicated server shut down itself if it doesn’t get health check for MaxHealthCheckTime. Default value is 180 seconds.
  • Dedicated server shut down itself if it has no player for MaxEmptyServerTime.Default value is 180 sec.
    dedicated server settings

MatchMakingTicket for Flex match

  • StartMatchMaking
    StartMatchMaking.PNG
  • DescribeMatchMaking
    DescribeMatchMaking.PNG
  • AcceptMatch
    DescribeMatchMaking

 

Amazon GameLift Archtecture

https://aws.amazon.com/blogs/aws/launch-amazon-gamelift-now-supports-all-c-and-c-game-engines/

GameLift-02-Architecture

Amazon GameLift and Game Client/Server Interactions

http://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-interactions.html
https://aws.amazon.com/blogs/gamedev/category/gamelift/

Set Up the Unreal Engine Server SDK Plugin

http://docs.aws.amazon.com/gamelift/latest/developerguide/integration-engines-setup-unreal.html

In Windows do the following:

mkdir out
cd out
cmake -G "Visual Studio 14 2015 Win64" -DBUILD_FOR_UNREAL=1 ..
msbuild ALL_BUILD.vcxproj /p:Configuration=Release

The following binary files are generated:

  • out\prefix\bin\aws-cpp-sdk-gamelift-server.dll
  • out\prefix\lib\aws-cpp-sdk-gamelift-server.lib

Add Amazon GameLift to an Unreal Engine Game Server Project

http://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html
http://docs.aws.amazon.com/gamelift/latest/developerguide/integration-engines-setup-unreal.html

#include "GameLiftServerSDK.h"

AGameLiftFPSGameMode::AGameLiftFPSGameMode()
    : Super()
{
 ...
 //This game server tells GameLift that it listens on port 7777 for incoming player connections.
 FString Port = "7777";
 // Allow the command line to override the default port
 if (FParse::Value(FCommandLine::Get(), TEXT("Port="), Port) == false)
 {
 Port = GConfig->GetStr(TEXT("URL"), TEXT("Port"), GEngineIni);
 }
 params->port = FCString::Atoi(*Port);
 ...
}

Packaging and Uploading Server Build

http://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-build-aws-cli-installing.html

Add Amazon GameLift to Your Game Client

http://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-client-api.html

 

42 thoughts on “Integrate Amazon GameLift from 4.15

  1. Thank you for your kind post 🙂 But I have an one question – I cannot compile with VS2017 not 2015 ;( Should I install 2015 to develop with gameLift?

    Like

  2. We tried to build the dedicated server as instructed. We tried with both the 4.18 and 4.19 sample, with the release version of unreal.

    We ran the command:
    RunUAT.bat BuildCookRun -project=”C:\Users\4DMACAU-G25VR\Documents\Unreal Projects\GameLiftSample_4.18\GameLiftSample.uproject” -noP4 -platform=Win64 -clientconfig=Development -serverconfig=Development -server -serverplatform=Win64 -noclient -nodebuginfo -build -cook -stage -pak -archive -archivedirectory=”C:\Users\4DMACAU-G25VR\Documents\Unreal Projects\GameLiftSample_4.18\Build”

    After it tried to build for a while, we got the same error in red each time, saying:
    ERROR: Command failed (Result:5): C:\UnrealEngine_release\Engine\Binaries\DotNET\UnrealBuildTool.exe GameLiftSampleEditor Win64 Development -Project=”C:\Users\4DMACAU-G25VR\Documents\Unreal Projects\GameLiftSample_4.18\GameLiftSample.uproject” “C:\Users\4DMACAU-G25VR\Documents\Unreal Projects\GameLiftSample_4.18\GameLiftSample.uproject” -NoUBTMakefiles -noxge -generatemanifest -NoHotReload. See logfile for details: ‘UnrealBuildTool-2018.06.21-16.49.37.txt’
    (see C:\UnrealEngine_release\Engine\Programs\AutomationTool\Saved\Logs\UAT_Log.txt for full exception trace)
    AutomationTool exiting with ExitCode=5 (5)
    BUILD FAILED

    Can someone please help?

    Like

  3. Hello,

    This is the best GameLift integration I’ve found so far! However, when trying to compile the server target from a source build of 4.20 with VS 2017, it gives a ton of “noexcept” errors. Any idea how to fix that?

    Thanks!

    Like

    • I’m using this rule sets. It has default values so that I may use parts of attributes.
      https://docs.aws.amazon.com/gamelift/latest/developerguide/match-examples.html

      {
      “name”: “multi_map_game”,
      “ruleLanguageVersion”: “1.0”,
      “playerAttributes”: [{
      “name”: “exp”,
      “type”: “number”,
      “default”: 50
      }, {
      “name”: “gameMode”,
      “type”: “string_list”,
      “default”: [ “CTF”, “FFA”, “TDM” ]
      }, {
      “name”: “mapPreference”,
      “type”: “string_number_map”,
      “default”: { “CTF”: 100 }
      }, {
      “name”: “acceptableMaps”,
      “type”: “string_list”,
      “default”: [ “CTF” ]
      }],
      “teams”: [{
      “name”: “red”,
      “maxPlayers”: 5,
      “minPlayers”: 2
      }, {
      “name”: “blue”,
      “maxPlayers”: 5,
      “minPlayers”: 2
      }],
      “rules”: [{
      // We placed this rule first since we want to prioritize players preferring the same map
      “name”: “MapPreference”,
      “description”: “Favor grouping players that have the highest map preference aligned with the anchor’s favorite”,
      // This rule is just for sorting potential matches. We sort by the absolute value of a field.
      “type”: “absoluteSort”,
      // Highest values go first
      “sortDirection”: “descending”,
      // Sort is based on the mapPreference attribute.
      “sortAttribute”: “mapPreference”,
      // We find the key in the anchor’s mapPreference attribute that has the highest value.
      // That’s the key that we use for all players when sorting.
      “mapKey”: “maxValue”
      }, {
      // This rule is second because any tie-breakers should be ordered by similar experience values
      “name”: “ExperienceAffinity”,
      “description”: “Favor players with similar experience”,
      // This rule is just for sorting potential matches. We sort by the distance from the anchor.
      “type”: “distanceSort”,
      // Lowest distance goes first
      “sortDirection”: “ascending”,
      “sortAttribute”: “exp”
      }, {
      “name”: “SharedMode”,
      “description”: “The players must have at least one game mode in common”,
      “type”: “collection”,
      “operation”: “intersection”,
      “measurements”: [ “flatten(teams[*].players.attributes[gameMode])”],
      “minCount”: 1
      }, {
      “name”: “MapOverlap”,
      “description”: “The players must have at least one map in common”,
      “type”: “collection”,
      “operation”: “intersection”,
      “measurements”: [ “flatten(teams[*].players.attributes[acceptableMaps])”],
      “minCount”: 1
      }]
      }

      Like

      • Thanks for the instant reply!
        If possible, can you also tell us what you did to “Game properties” (Key and Value pair in the bottom of a page) in “Matchmaking Configuration” of FlexMatch?

        Like

  4. Hi, does this work like the matchmaking system in for example PUBG, where the game starts when a specified number of players have joined a queue? And if more players wants to play, then the system will spawn another game instance? If this is not the way it works by default, would it be possible to do using this project? Thanks

    Like

Leave a Reply