By using AWS re:Post, you agree to the Terms of Use

Questions tagged with Amazon GameLift

Sort by most recent
  • 1
  • 90 / page

Browse through the questions and answers listed below or filter and sort to narrow down your results.

AWS Game Lift Server: Best Solution for Generating and Rotating API Keys for AWS Server Authentication?

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.
1
answers
0
votes
10
views
asked 20 hours ago

Installing NodeJS + NPM in a Build fleet (not Realtime Script)

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.
1
answers
0
votes
27
views
profile picture
asked 21 days ago

Help needed compiling Gamelift for PS5

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!
1
answers
0
votes
17
views
asked a month ago

GameLift Sample Code

Does a collection of GameLift service samples exist? I'm developing a Battle Royale game in Unity using the Unity Plugin for GameLift and I have the basics functioning.. starting with CloudFormation template deployment, FlexMatch with game session queue, and automatic backfill. Now I'm starting to build a Lobby system, where a player can create/join/apply to join/invite to join other online clients. This seems like something that should exist in sample code (CloudFormation template, Lambda files, DynamoDB tables, SNS Topic Event Handlers, etc.). Does it? I may have it built and working by the time I get a response here, but here's what I'm thinking. LobbyTable LobbyId PlayerId # lobby owner TicketId # matchmaking ticket id PlayerLobbyTable PlayerId LobbyId Lambda functions to handle setting up a table items when a player: creates a lobby # creates LobbyTable item for PlayerId as owner application/invitation is accepted # creates PlayerLobbyTable item for PlayerId leaves/booted from lobby # deletes PlayerLobbyTable item of leaving PlayerId, picks new lobby owner and assigns if anyone remains in lobby or deletes LobbyTable for LobbyId if no players remain change lobby owner # changes LobbyTable PlayerId to new lobby owner update matchmaking ticket id # when FlexMatch MatchmakingSucceeded event, add IpAddress, Port, DnsName, etc. attributes to LobbyTable item, send message to all players in lobby that the matchmaking succeeded. Thank you.
1
answers
0
votes
73
views
asked 3 months ago

GameLiftLocal Crashes when commands are given to it

We are in the process of testing GameLift for our game. We have created an Amazon Linux 2 VM under Virtual Box and have a working sample server form Github working and also have GameLiftLocal running on the machine. We run Gamelift running the following command: ``` [ec2-user@vm_gamelift3 GameLiftLocal-1.0.5]$ java -jar GameLiftLocal.jar ``` This seems to result in a successful startup: ``` 05:22:54,823 INFO || - [SocketIOServer] main - Session store / pubsub factory used: MemoryStoreFactory (local session store only) 05:22:59,344 WARN || - [ServerBootstrap] main - Unknown channel option 'SO_LINGER' for channel '[id: 0x88185e57]' 05:22:59,353 INFO || - [SDKConnection] main - GameLift SDK server (communicates with your game server) has started on http://localhost:5757 05:22:59,390 INFO || - [SocketIOServer] nioEventLoopGroup-2-1 - SocketIO server started at port: 5757 05:22:59,450 INFO || - [SdkWebSocketServer] WebSocketSelector-13 - WebSocket Server started on address localhost/127.0.0.1:5759 05:22:59,655 INFO || - [StandAloneServer] main - GameLift Client server (listens for GameLift client APIs) has started on http://localhost:8080 05:22:59,705 INFO || - [StandAloneServer] main - GameLift server sdk http listener has started on http://localhost:5758 ``` We also get a good connection when starting up the game server sample locally. However, when we attempt to issue the local server a command, it always comes back with an exception ``` [ec2-user@vm_gamelift3 ~]$ aws gamelift create-game-session --endpoint-url http://127.0.0.1:5758 --maximum-player-session-count 2 --fleet-id fleet-123 ``` ``` An error occurred (NullPointerException) when calling the CreateGameSession operation (reached max retries: 4): ``` The server does not completely crash, but does give a warning and a call stack of the exception that was caught ``` 05:25:31,497 WARN || - [GameLiftSdkHttpHandler] GameLiftSdkHttpHandler-thread-0 - Caught exception java.lang.NullPointerException at com.amazon.gamelift.handlers.GameLiftSdkHttpHandler.validateHeaders(GameLiftSdkHttpHandler.java:84) at com.amazon.gamelift.handlers.GameLiftSdkHttpHandler.handle(GameLiftSdkHttpHandler.java:55) at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79) at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:83) at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:82) at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:700) at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:79) at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:672) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) 05:25:31,554 WARN || - [GameLiftSdkHttpHandler] GameLiftSdkHttpHandler-thread-0 - Caught exception null ``` This exception also occurs when we just try to describe the sessions, so it seems to be any command you issue the jar on that socket. How do I resolve this so that I can get to actually testing my code? Thank you! David
2
answers
0
votes
48
views
asked 3 months ago

Turning off automatic backfill near end of game session (FlexMatch matchmaking)

Hi, I have enabled "automatic backfill" in my matchmaking configuration per the instructions in the docs: "Turn on automatic backfill" section of [https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-backfill.html](https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-backfill.html). The backfilling itself works well. Calls from my client service to "StartMatchmaking" will, when expected, return a match to an existing game session. The problem I'm trying to solve now is that I don't want players to be backfilled into a game that's almost over. Item #4--"Turn off automatic backfill for a game session"--doesn't seem to work when I try to implement it on my game server: > **4. Turn off automatic backfill for a game session**. You can opt to stop automatic backfill at any point during an individual game session. To stop automatic backfill, add code to your game client or game server to make the GameLift API call StopMatchmaking. This call requires a ticket ID. Use the backfill ticket ID from the latest backfill request. You can get this information from the game session matchmaking data, which is updated as described in the previous step. What confuses me here is that I want to stop backfilling near the end of the game regardless of whether the game session has backfilled any players yet. The line "Use the backfill ticket ID from the latest backfill request" doesn't make sense if no backfill tickets have been received in the game session. Intuitively, it feels like there should just be some API I can call that opts a particular game session out of future backfill requests but I'm not seeing it. Any help would be greatly appreciated.
6
answers
0
votes
23
views
asked 4 months ago

Client not receiving RTS message

I'm having trouble with one particular piece of code that is supposed to be sending a message to a client. Both pieces of code below are from my Realtime Server Script: ``` function onPlayerAccepted(player) { logger.info("..New player accepted: " + player.peerId); const newPlayerMessage = session.newTextGameMessage(OP_CODE_PLAYER_ACCEPTED, session.getServerId(), JSON.stringify(galaxyAndLocalPlayerState)); session.sendReliableMessage(newPlayerMessage, player.peerId); } ``` The above block within my realtime server script runs when a player is accepted, and the message is successfully received by the client (Unity). On the client side, logs show that OnDataReceived() **is called**. RTS Logs for above call: 02 Mar 2022 03:59:32,191 [INFO] (ManhuntServerScript.js) 96: ..New player accepted: 1 02 Mar 2022 03:59:32,191 [INFO] (index.js) 333: Received custom game message from sender: -1 with opCode: 100, targetPeerId: 1, targetGroupId: 0 ``` function onMessage(gameMessage) { switch (gameMessage.opCode) { case OP_CODE_TRAVEL_REQUEST: logger.info("..Travel Request Received from Peer " + gameMessage.sender + " to PlanetId: " + gameMessage.getPayloadAsText()); const travelResponseMessage = session.newTextGameMessage(OP_CODE_TRAVEL_BEGIN, session.getServerId(), JSON.stringify(playerStates)); session.sendReliableMessage(travelResponseMessage, gameMessage.sender); break; default: logger.info("..Unrecognized Op Code received: " + gameMessage.opCode); break; } } ``` The above block shows the message is being sent in the server logs, but is not received by the Unity client. I have ensured the op codes match. On the client side, logs show that OnDataReceived() **is NOT called**. RTS logs for above call: 02 Mar 2022 03:59:36,628 [INFO] (index.js) 333: Received custom game message from sender: 1 with opCode: 200, targetPeerId: -1, targetGroupId: 0 02 Mar 2022 03:59:36,628 [INFO] (ManhuntServerScript.js) 136: ..Travel Request Received from Peer 1 to PlanetId: 2 02 Mar 2022 03:59:36,629 [INFO] (index.js) 333: Received custom game message from sender: -1 with opCode: 102, targetPeerId: 1, targetGroupId: 0 --- The only thing I can think of is that possibly a realtime server can't send a message within onMessage() but that seems silly to me. Thanks in advance for any insight!
9
answers
0
votes
3
views
asked 5 months ago

FlexMatch long matchmaking time

We are using the following matchmaking ruleset with a standalone configuration ``` { "name": "MatchmakingRuleset", "ruleLanguageVersion": "1.0", "algorithm": { "backfillPriority": "high", "batchingPreference": "random", "strategy": "exhaustiveSearch" }, "playerAttributes": [ { "name": "tournamentDefinitionID", "type": "string" }, { "name": "skill", "type": "number", "default": 0 } ], "teams": [ { "name": "player", "minPlayers": 0, "maxPlayers": 1, "quantity": 4 } ], "rules": [ { "name": "SameTournament", "description": "Match players to play in the same tournament type", "type": "comparison", "operation": "=", "measurements": ["flatten(teams[*].players.attributes[tournamentDefinitionID])"] } ] } ``` Since minPlayers is 0 for all teams, that means that when there are no other players matchmaking at the moment and no backfilling tickets, players can get a successful match with just their own ticket, in which event we create a new game, and the player enters this game alone. We then call startMatchBackfill with the same configuration and repeat the process until the game is full. This mean that at any given moment, any submitted ticket "should" always result in a MatchmakingSucceeded callback, so theoretically there should be no waiting for matchmaking. For some reason we are experiencing wait times of 5-10 seconds from when we call startMatchmaking until our matchmaking event listener lambda is called (wired through EventBridge), is there any way to speed this up? Is this a technical constraint? Is FlexMatch waiting for more tickets to enter the pool, and is there a way to configure this?
4
answers
0
votes
10
views
asked 6 months ago

GameLift adds support for more complex rules logic and longer string lists in FlexMatch

Hello GameLift devs, Today, the GameLift team is excited to announce three updates to FlexMatch. The updates expand existing matchmaking functionality that will allow you to create more evenly matched players teams with greater precision. The three updates are as follows: * **Support for compound rules**. Today, the behavior in a FlexMatch [matchmaker rule set](https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-rulesets.html) is that all of the rules must hold true to form a match. Effectively this means that all rules use the “AND” logical operator. With compound rules, more complex constructs are possible. FlexMatch now supports the following additional logical operators in addition to “AND”: “OR”, “NOT”, and “XOR”. * **Longer string lists**. FlexMatch allows you to pass in different [player attributes](https://docs.aws.amazon.com/cli/latest/reference/gamelift/start-matchmaking.html) to FlexMatch, e.g., numbers, strings, or a list of strings. String lists are currently limited to 10 strings. With today’s update, that limit is increased to 100. One common use case is to use the string list as a “blocklist” for players. Now, instead of blocking only 10 players, you can block up to 100. * **More flexible team selection**. FlexMatch “[property expressions](https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-rules-reference-property-expression.html)” are used to perform logical operations with player attributes regarding team selection. Previously, they were limited to apply to one or all teams, only. With today's update, you can use property expressions to target more than one team without having to target all teams. We’re excited to see what you can do with this greater flexibility with FlexMatch rules logic. For more information, please refer to the following links. [Compound rules](https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-rules-reference-ruletype.html) [Property expressions](https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-rules-reference-property-expression.html) [API reference for string list attribute](https://docs.aws.amazon.com/gamelift/latest/apireference/API_AttributeValue.html#gamelift-Type-AttributeValue-SL) Mark Choi, GameLift PM
1
answers
0
votes
11
views
asked 6 months ago

How to communicate with GameLift Server with Java Client

I have a Java Client I am attempting to integrate with GameLift. I am able to use it to search for Active Fleets, Search Game Sessions, Create Game Sessions and Create Player Sessions. I do not know where to go from there. What API or Java method is used to communicate with the Server. I have the example Server setup and running. The example server code is shown here: https://docs.aws.amazon.com/gamelift/latest/developerguide/realtime-script.html The Java code I have written: //////////////////////////////////////// AmazonGameLift gameLift = AmazonGameLiftClientBuilder.standard() .withCredentials(new AWSStaticCredentialsProvider(credentials)) .withRegion("us-east-2") .build(); DescribeFleetAttributesRequest dfar = new DescribeFleetAttributesRequest(); DescribeFleetAttributesResult describeFleetResult = gameLift.describeFleetAttributes(dfar); CreateGameSessionRequest cgsRequest = new CreateGameSessionRequest().withFleetId(describeFleetResult.getFleetAttributes().get(0).getFleetId()) .withName("Sim Game") .withMaximumPlayerSessionCount(MAX_PLAYERS); CreateGameSessionResult cgsResult = this.gameLift.createGameSession(cgsRequest); byte[] array = new byte[[PLAYER_ID_LENGTH]]; // length is bounded by PLAYER_ID_LENGTH new Random().nextBytes(array); String playerID = new String(array, Charset.forName("UTF-8")); CreatePlayerSessionRequest cpsRequest = new CreatePlayerSessionRequest().withGameSessionId(cgsResult.getGameSession().getGameSessionId()) .withPlayerId(playerID); CreatePlayerSessionResult cpsResult = this.gameLift.createPlayerSession(cpsRequest); //////////////////////////////////////////////////////////////////////////////////////// I am assuming there is a way to communicate using to the Server using some call to cpsResult. My theory is to use cpsResult.getPlayerSession().marshal() But I do not understand how to use the marshall function. void marshall(ProtocolMarshaller protocolMarshaller) I am also not sure that is even the correct function to use. If anyone can point me in the right direction to start attempting Server communication I would be very grateful.
1
answers
0
votes
32
views
asked 7 months ago

Queue priorities with Spot fleets

Hi. According to documentation: https://docs.aws.amazon.com/gamelift/latest/developerguide/queues-best-practices.html#queues-design-spot >* When configuring priorities for a queue with Spot fleets, place cost near the top of the list. This will ensure that locations on Spot fleets will always take precedence over locations on On-Demand fleets, when available. Also: https://docs.aws.amazon.com/gamelift/latest/developerguide/tutorial-queues-spot.html > Prioritize the fleets in your queue. Fleet prioritization determines where the queue looks first when searching for available resources to host a new game session. You might choose to prioritize by Region, instance types, fleet type, and so on. When working with Spot fleets, we recommend either of the following approaches: > * If your infrastructure uses a primary Region with fleets in a second Region for back-up only, you want to prioritize fleets first by region, and then by fleet type. With this approach, all fleets in the primary Region are placed at the top of the list, with Spot fleets followed by On-Demand fleets. > * If your infrastructure uses multiple Regions equally, you want to prioritize fleets by fleet type, placing Spot fleets at the top of the list. I have a setup with 10 fleets (5 per region): 1 x On-Demand - c5.xlarge 4 x Spot - c5.xlarge, c5.2xlarge, r5.xlarge, m5.xlarge I've placed the On-Demand fleets last in the Queue and still the players are routed to those two On-Demand fleets instead of Spot ones. We are making the placements based on reported player latency. What am I missing? What is the explanation for this behavior? Thank you.
1
answers
0
votes
2
views
asked 9 months ago

How to SSH to instance and replace build in-place to iterate quickly

Hi folks, Just want to share some knowledge on how to iterate game server development quickly with a single fleet. The best practice is still to test out your server SDK integration with [GameLift Local](https://docs.aws.amazon.com/gamelift/latest/developerguide/integration-testing-local.html) first, to make sure you can successfully respond to a heartbeat. Otherwise, your fleet might go into ERROR if you deploy an untested build. However, GameLift Local is quite limited currently and doesn't support all features obtainable from Server SDK, so, sometimes it might be necessary to test in the actual GameLift EC2 environment. But there is another problem, uploading an updated build build and getting a new fleet to go ACTIVE takes a long time (20-40 minutes depending on your build) and is not viable for quick iteration. GameLift is currently working on revamping this process, in the mean time, here is a workaround: 1. Create a fleet with port 22 open. It's always a good idea to open port 22 for development, in case fleet is stuck in ACTIVATING and you cannot modify port settings until fleet is ACTIVE. Sample command: ``` aws gamelift create-fleet --region us-west-2 \ --name "TestFleet" --ec2-instance-type c5.large \ --ec2-inbound-permissions FromPort=6250,ToPort=6280,IpRange="0.0.0.0/0",Protocol=TCP FromPort=22,ToPort=22,IpRange="0.0.0.0/0",Protocol=TCP \ --build-id <build-id> \ --runtime-configuration ServerProcesses="[{LaunchPath="/local/game/gamelift-test-app",Parameters='port:6251 gameSessionLengthSeconds:10',ConcurrentExecutions=1},\ {LaunchPath="/local/game/gamelift-test-app",Parameters='port:6252 gameSessionLengthSeconds:10',ConcurrentExecutions=1}]" ``` 2. Once the fleet is ACTIVE, run the following script (you can also do this after the fleet has been ACTIVATING for a while, or is stuck in ACTIVATING, so that EC2 instance is created) ``` if [ "$#" -ne 1 ]; then echo "Usage: ./sshhost.sh fleetid" exit 1 fi FLEET_ID=$1 echo Fleet Id is $FLEET_ID aws gamelift update-fleet-****** INSTANCE_ID=$(aws gamelift describe-instances --fleet-****** echo Instance Id is $INSTANCE_ID IP_ADDRESS=$(aws gamelift describe-instances --fleet-****** echo IP Address is $IP_ADDRESS rm -rf /tmp/gamelift.pem aws gamelift get-instance-access --fleet-****** chmod 400 /tmp/gamelift.pem echo SSHING to host at $IP_ADDRESS ssh -i /tmp/gamelift.pem gl-user-remote@$IP_ADDRESS ``` 3. Run "`sudo su`" to assume the root access 4. Run "`rm -rf /local/game/``<FILES IN THE BUILD>` ” to unlink and delete the old build (it’s important to run rm instead of mv to unlink the running process, see stack overflow post: https://stackoverflow.com/questions/1712033/replacing-a-running-executable-in-linux) 5. Upload the new build to "/local/game" using SCP, sample command: ``` scp -i <path-to-gamelift.pem> <path-to-new-build> \ gl-user-remote@<ec2-ip-or-dns-name>:/local/game/<path-to-old-build> ``` 6. Run “`chown gl-user-server:gl-user ` `<FILES IN THE NEW BUILD>`” , need to use “`--resursive`” if you have directories, this will set the new files to the right permission so that the GameLift onbox process manager ("AuxProxy") can read them. 7. Run "`ps -efww | grep "sudo -H -E -u gl-user-server`” to get the running process ids 8. Run “`kill -9 ` `<PID>`” to kill the running processes, GameLift onbox process manager ("AuxProxy") will try to spin up a new process afterwards 9. Poll “`ps -efww | grep "sudo -H -E -u gl-user-server`” until a new process shows up 10. Create game sessions and connect the client to the new server build to test! 11. Repeat step 4-10 to iterate on the server builds.
2
answers
0
votes
27
views
asked 9 months ago

Running container-based games on GameLift

Hi everyone! Since GameLift has a limit of up to 50 game sessions per hardware node, I am trying to find anyway, how can I run more than 50 sessions per node (since the limit of 50 game sessions per node is a REALLY huge waste of resources for my lightweight game). The suggested way was to manage set up FleetIQ manually with EC2 machines (possibly with some built-in autoscaling mechanism). This way should work for us, except for one thing - in this case, we need to run raw binaries instead of containers. If we use simple binaries, we need to work somehow with monitoring, logging, implementing blue-green or canary deployments, and so on. All these concerns can be solved in an easier way by using containers. With the "containers" word I mean Docker container in this case. But running containers on raw EC2 instances seems like is not convenient enough: implementing things like blue-green or canary deployments is not really trivial, etc. I am thinking about the way with AWS ECS, based on EC2 instances. In this case, I can run 1 game session per container as much per node as I can. Fargate is not applicable in my case since the minimal limits for Fargate tasks are too huge for us and it will be a waste of computing resources again. My question is: Can I use GameLift with ECS at the same time? Why I want to use GameLift: it provides more robust Spot instances and these instances will be more suitable for the game. P.S. I also thought about AWS EKS with something like Agones but it's overkill for us, and managing EKS for us is too complex a task. @REDACTEDUSER
2
answers
0
votes
27
views
asked 9 months ago

GameLift adds Osaka and FleetIQ now supports Graviton2-powered instances for better price performance

Hi Game Devs, Today, we are excited to announce an update to Amazon GameLift that increases coverage for developers and enhances seamless, low-latency gameplay experiences for players in Japan. This update adds Asia Pacific (Osaka) Region to GameLift and enables our game developer customers to place servers in their multi-region fleets closer to players’ actual regional locations in Japan with Asia Pacific (Osaka) and Asia Pacific (Tokyo) regions. We are also happy to introduce that GameLift FleetIQ now supports next-generation [AWS Graviton2 processors](https://aws.amazon.com/ec2/graviton/). You can now use Graviton2-hosted game servers, based on the Arm-based processor architecture, in FleetIQ to achieve increased performance at a lower cost when compared to the equivalent Intel-based compute options. To learn more about this update, please visit [our blog post](https://aws.amazon.com/blogs/gametech/now-available-new-asia-pacific-osaka-region-and-graviton2-support-for-amazon-gamelift/). In summary, this GameLift update will: * **Deliver lower player latency from increased global coverage.** Now with 23 regions with the launch of Osaka region, game developers can place players closest to where they are playing to ensure a smooth experience using GameLift’s multi-region fleet. * **Better performance at lower cost.** GameLift FleetIQ now supports Graviton2-powered instances, including c6g, m6g, r6g instance families. Available regions are Asia Pacific (Mumbai), Asia Pacific (Seoul), Asia Pacific (Singapore), Asia Pacific (Sydney), Asia Pacific (Tokyo), Canada (Central), Europe (Frankfurt), Europe (Ireland), Europe (London), South America (Sao Paolo), US East (N. Virginia), US East (Ohio), and US West (N. California), US West (Oregon). Best, Yi-Min GameLift Product Manager
0
answers
0
votes
2
views
asked 9 months ago

GameLift Plug-in for Unity now available

Hello GameLift devs, Today, the GameLift team is excited to announce the general availability of the GameLift Plug-in for Unity. With this update, you can use native Unity user interfaces and workflows to access GameLift APIs and deploy AWS CloudFormation templates for common gaming scenarios. The GameLift Plug-in for Unity provides everything you need to access GameLift APIs. After downloading and installing the plugin package into your Unity development environment, you can use the native plugin UI to configure their plugin settings, perform local testing of builds of their game server, and import and run a sample Unity game. The GameLift Unity plugin also includes five pre-built CloudFormation sample scenarios that you can customize for their game, making it easier to integrate GameLift with AWS. The five deployment scenarios include: * **Auth Only** - this scenario create a game backend service that performs player authentication. * **Single-Region Fleet** - this scenario creates a game backend service with a single GameLift fleet. * **Multi-Region Fleets with Queue and Custom Matchmaker** - in this scenario, GameLift queues are used in conjunction with a customer matchmaker. The custom matchmaker forms matches by taking the oldest players in the waiting pool. When there are enough players for a match, the AWS Lambda handler starts a queue placement. * **SPOT Fleets with Queue and Custom Matchmaker** - this scenario is the same as Multi-Region Fleets with Queue and Custom Matchmaker except it configures three fleets. Two of the fleets are SPOT fleets containing nuanced instance types. * **FlexMatch** - this scenario uses GameLift FlexMatch, a customizable matchmaking service for multiplayer games. You can deploy these five scenarios from the GameLift Plug-in for Unity. Get stated now by visiting our GitHub page: https://github.com/aws/amazon-gamelift-plugin-unity. For more information, please refer to our [Release Notes](https://docs.aws.amazon.com/gamelift/latest/developerguide/release-notes.html#release-notes-summary) and [What’s New](https://aws.amazon.com/about-aws/whats-new/2021/09/aws-amazon-gamelift-plug-in-aws-cloudformation-templates-unity/) post. Mark Choi, GameLift PM
3
answers
0
votes
17
views
asked a year ago
  • 1
  • 90 / page