Upload the dedicated server to AMS - Game server integration - (Unreal Engine module)
Package Linux dedicated server
To upload your dedicated server to AccelByte Multiplayer Servers (AMS), you need to package your game as a Linux game server. To do this, you need to install the the Cross-Compile Toolchain. For more information, see Development Requirements from Unreal. After downloading and installing the Cross-Compile Toolchain, restart your computer and follow the steps below.
Open your Byte Wars project in the Unreal Engine editor.
Package your project by going to Platforms > Linux, selecting Shipping and AccelByteWarsServer, and clicking Package Project. Then, save the project to a location on your computer.
Upload server image to AMS
You will use AccelByte tool to upload your linux game server to AMS.
Log in to the Admin Portal and go to your game namespace dashboard.
From the side bar menu, select Multiplayer Server Configuration > Download Resource.
Then, download the AMS Command Line Interface (CLI) For Windows (amd64). The ams.exe file should be downloaded.
The next step is to upload the Linux dedicated server using the AMS CLI. Run ams.exe using a Windows PowerShell with the following command. Please use the client ID and client secret of your CLI IAM client to replace
<AMSCLI_ClientID>
and<AMSCLI_ClientSecret>
..\ams.exe upload -H <AMS_HostURL> -c <AMSCLI_ClientID> -s <AMSCLI_ClientSecret> -n <DSImageName> -p <DSAbsoluteLocalPath> -e AccelByteWarsServer.sh
備考Here are the details of the AMS CLI command to upload your dedicated server.
-H
: the AMS host URL depending on where you run your AGS namespace. For AGS Private Cloud, your host URL is<studio_name>.accelbyte.io
. For AGS Shared Cloud, your host URL isprod.gamingservices.accelbyte.io
.-c
: the IAM client ID used to authenticate. Set it to the IAM client ID from the AMS CLI IAM client you created from the previous tutorial section.-s
: the IAM client secret used to authenticate. Set it to the IAM client secret from the AMS CLI IAM client you created from the previous tutorial section.-n
: the name of the dedicated server image after the upload process is complete. It can be anything, but make it meaningful. For example,2.7.5-unreal-bytewars
which indicate the server version.-p
: the absolute local path to the server directory to upload. For example,C:/Documents/ByteWars/LinuxServer
.-e
: the dedicated server executable within the server directory. In this case, the executable is theAccelByteWarsServer.sh
file.
Once the uploading process is finished, your new dedicated server image will be listed on the Admin Portal. You can check it from the side bar menu of the dashboard, select Multiplayer Server Configuration > Server Images. There will be two states after the upload process:
- Uploaded: the dedicated server binaries successfully uploaded.
- Complete: the dedicated server image was successfully created and is ready to go. It takes a few minutes for the DS image state changes from uploaded to complete.
Create a fleet to manage the dedicated server
AMS fleets function to scale virtual machines and manage dedicated servers that are hosted within those virtual machines based on regional configurations. In this section, you will learn how to create a fleet for your game.
Log in to the Admin Portal and go to your game namespace dashboard.
From the side bar menu, select Multiplayer Server Configuration > Fleet Manager.
Next, locate the Region List section and toggle the regions where you want your dedicated servers to be deployed. In this tutorial, we enable the ap-southeast-1 and us-east-2 regions.
Then, click Create Fleet > Create New to create a new fleet.
On the new Fleet & Image tab, fill in fleet name and select the server image that you just uploaded. The fleet name can be anything, but to make it simpler, you can use the same name as the server image name. Once done, click the Next button.
On the Deployment Profile tab, leave Timeout and Port Configuration configs as default. For Command Line config, enter the default command below. The command below configures the dedicated server so it can be managed by AMS. Once done, click Next button.
-dsid=${dsid} -port=${default_port}
On the DS Host tab, you can select a Virtual Machine (VM) instance type based on your need. For this tutorial, let's use a small instance. Select the ttx1.s for the Host Instance and set the Dedicated Servers number to 2. This configuration tells the fleet to spawn two dedicated servers on the selected VM instance. Once done, click Next.
On the Region tab, expand the enabled regions, in this example is the ap-southeast-1 and us-east-2. Locate the Pencil icon under the Action column to edit how many dedicated server should be deployed by the fleet. For this tutorial, set the Min Servers to 0, Max Servers to 1, and the Buffer Value to 1.
備考- Min Servers: The minimum number of servers that the deployment needs to maintain, regardless of whether the servers are in the "Ready" (warmed buffer) state or "In Session" (serving a game session) state.
- Max Servers: The maximum number of servers that the region can maintain. This value is useful as a limiter to make sure the cost of game servers will not go over budget.
- Buffer Value: The buffer value tells the fleet the number of servers to maintain as warmed buffers.
On the Log & Artifacts Sampling tab, we want the dedicated server able to generate logs. To do this, enable the Enable Log Sampling option and set the samples to 100%. This config lets the dedicated server to log every single events. Once done, click the Next button.
On the Summary tab, you can review your fleet configurations. Now, click the Create button.
Now, your fleet should be created and available on the fleet list. Open the fleet details by clicking on the fleet name.
On the top left, just under the fleet name, you should see Fleet status with a toggle next to it. Click the toggle to activate the fleet. In a few minutes, you should see a list of servers and its status in the Dedicated Server List section.
備考A new fleet will take around around 10 minutes to get the dedicated server to up and running before you can see them in the list. Below are the states of the dedicated servers on a fleet.
- Creating: the dedicated server is currently initializing (not yet calling the send ready message to AMS watchdog).
- Ready: the dedicated server has sent a ready signal to AMS and is ready to go.
- Claiming: the fleet manager is currently claiming the dedicated server to a session using a claim key.
- Claimed: the dedicated server is already bound to a game session and the game is currently in progress.
- Removed: the dedicated server is removed from the fleet.
Create claim keys for the fleet
Log in to the Admin Portal and go to your game namespace dashboard.
From the side bar menu, select Multiplayer Server Configuration > Fleet Manager. Then, click on the name of your fleet you created from the previous tutorial.
Under the Fleet Information section, click the Add More button next to the Claim Keys attribute. For this tutorial, you need to input a new claim key namely unreal-ds-ams.