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

専用サーバーを AMS にアップロードする - AccelByte マルチプレイヤーサーバー (AMS) による専用サーバー - (Unreal Engine モジュール)

Last updated on June 5, 2024

Upload dedicated server to AMS

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.

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

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

  3. Log in to the AGS Admin Portal and go to your game namespace dashboard.

  4. From the side bar menu, select AccelByte Multiplayer Server > Download Resource.

  5. Then, download the AMS Command Line Interface (CLI) For Windows (amd64). The ams.exe file should be downloaded.

  6. 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 demo.accelbyte.io -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 where you run your AGS namespace. Since we use namespace on demo AGS, then set the command value to demo.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 the AccelByteWarsServer.sh file.
  7. 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 AccelByte Multiplayer Servers > 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.
  8. 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.

  1. Log in to the AGS Admin Portal and go to your game namespace dashboard.

  2. From the side bar menu, select AccelByte Multiplayer Server > Fleet Manager.

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

  4. Then, click the Create Fleet button to create a new fleet.

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

  6. 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} -log=${log_file} -watchdog_url=${watchdog_url}
  7. On the DS Host tab, select the glx1.2x for the VM Instance and set the Number of server to 1. This configuration tells the fleet to spawn 1 dedicated server on the selected Virtual Machine (VM) instance. Now, click Next button.

  8. 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. 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.
  9. 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.

  10. On the Summary tab, you can review your fleet configurations. Now, click the Create button and activate it.

  11. Now, your fleet should be created and available on the fleet list. You can open the fleet details by clicking on the fleet name.

  12. On the fleet details page, locate the Dedicated Server List section. There, you should see your dedicated servers and their statuses.

    備考

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

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 your new AMS fleet.

Create claim keys for the fleet

  1. Log in to the AGS Admin Portal and go to your game namespace dashboard.

  2. From the side bar menu, select AccelByte Multiplayer Server > Fleet Manager. Then, click on the name of your fleet you created from the previous tutorial.

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

Set up the Session Template

  1. Log in to the AGS Admin Portal and go to your game namespace dashboard.

  2. From the side bar menu, select Multiplayer > Matchmaking > Session Configurations. Then, locate the Session Template tab.

  3. From here, you can either create a new Session Template by clicking the Add Session Template button. Or, you can modify your existing Session Template by clicking on the Session Template name.

  4. On the Session Template General tab, locate the Server section. Then, select the DS - AMS option. This tells the Session Template to use dedicated server from AMS fleets when the game session is created.

  5. When the DS - AMS option selected, you can find a new configuration namely Requested Regions. Add all of your enabled AMS regions by clicking on the Add Region button.

  6. Then, on the Fallback Claim Keys, add a new claim key that match with the claim keys you have configured on your AMS fleet. In tutorial case, you need to add unreal-ds-ams claim key. To add new claim keys, click on the Add Key button.

    備考

    There are two types of claim keys you can configure for Session Template, there are Preferred Claim Keys and Fallback Claim Keys. Here is the difference between the two.

    • Preferred Claim Keys: is the top priority claim keys for the game session to claim AMS dedicated servers.
    • Fallback Claim Keys: is the fallback claim keys in case no AMS dedicated servers found when using the Preferred Claim Keys.
  7. Now, you have configured your Session Template to claim dedicated servers from your AMS fleets. Click on the Save button on the right bottom corner to save your Session Template configuration. Or, if you are creating a new Session Template, then click the Next button on the right corner, follow and complete your new Session Template configuration.

  8. Congratulations! You have successfully setup a game session using an AMS fleet.