Skip to main content

Steamworks Integration

The ODIN Fleet runtime leverages modern container technology to run your game servers. However, not everyone is familiar with creating Docker images from game servers, and many game developers use Steam to distribute client and server files. We created a simple, automated way for you to provide Steamworks details of your server, and we create a Docker image in the background. The image creation process is straightforward and requires only a few steps.

This article explains what happens under the hood once you provide your Steamworks details ( see creating an image for more details).

Steamworks Image Creation Process

Once you have created a Steamworks image, our backend will execute the following steps:

  1. Base Image Setup: We start with an Ubuntu base image and set up the environment for downloading and running the game server. This includes installing essential software and the SteamCMD tool, which is used to download the server files from Steam.

  2. User and Environment Configuration: We create a user named steam and configure the necessary environment variables to ensure the game server runs smoothly. This step ensures that the environment is correctly set up for the game server to operate.

  3. Downloading Steamworks Files: Depending on the platform (Windows or Linux) you specified, we use SteamCMD to download the game server files from Steam. For Windows servers, we use Proton GE, a compatibility tool that allows Windows games to run on Linux. This step ensures that all necessary files are downloaded and ready to be used.

  4. File Organization: All downloaded files from Steamworks are stored in the /gameserver directory within the container. This means any paths referenced in your server's configuration files should be prefixed with /gameserver. This standardized directory structure simplifies the setup and ensures consistency.

  5. Finalizing the Docker Image: We finalize the Docker image by copying necessary scripts and setting up user permissions. This includes configuring the entrypoint script, which is responsible for starting the game server when the container is run.

Example Usage

To help you understand how to set up your Docker image and server configuration, let's look at two examples: Enshrouded and Factorio. These examples guide you through the process of creating an image and configuring the server.

Example 1: Enshrouded Server (Simple Settings)

Step 1: Creating the Image

A developer creating an image for Enshrouded would need to provide the following information in the image creation wizard:

  • Name: enshrouded-server
  • Version: 1.0
  • OS: Windows
  • Steam App ID: 2278520
  • Branch: public (default)
  • Executable Command: /gameserver/enshrouded_server.exe

Step 2: Configuring the Server

After creating the image, the developer would need to create a server configuration with the following details:

  1. Basic Configuration:

    • Name: Enshrouded Server
    • Image: enshrouded-server:1.0
    • Restart Policy: Always
  2. Port Settings:

    • The developer would add any necessary ports that the server would use to communicate with clients. For example:
      • Name: game
      • Port: 2456
      • Protocol: UDP
  3. Environment Variables:

    • The developer might set environment variables if needed. For this example, there would be no additional environment variables required.
  4. Persistent Folders:

    • Path in Container: /gameserver/saves
    • This would ensure that game saves are persisted across server restarts.

Example 2: Factorio Server (Advanced Settings)

Step 1: Creating the Image

A developer creating an image for Factorio would need to provide the following information in the image creation wizard:

  • Name: factorio-server
  • Version: 1.0
  • OS: Linux
  • Steam App ID: 427520
  • Branch: public (default)
  • **Executable Command **: /gameserver/bin/x64/factorio --start-server /home/steam/save/factorio.zip --server-settings /home/steam/save/server-settings.json
  • Steamworks Username: <your_steam_account_id>
  • Steamworks Password: <your_steam_account_password>

Step 2: Configuring the Server

After creating the image, the developer would need to create a server configuration with the following details:

  1. Basic Configuration:

    • Name: Factorio Server
    • Image: factorio-server:1.0
    • Restart Policy: Always
  2. Port Settings:

    • The developer would add the necessary ports that the server would use. For Factorio, it typically uses the following:
      • Name: game
      • Port: 34197
      • Protocol: UDP
  3. Environment Variables:

    • The developer might set environment variables to configure the server. For example:
      • Name: SERVER_NAME
      • Value: MyFactorioServer
      • Name: MAX_PLAYERS
      • Value: 16
  4. Persistent Folders:

    • The developer would ensure that game saves and other important data are persisted across server restarts:
      • Path in Container: /home/steam/save

By following these steps, developers would set up and configure Docker images for their game servers effectively. These examples demonstrate both a simple setup with minimal configuration (Enshrouded) and a more advanced setup with additional parameters (Factorio). Remember, all file paths within the container should be prefixed with /gameserver to ensure proper access and functionality. This approach not only standardizes the game server environment but also provides flexibility to accommodate various game-specific configurations.

Environment Variables

In the server configuration you can use environment variables to make certain aspects of the server configurable. This is especially useful when you want to run multiple instances of the same server with different settings. Of course, your gameserver needs make make use of these environment variables.

Unity

In Unity you would use Environment.GetEnvironmentVariable("SERVER_NAME") to access the value of SERVER_NAME.

Unreal Engine

In Unreal Engine you would use FPlatformMisc::GetEnvironmentVariable(TEXT("SERVER_NAME")) to access the value of SERVER_NAME.