|
@@ -1,13 +1,32 @@
|
|
|
# MultiplayerSample Project with Amazon GameLift
|
|
|
|
|
|
-This README covers testing and running MultiplayerSample with Amazon GameLift.
|
|
|
+This README covers optional setup, testing and running on [Amazon GameLift](https://aws.amazon.com/gamelift/), an AWS service to make hosting and scaling game servers easier.
|
|
|
|
|
|
## Running with [Amazon GameLift](https://docs.aws.amazon.com/gamelift/index.html)
|
|
|
|
|
|
### Setup
|
|
|
1. Install the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html), if you don't already have it. You will need it to interact with Amazon GameLift.
|
|
|
-1. Enable the "AWSGameLift" and "MPSGameLift" gem by adding them to MultiplayerSample/Gem/Code/enabled_gems.cmake
|
|
|
-1. Build the server, game launchers, and asset bundler for MultiplayerSample as normal, per [top-level README](/README.md).
|
|
|
+
|
|
|
+ a. Confirm installation by running `aws --version`
|
|
|
+ ```sh
|
|
|
+ C:\> aws --version
|
|
|
+ aws-cli/2.10.0 Python/3.11.2 Windows/10 exe/AMD64 prompt/off
|
|
|
+ ```
|
|
|
+1. Enable the "AWSGameLift" and "MPSGameLift" gems
|
|
|
+
|
|
|
+ Option 1: Commandline
|
|
|
+ ```sh
|
|
|
+ <path-to-o3de-engine>\scripts\o3de.bat enable-gem -pp <path-to-multiplayer-sample> -gn MPSGameLift
|
|
|
+ ```
|
|
|
+ Option 2: Project Manager
|
|
|
+ 1. Open Project Manager
|
|
|
+ 2. Select the "Configure Gems" options for Multiplayer Sample
|
|
|
+ 3. Enable "AWSGameLift" and "MPSGameLift" gems
|
|
|
+
|
|
|
+ 
|
|
|
+ 4. Click "Save"
|
|
|
+
|
|
|
+1. Build the server, game launchers, and asset bundler for MultiplayerSample
|
|
|
```sh
|
|
|
cmake --build build\windows --target Editor MultiplayerSample.GameLauncher MultiplayerSample.ServerLauncher AssetBundler --config profile -- /m /nologo
|
|
|
```
|
|
@@ -16,17 +35,21 @@ This README covers testing and running MultiplayerSample with Amazon GameLift.
|
|
|
cmake --build build\windows --target MultiplayerSample.Assets --config profile -- /m /nologo
|
|
|
```
|
|
|
1. Work in progress (WiP) step: Add your AWS region to Config/default_aws_resource_mappings.json (example: "Region": "us-west-2")
|
|
|
- a. Currently needed otherwise when the client initializes GameLift there will be an error about not having a region.
|
|
|
+
|
|
|
+ a. Currently needed otherwise when the client initializes GameLift there will be an error about not having a region.
|
|
|
+
|
|
|
b. This step will be removed once we properly parse the game-session data which contains the fleet-id, region-id, etc
|
|
|
|
|
|
-## Build Server for Windows (WiP)
|
|
|
-1. WiP Step: Build a profile pak server/game build
|
|
|
- a. This step should be replaced by building a proper release build
|
|
|
+## Build Server for Windows
|
|
|
1. Build Monolithic Server
|
|
|
+
|
|
|
a. cmake -B build\windows_mono -S . -G "Visual Studio 16" -DLY_MONOLITHIC_GAME=1 -DALLOW_SETTINGS_REGISTRY_DEVELOPMENT_OVERRIDES=0
|
|
|
- b. cmake --build build\windows_mono --target MultiplayerSample.GameLauncher MultiplayerSample.ServerLauncher MultiplayerSample.UnifiedLauncher --config profile -- /m /nologo
|
|
|
+
|
|
|
+ b. cmake --build build\windows_mono --target MultiplayerSample.GameLauncher MultiplayerSample.ServerLauncher --config profile -- /m /nologo
|
|
|
1. Bundle Content
|
|
|
+
|
|
|
a. Open .\build\windows\bin\profile\AssetBundler.exe
|
|
|
+
|
|
|
b. Follow steps for "Create a bundle for game assets" and "Create a bundle for engine assets" and "Add bundles to the release game layout" here: https://www.o3de.org/docs/user-guide/packaging/asset-bundler/bundle-assets-for-release/
|
|
|
|
|
|
The "default seed lists" choice should choose all but 4 seed lists to make the engine_pc.pak
|
|
@@ -34,6 +57,7 @@ The other 4 seed lists should all get selected to make the game_pc.pak
|
|
|
It's important to make sure that the bootstrap.game.profile.setreg file has been added to one of the seed files. (also add debug if you want to support debug builds)
|
|
|
1. Create the Launcher Zip file
|
|
|
Use the following .bat file or equivalent copy steps to create a directory with the launchers in it:
|
|
|
+ Run from MultiplayerSample project root directory...
|
|
|
```sh
|
|
|
rem Use this by calling 'make_release C:\GameLiftPackageWindows' to make a release directory
|
|
|
mkdir %1
|
|
@@ -50,7 +74,9 @@ It's important to make sure that the bootstrap.game.profile.setreg file has been
|
|
|
|
|
|
rem Copy the AWSCore files
|
|
|
copy .\build\windows_mono\bin\profile\Gems\AWSCore\*.* %1\Gems\AWSCore
|
|
|
+ ```
|
|
|
1. Test the profile pak server and game locally
|
|
|
+ Run the server in headless mode using `rhi=null` and `NullRenderer` parameters; the server appears as a white screen in headless mode.
|
|
|
```sh
|
|
|
C:\GameLiftPackageWindows\MultiplayerSample.ServerLauncher.exe --rhi=null -NullRenderer -bg_ConnectToAssetProcessor=0 -sys_PakPriority=2 -sv_terminateOnPlayerExit=true --console-command-file=launch_server.cfg
|
|
|
```
|
|
@@ -80,6 +106,12 @@ After running this command it'll take about an hour for the fleet to activate. C
|
|
|
`
|
|
|
aws gamelift create-fleet --region us-west-2 --name GameLiftO3DTest2016 --ec2-instance-type c5.large --fleet-type ON_DEMAND --build-id <BuildId> --runtime-configuration "GameSessionActivationTimeoutSeconds=300, MaxConcurrentGameSessionActivations=2, ServerProcesses=[{LaunchPath=C:\game\MultiplayerSample.ServerLauncher.exe, Parameters= --rhi=null -sys_PakPriority=2 -NullRenderer -sv_terminateOnPlayerExit=true -bg_ConnectToAssetProcessor=0 --sv_gameLiftEnabled=true --sv_dedicated_host_onstartup=false --console-command-file=launch_server.cfg, ConcurrentExecutions=1}]" --ec2-inbound-permissions "FromPort=33450,ToPort=34449,IpRange=0.0.0.0/0,Protocol=UDP"
|
|
|
`
|
|
|
+---
|
|
|
+**NOTE**
|
|
|
+
|
|
|
+The ec2-instance-type and fleet-type determines the kind of AWS resources used; your AWS account may incur costs.
|
|
|
+
|
|
|
+---
|
|
|
|
|
|
Record the FleetId for the next step. Example: fleet-1a49fc3e-892a-40fc-b2e9-aa7e11983182
|
|
|
|