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

Test run local AMS server using AMS Simulator - Game server integration - (Unity module)

Last updated on March 12, 2025

About

For testing your AccelByte Multiplayer Servers (AMS) server locally, AccelByte has provided a simulator called AMS Simulator. This simulator simulates the dedicated server (DS) management and monitoring processes that are done by the Watchdog of AMS. With this AMS Simulator, you are going to validate the AMS implementation without uploading the server build to AMS.

Package Windows dedicated server

To run the game server locally, you need to build the project as Windows dedicated server.

  1. On the new window, select Dedicated Server for the Platform, and choose Windows as the Target Platform. Also, enable the Development Build to display the logs on the server build.

  2. Next, click on the Build button.

  3. On a new pop-up window, name the server build as ByteWars.exe. Then, hit enter on your keyboard to start the build process and wait until it finished.

Test run the dedicated server locally

In this section, you learn how to test your packaged game server locally to check whether it is able to handle the state changes within the lifecycle of AMS.

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

  2. Go to Multiplayer Server Configuration > Download Resource. Locate the AMS Simulator for Windows and click the download button to download the amssim.exe file.

  3. Once the download is complete, open Windows PowerShell and run the AMS Simulator executable using the command below.

    .\amssim.exe run
  4. Here is the output of AMS Simulator. Notice that it provides an example ID format for your local dedicated server. This example is ds_018c1f42-5eb6-7ca3-9650-a732ed75ce6a. Copy it, as you will need it in the next step.

    AMS simulator url  ws://0.0.0.0:5555/watchdog
    AMS simulator session id: 01hfaxxvfqhe9gkk2zesfx0b66.
    AMS simulator session log path: session\01hfaxxvfqhe9gkk2zesfx0b66.log

    Ready to accept local DS

    Start the local DS with a valid DS ID that conforms to uuid standards
    An example that can be copied and pasted is:

    ds_018c1f42-5eb6-7ca3-9650-a732ed75ce6a

    ==================================Command list=================================================
    help show the command list again
    info show AMS simulator info
    ds
    status show status of the ds
    ready explicitly set ds into ready state.
    claim claim the ds for a game session.
    drain drain the ds
    exit, quit exit ams simulator
    =============================================================================================
  5. Run the game server executable using the commands below in Windows PowerShell. Notice that it uses the ds_018c1f42-5eb6-7ca3-9650-a732ed75ce6a from the previous step as its local dedicated server ID. Also, adjust the path to point to the ByteWars.exe of your server build.

    .\ByteWars.exe -log -OverrideSDKConfig "{'DsId': 'ds_018c1f42-5eb6-7ca3-9650-a732ed75ce6a'}"
    備考
    • -log is to show game server's log.
    • -OverrideSDKConfig is the parameter specifically for Windows server to inject the config parameter, such as the DsId.
    • DsId is the parameter is specifically for Windows Server to define the server identification. You can use the example ID provided by the AMS Simulator. In this case, it is ds_018c1f42-5eb6-7ca3-9650-a732ed75ce6a. If the server is hosted on AMS, AMS provides the specific server ID and substitutes it in the command parameter value.
  6. Once your game server runs, the "DS Connected" message appears in your AMS Simulator Windows PowerShell tab to notify you that your local dedicated server has connected to the AMS Simulator.

    amssim> DS Connected
  7. Check the dedicated server status using AMS Simulator by executing ds status. If the game server successfully registers, it displays the log below. Notice that the DS State has changed to Ready.

    ds status

    AMS Simulator log:

    amssim> ds status
    ID: xxxxx
    Connected at: 2023-XX-XX 10:00:00
    Last Heartbeat: 2023-XX-XX 10:00:00
    DS State: Ready
  8. You can also verify if the game server can handle a drain state by executing ds drain. Upon receiving the event, the game server shuts down, and the AMS Simulator displays the log below.

    ds drain

    AMS Simulator log:

    amssim> ds status
    no connected dedicated server
  9. To quit AMS Simulator, execute the following command:

    quit