Questions tagged with Amazon GameLift
Content language: English
Sort by most recent
Hello,
We have a Battle Royale game supporting 10 teams of 3 players each for a total of 30 players per match.
We want to be able to start matches with less than 10 teams if they have been waiting for a long time.
For example, if there are 8 teams who have been matchmaking for 5 minutes, we want to be able to start the game with those 8 teams if 10 minutes have passed and no other team has joined.
We have looked into Expansions, but we can't reduce the "Quantity" of teams. This forces us to only start matches with at least 10 teams.
This is our current rule set:
```
{
"name": "trios_battle_royale",
"ruleLanguageVersion": "1.0",
"playerAttributes": [{
"name": "skill",
"type": "number",
"default": 10
}],
"teams": [{
"name": "t1",
"minPlayers": 3,
"maxPlayers": 3,
"quantity": 10
}]
}
```
How do we start matches with less than 10 teams?
We are currently setting up some authentication systems for our UE4 game servers so that we are sure they are the only devices/users that are capable of accessing our internal API / LAMDBA functions.
With that in mind, there is a desire to not hard code any COGNITO user ID's or tokens into the actual server-code itself. Instead, we would like to pursue having these tokens be generated and cycled through on AWS's side, to keep it decoupled. We are undecided whether these tokens should be for the life of the Gamelift server or for a set period of time—whichever is most feasible. This way, if we need to adjust access to certain features down the road, it will not require an update to the deployed Unreal Engine server build.
Does AWS API or LAMDBA have any features out of the box to check if an API request is coming from within AWS, ideally from one of the active Gamelift instances?
While we may still need to create a COGNITO identity for the servers, or just check the local IP of the running Gamelift servers, the ideal flow would look like:
1) UE4 game server on AWS asks for a token on Startup.
2) LAMDBA Authorization script checks to make sure it is valid and coming from within AWS/Gamelift
3) Once Validated, LAMDBA function provides a token to enable server to use in backend LAMDBA functions.
4) Before Gamelift Server shutdown, revoke access or add to a "black-listed" token Database to prevent second use before token expiration.
What is the best practice for securing and separating a UE4 server's ability—hosted via Gamelift—to update databases and perform other tasks that ***only*** the server should see and have access to?
The methods we have come up with are:
1) With an Auth Token to an internal API: utilize Pre-processor directives so that these functions and tokens are never even shipped with the client. (The downside to this is that most of our team is allergic to formal code, so we are not sure how UE4 handles segregated, pre-processor directives that are Blueprint callable functions. Will this cause problems if the Blueprint UFunction ends up being removed on the client?)
2) Same as 1, but have the servers make a GET request on startup to receive dynamically generated and cycled auth tokens.
What method should we be pursuing to secure our UE4 server's ability to modify databases etc?
Hi,
I am using flexmatch in automatic backfill mode and encounters a problem in the following situation:
- A player is put in a game session through matchmaking
- the player leaves the session (and thus triggers a call to RemovePlayerSession)
- the player then restarts the matchmaking process ( which triggers a call to StartMatchmaking in our backend )
I expected the player to be put back in the same game session but Flexmatch creates a new game session. Is there a way to change this behavior?
I have a 2 person PvP game which is working completely fine remotely now. My only issue is that if more than two people try to connect to the server, they are given a rejection message saying that the game session is full.
I'm using the default deploy settings for the sample Unity Single-Region Fleet Cloud Formation, which includes a single region on-demand fleet with an alias. I don't have any matchmaking or queues set up. Do I need to set up any of this in order to funnel users into new game sessions instead of having them get rejected from an existing match?
Thanks in advance!
Hi all, I have an existing game using Unity for the frontend, but NodeJS for the backend. I can't port my backend over to Unity any time soon, so I've managed to get it working on GameLift in its current state. But there's room for improvement. First I'll explain how I've set it up:
1. Used an unofficial AWS GameLift NodeJS Server SDK (https://github.com/dplusic/GameLift-Nodejs-ServerSDK). (Apologies if it's against the rules to link to unofficial SDKs here - I'm happy to redact this, just thought it would add some context)
2. Prepackaged a NodeJS v16 binary into the build zip that I upload to GameLift
3. Prepackaged my node_modules folders (all of the dependencies) in the build zip
4. My startup script (start.sh) sets up the NodeJS binary and executes Node within the calling process
Here's what my start.sh looks like:
```
#!/bin/bash
echo "Running 'node src/game-lift/GameLift.js' from Process ID $$"
echo "Setting up node"
PWD=`pwd`
PATH=$PATH:$PWD/deps/node-v16.16.0-linux-x64/bin
node --version
echo "Executing 'node dist/src/game-lift/GameLift.js'"
exec node dist/src/game-lift/GameLift.js
```
`exec` ensures that NodeJS is run within the same process as the calling script, so that GameLift can monitor the process for irregularities (I assume).
I launch the Fleet with the following command:
```
aws gamelift create-fleet \
--name REDACTED-fleet-name \
--build-id build-REDACTED \
--ec2-instance-type m5.large \
--ec2-inbound-permissions 'FromPort=1234,ToPort=1234,IpRange=0.0.0.0/0,Protocol=TCP' \
--fleet-type ON_DEMAND \
--runtime-configuration 'ServerProcesses=[{LaunchPath=/local/game/start.sh,ConcurrentExecutions=1}],MaxConcurrentGameSessionActivations=1,GameSessionActivationTimeoutSeconds=600'
```
Two concerns about this approach:
1. Prepackaging NodeJS is not cool / sustainable. I'd rather install it in install.sh, using some platform independent method.
2. Running `exec` to ensure Node doesn't break out into another process seems hacky and potentially problematic. I would rather set the launch path to simply `node` and add the script as a parameter. For example:
```
--runtime-configuration 'ServerProcesses=[{LaunchPath=node,Parameters=dist/src/game-lift/GameLift.js,ConcurrentExecutions=1}],MaxConcurrentGameSessionActivations=1,GameSessionActivationTimeoutSeconds=600'
```
Maybe I'm overthinking item #2 - it might not be a problem as-is
But as for #1, I would love to take advantage of that install.sh script. Previously I was installing NodeJs in install.sh via N (https://github.com/mklement0/n-install). But I found that Node was not available in start.sh. I even SSH'd in and it seemed like NodeJS was not installed.
**Question #1**:
Am I misunderstanding what install.sh does? Should I be able to use it to install NodeJS (or any dependency) and later on use that dependency in my launch script?
**Question #2**:
Anyone got any tips on how to install Node in GameLift reliably? Yum? N? Nvm? etc.
I know NodeJS isn't officially supported, but I'm hoping to get just a general idea of what should and should not be possible in GameLift. Any help would be greatly appreciated.
Is there a way to update Node.JS version to 14 or 16 on AWS Gamelift ?Our fleet runs on Amazon Linux 2 OS .
Tried to do it manually on the existing fleet, but it is not compatible with auto generated GameScaleLightweight NodeJS server, so it won't activate the fleet.
Tried to create new fleet with new Gamelift build, included node install in the install.sh script, but it didn't install at the specified directory( which was /local/NodeJS ), but a level lower (and i didn't messed up the path). Instead, on specified directory, there was NodeJS version 10 (which was clearly created by Gamelift)
Tried to create new fleet with new Gamelift script, that didn't work either. Every time the result is the same, Node.JS version is still 10.
Right now, the only thing that works is, revert to AWS SDK v2 , which supports Node.js version 10...
I tried to deploy an AMAZON_LINUX Gamelift fleet, but it fails when activating. When I ssh'd into the EC2 instance and tried to run the game manually, I got these errors:
/lib64/libm.so.6: version `GLIBC_2.29' not found (required by /local/game/XXXXX/Binaries/Linux/../../Plugins/GameLiftServerSDK/ThirdParty/GameLiftServerSDK/Linux/x86_64-unknown-linux-gnu/libaws-cpp-sdk-gamelift-server.so)
/usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /local/game/XXXXX/Binaries/Linux/../../Plugins/GameLiftServerSDK/ThirdParty/GameLiftServerSDK/Linux/x86_64-unknown-linux-gnu/libaws-cpp-sdk-gamelift-server.so)
How can I solve them?
Hello! I'm porting to PS5 an existing UE4 game that uses Gamelift for multiplayer. I did not find a UE4 plugin for Gamelift with PS5 support already available, so I tried cloning the aws repository and building Gamelift from source using the PS5 SDK compiler and CMake integration. But I get a compilation error on the third party dependencies and I don't know how to fix them. Here is the output log:
```
cmake.exe -DCMAKE_TOOLCHAIN_FILE="D:\Utils\PS5\Prospero\Tools\CMake\PS5.cmake" -A Prospero ./.. -DBUILD_ONLY=gamelift
-- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.37.0.windows.1")
-- TARGET_ARCH not specified; inferring host OS to be platform compilation target
-- Building AWS libraries as shared objects
-- Generating windows build config
-- Building project version: 1.8.187
-- Configuring Prospero
--
-- Configuring done
-- Generating done
-- Build files have been written to: D:/Utils/aws_sdk/out-ps5/.deps
Microsoft (R) Build Engine version 16.11.2+f32259642 pour .NET Framework
Copyright (C) Microsoft Corporation. Tous droits réservés.
Checking Build System
Performing configure step for 'AwsCCommon'
-- Configuring Prospero
--
CMake Deprecation Warning at CMakeLists.txt:25 (cmake_policy):
The OLD behavior for policy CMP0077 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
-- attempting to use sanitizer list address;undefined
-- Packaging is only supported on Linux
-- Configuring done
-- Generating done
CUSTOMBUILD : CMake warning : [D:\Utils\aws_sdk\out-ps5\.deps\AwsCCommon.vcxproj]
Manually-specified variables were not used by the project:
CMAKE_TOOLCHAIN_FILE
-- Build files have been written to: D:/Utils/aws_sdk/out-ps5/.deps/build/src/AwsCCommon-build
Building Custom Rule D:/Utils/aws_sdk/third-party/CMakeLists.txt
Performing build step for 'AwsCCommon'
Microsoft (R) Build Engine version 16.11.2+f32259642 pour .NET Framework
Copyright (C) Microsoft Corporation. Tous droits réservés.
Checking Build System
Building Custom Rule D:/Utils/aws_sdk/out-ps5/.deps/build/src/AwsCCommon/CMakeLists.txt
environment.c
D:\Utils\aws_sdk\out-ps5\.deps\build\src\AwsCCommon\source\posix\environment.c(26,25): error : implicit declaration of function 'getenv' is invalid in C99 [-Werror,-Wimplicit-function-declaration] [D:\Utils\aws_sdk\out-ps5\.deps\build\src\AwsCCommon-build\aws-c-common.vcxproj] [D:\Utils\aws_sdk\out-ps5\.deps\AwsCCommon.vcxproj]
const char *value = getenv(aws_string_c_str(variable_name));
^
D:\Utils\aws_sdk\out-ps5\.deps\build\src\AwsCCommon\source\posix\environment.c(26,17): error : incompatible integer to pointer conversion initializing 'const char *' with an expression of type 'int' [-Werror,-Wint-conversion] [D:\Utils\aws_sdk\out-ps5\.deps\build\src\AwsCCommon-build\aws-c-common.vcxproj] [D:\Utils\aws_sdk\out-ps5\.deps\AwsCCommon.vcxproj]
const char *value = getenv(aws_string_c_str(variable_name));
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:\Utils\aws_sdk\out-ps5\.deps\build\src\AwsCCommon\source\posix\environment.c(42,9): error : implicit declaration of function 'setenv' is invalid in C99 [-Werror,-Wimplicit-function-declaration] [D:\Utils\aws_sdk\out-ps5\.deps\build\src\AwsCCommon-build\aws-c-common.vcxproj] [D:\Utils\aws_sdk\out-ps5\.deps\AwsCCommon.vcxproj]
if (setenv(aws_string_c_str(variable_name), aws_string_c_str(value), 1) != 0) {
^
D:\Utils\aws_sdk\out-ps5\.deps\build\src\AwsCCommon\source\posix\environment.c(50,9): error : implicit declaration of function 'unsetenv' is invalid in C99 [-Werror,-Wimplicit-function-declaration] [D:\Utils\aws_sdk\out-ps5\.deps\build\src\AwsCCommon-build\aws-c-common.vcxproj] [D:\Utils\aws_sdk\out-ps5\.deps\AwsCCommon.vcxproj]
if (unsetenv(aws_string_c_str(variable_name)) != 0) {
^
4 errors generated.
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(241,5): error MSB8066: la build personnalisée de 'D:\Utils\aws_sdk\out-ps5\.deps\CMakeFiles\5f1e4345a9d911eaa5fc8616d695c793\AwsCCommon-configure.rule;D:\Utils\aws_sdk\out-ps5\.deps\CMakeFiles\5f1e4345a9d911eaa5fc8616d695c793\AwsCCommon-build.rule;D:\Utils\aws_sdk\out-ps5\.deps\CMakeFiles\5f1e4345a9d911eaa5fc8616d695c793\AwsCCommon-install.rule;D:\Utils\aws_sdk\out-ps5\.deps\CMakeFiles\291e455fb70b57eb98a005f919e01343\AwsCCommon-complete.rule;D:\Utils\aws_sdk\out-ps5\.deps\CMakeFiles\075aa0e2c4544e3f37305cb661ccfd02\AwsCCommon.rule;D:\Utils\aws_sdk\third-party\CMakeLists.txt' s'est arrêtée. Code 1. [D:\Utils\aws_sdk\out-ps5\.deps\AwsCCommon.vcxproj]
Performing configure step for 'AwsChecksums'
-- Configuring Prospero
--
-- Configuring done
-- Generating done
CUSTOMBUILD : CMake warning : [D:\Utils\aws_sdk\out-ps5\.deps\AwsChecksums.vcxproj]
Manually-specified variables were not used by the project:
CMAKE_TOOLCHAIN_FILE
-- Build files have been written to: D:/Utils/aws_sdk/out-ps5/.deps/build/src/AwsChecksums-build
Building Custom Rule D:/Utils/aws_sdk/third-party/CMakeLists.txt
Performing build step for 'AwsChecksums'
Microsoft (R) Build Engine version 16.11.2+f32259642 pour .NET Framework
Copyright (C) Microsoft Corporation. Tous droits réservés.
Checking Build System
Building Custom Rule D:/Utils/aws_sdk/out-ps5/.deps/build/src/AwsChecksums/CMakeLists.txt
aws-checksums.vcxproj -> D:\Utils\aws_sdk\out-ps5\bin\Release\libaws-checksums.so
Building Custom Rule D:/Utils/aws_sdk/out-ps5/.deps/build/src/AwsChecksums/CMakeLists.txt
prospero-lld : error : cannot open Release\aws-checksums_stub_weak.a: no such file or directory [D:\Utils\aws_sdk\out-ps5\.deps\build\src\AwsChecksums-build\aws-checksums-tests.vcxproj] [D:\Utils\aws_sdk\out-ps5\.deps\AwsChecksums.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(241,5): error MSB8066: la build personnalisée de 'D:\Utils\aws_sdk\out-ps5\.deps\CMakeFiles\67b316f4a8998627537e1875c6cc3c62\AwsChecksums-configure.rule;D:\Utils\aws_sdk\out-ps5\.deps\CMakeFiles\67b316f4a8998627537e1875c6cc3c62\AwsChecksums-build.rule;D:\Utils\aws_sdk\out-ps5\.deps\CMakeFiles\67b316f4a8998627537e1875c6cc3c62\AwsChecksums-install.rule;D:\Utils\aws_sdk\out-ps5\.deps\CMakeFiles\291e455fb70b57eb98a005f919e01343\AwsChecksums-complete.rule;D:\Utils\aws_sdk\out-ps5\.deps\CMakeFiles\075aa0e2c4544e3f37305cb661ccfd02\AwsChecksums.rule;D:\Utils\aws_sdk\third-party\CMakeLists.txt' s'est arrêtée. Code 1. [D:\Utils\aws_sdk\out-ps5\.deps\AwsChecksums.vcxproj]
CMake Error at CMakeLists.txt:224 (message):
Failed to build third-party libraries.
-- Configuring incomplete, errors occurred!
```
So I have two questions:
- am I doing all this for nothing and is there a precompiled PS5 library available upon request?
- if not, could you help me fix the compile error so I can make my own plugin with PS5 support?
Thanks!
HI,
This question relates to GameFleet's game session activation properties. Namely "max concurrent game session activation" and "new activation timeout".
In the event that FlexMatch exceeds the number of created sessions to be created concurrently on a GameLift Fleet how does the timeout behavior function? Is the timeout timer started on the first session to be started or on the last?
e.g. If I allow up to 2 game session to be activated concurrently, but I activate them a few seconds apart, will the timeout timer start on the activation of the first session or the second session?
As a side question, will FlexMatch wait indefinitely for a game session to become available, or will the matchmaking tickets timeout themselves?
Thanks.
I have create a game fleet and have some game sessions running on it. My game is running in open testing phase. For some reasons, sometime there is a game session that running forever, it doesn't shutdown. I don't know the reason because It doesn't shut down, so I can't see logs.
Is there any one can help me with that problem? or is there anyway that I can manual terminate a game session in gamelift console or using terminal? for now I just can terminated all game fleet and start new one, but it's inconvenience.
Thank you very much!
Here is this game session's info:
DNS name: ec2-13-250-1-196.ap-southeast-1.compute.amazonaws.com
Ip address: 13.250.1.196
Port: 7908
Hello,
I created custom service on Game Lift for my game(I use Linux instance) and all works fine, but I also want to use some assets from cloudFront(s3) and it works when I try locally on my machine(PC), but when I create my fleet with my build(linux) I got some errors:
System.Exception: Unable to load ContentCatalogData from location https://*****.cloudfront.net/catalog_2022.******.json on second attempt.
System.Exception: Failed to load content catalog.
OperationException : ChainOperation failed because dependent operation failed
System.Exception: Failed to load content catalog.
UnityWebRequest result : ProtocolError : HTTP/1.1 403 Forbidden
ResponseCode : 403, Method : GET
url : https://*******.cloudfront.net/catalog_2022.******.json
Are there any additional settings so I can access the cloudfront from my instance on gamelite?
Thanks in advance!