メインコンテンツまでスキップ

Unreal Engine Module - Run a Dedicated Server on AccelByte Multiplayer Server (AMS) - Upload the dedicated server to AMS

Last updated on January 13, 2024

Set up an AMS account

To use the AccelByte Multiplayer Servers (AMS) service, you need to configure it first. In this section, you will learn how to create an initial server configuration for your AMS.

  1. Open your Demo AGS Admin Portal dashboard. Select your game namespace and go to AccelByte Multiplayer Servers > Setup AMS Account.

  2. Under Don't have a AMS Account?, enter an account name.

  3. Click Create and then Yes on the confirmation notice.

Congratulations! You have created an AMS account.

Upload dedicated server to AMS

In order to upload your dedicated server to AMS, you need to package your game as a Linux game server. To package a Linux game server in Unreal Engine, you need to install the Cross-Compile Toolchain. You can download it from the Unreal Engine website here. From that website, find the version history section and download and install the -v20 clang-13.0.1-based version. Once it is installed, restart your computer and follow the steps below.

Unreal Engine cross-compile toolchain download website

  1. Open your Byte Wars project in the Unreal Engine editor.

  2. In the Unreal 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.

    Unreal Engine editor package project for Linux server

  3. Open your Demo AGS Admin Portal dashboard. Select your game namespace and go to AccelByte Multiplayer Servers > Download Resource.

  4. Click the Download button to download the AMS Command Line Interface For Windows (amd64).

  5. Place the downloaded ams.exe file in the same parent directory as the packaged project folder you created in Step 2 of this section.

    Windows explorer showing ams.exe in the same directory as the packaged Byte Wars server project folder

  6. The next step is to upload the Linux dedicated server using the AMS CLI. Run ams.exe using a Windows Command Prompt with the following batch command. Please use your own the client ID and client secret from the IAM Setup tutorial of this module to replace <AMSCLI_ClientID> and <AMSCLI_ClientSecret>.

    ams.exe upload -H demo.accelbyte.io -c <AMSCLI_ClientID> -s <AMSCLI_ClientSecret> -n unreal-bytewars-v1.0.19-ams-1 -p C:/Users/ab-dev/Documents/ByteWars -e AccelByteWars/Binaries/Linux/AccelByteWarsServer
    ヒント

    Use the template command below to upload the dedicated server binaries to AMS using AMS CLI:

    ams.exe upload -H <AMSHostURL> -c <AMSCLI_ClientID> -s <AMSCLI_ClientSecret> -n <DSImageName> -p <DSPathAbsolute> -e <DSLinuxBinary>

    Here are the details of each mandatory field. Replace them with your own credentials.

    • AMSHostURL: the platform url (e.g., demo.accelbyte.io).
    • AMSCLI_ClientID: the IAM client ID used to authenticate.
    • AMSCLI_ClientSecret: the IAM client secret used to authenticate.
    • DSImageName: the name of the dedicated server image that will be built later after the upload process is complete.
    • DSPathAbsolute: the path to the directory to upload.
    • DSLinuxBinary: the relative path within the directory to upload the dedicated server executable to run.
  7. Once the uploading process is finished, your new dedicated server image will be listed on the AccelByte Multiplayer Servers > Server Images page of the AGS Admin Portal. 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.

    AGS Admin Portal Server Image List

Congratulations! You have successfully uploaded your dedicated server to AMS. The next step is to create a fleet to deploy and manage the DS.

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. Follow the steps below to create a fleet.

  1. Open your Demo AGS Admin Portal dashboard. Select your game namespace and go to AccelByte Multiplayer Servers > Fleet.

  2. Next, enable the regions where you want the fleet to be deployed. In this tutorial, we enable the ap-southeast-1 and us-east-2 regions. Then, click on the Create Fleet button to create a new fleet.

    Create Fleet Enable Fleet Region step

    注記

    Create Fleet will walk you through five steps: Fleet & Image, Deployment Profile, DS Host, Region, and Summary.

  3. For the Fleet & Image step, fill in fleet name bytewars-ams-fleet1 and select the dedicated server image that we just uploaded. Then, click Next.

    Create Fleet Fleet &amp; Image step

  4. For Deployment Profile, leave Timeout and Port Configuration as default. For Command Line, enter the following command: -dsid=${dsid} -port=${default_port} -log=${log_file} -watchdog_url=${watchdog_url}. Then, click Next.

    注記

    Leaving Port Configuration as default will override Unreal Engine's port configuration.

    Create Fleet Deployment Profile step

  5. On the DS Host step, for VM Instance, select glx1.2x. Set the Number of server to 1. Then, click Next.

    Create Fleet DS Host step

  6. For Regions, expand the ap-southeast-1 and us-east-2 regions, click the edit icon under the Action column next to them, and set the following configurations to each region:

    • Min Servers: 0
    • Max Servers: 1
    • Buffer Value: 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. This value is useful to handle the baseline concurrent users by ensuring that there are enough servers ready to go.
    • 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 exact number of servers to maintain as warmed buffers.

    Create Fleet Regions step

  7. For Summary, review your fleet's configurations. If it looks how you want it, click Create and activate it.

    Create Fleet Summary step

  8. Here what its look like after we activated the fleet. Note that it will some time to get the dedicated server to up and running.

    AGS Admin Portal Fleet Information page

Congratulations! You have successfully created an AMS fleet. The next step is to adjust the session configuration to use our fleet for Byte Wars matchmaking.

注記

It will take some time to spin up the new virtual machines and its dedicated server. Once the virtual machine is up, you will be able to see the status of the dedicated server in the fleet details under the dedicated server list. Below are the states of the dedicated server readiness:

  • 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.

Set up a game session to use an AMS dedicated server

In this section, you will learn how to set up the game session to use the dedicated server from our new AMS fleet.

Create claim keys for the fleet

  1. Open your Demo AGS Admin Portal dashboard. Select your game namespace and go to AccelByte Multiplayer Servers > Fleet. Then, click on the fleet we created in this tutorial.

  2. Under the Fleet Information section, click the + Add More button next to the Claim Keys field and add bytewars-ams-test.

    AGS Admin Portal Fleet Information page

Set up the session configuration

  1. Open your Demo AGS Admin Portal dashboard. Select your game namespace and go to Game Management > Matchmaking v2 > Session Templates. Then, click Add Session Template.

  2. Fill in the session template as follows and click on the Add button once completed:

    • Session Template Name: unreal-elimination-ds-ams
    • Session Type: DS-AMS,
    • Claim Keys: bytewars-ams-test
    • Requested Regions: ap-southeast-1 us-east-2
    • Min Players: 1
    • Max Players: 4
    • Joinability: Open

    AGS Admin Portal Add Session Template for Unreal dedicated server

Congratulations! You have successfully created a session using an AMS fleet.

References