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

Questions tagged with Game Server Hosting & Backends

Sort by most recent
  • 1
  • 12 / page

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

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
40
views
profile picture
asked a month ago

Where to get started as a C/C++/C# developer?

Hello everyone, I've been a software and game developer for well over a decade, and I feel very at home with C, C++ and C#/.NET. I've done a lot of programming with DirectX SDKs and Unity, as well as desktop and mobile development. However, I don't really know much at all about the web and networking. But now I'm becoming very interested in what kinds of things I can do with AWS in game development, as well as with blockchain, AI/ML and cloud computing power. There seems to be more AWS services and packages than I can count though, and I'm really not sure which ones I should be pursuing and trying to learn more about and which ones are irrelevant to me and my job. The list of services, SDKs and packages is as impressive and inspiring as it is overwhelming and confusing! I'd like to be able to deploy some .NET applications to AWS to provide remote APIs for games and applications. To start with and get the hang of it, I just want to make a little minigame that lives on a server that a Unity or Unreal game can interact with through http requests. And I'll incrementally add some features to it as I start to get the hang of it. I'd also like to do some experimentation with blockchain software and services and see what kinds of interesting things can be accomplished with it. And beyond that, I'd eventually like to get into using AI/ML to accomplish goals in games and apps, harness cloud-based CPU/GPU processing power for heavy-lifting and even setup some real-time multiplayer game servers. I just don't know what tools/services/packages I need to dive into and start figuring out. I've found [the Visual Studio 2022 AWS package here](https://marketplace.visualstudio.com/items?itemName=AmazonWebServices.AWSToolkitforVisualStudio2022&ssr=false#overview), as well as [this AWS GitHub page](https://github.com/aws/dotnet) for .NET. I've also heard about Lambda. I really have no idea which ones are relevant to me or where I should start with this. To begin with, I want to run a .NET application on a server that applications can query and interact with and have it store and supply data for them, offer some remote APIs and requests, etc. I'd also potentially be interested in running some native C/C++ modules on servers. Can someone point me in the right direction and tell me what I need to set up and dive into first? I'm doing this in my free time when I'm not working on projects for work, so my time is very limited and researching and learning the wrong things would be a big setback for me. Any help or guidance is greatly appreciated!
1
answers
0
votes
25
views
asked 6 months ago
  • 1
  • 12 / page