Sons Of The Forest Dedicated Server Configuration Guide

Patch 07 has allowed us to host our own Sons of the Forest Dedicated Servers! This means that you will also be able to rent servers from your typical server hosts.

Where can I rent a Sons of the Forest Server?

You should be able to find your typical server host will have Sons of the Forest servers to rent now since Endnight have given the Dedicated Server Config information in Patch 07. We’ve listed a few places you can rent your server from here, in no particular order:

How to host your own Sons of the Forest Dedicated Server

Hosting your own dedicated server can come with its own issues, however Endnight have provided us with a Guide on how to host our own game server using a JSON configuration file and command line arguments. Credit Diskmink and Survivalist.

How to install the Dedicated Server

The game server can be downloaded from Steam directly (logged in), or completely anonymously (no Steam account needed) via SteamCMD tool.

From Steam

The dedicated server will be available in the Tools section of your Steam library. You can also find it using the search bar.

Sons of the Forest Dedicated Server

Using SteamCMD

You can install the SteamCMD tool for Windows directly from Valve’s website, available here: https://developer.valvesoftware.com/wiki/SteamCMD. This page also contains the complete documentation of the tool, but you shouldn’t require anything besides what’s in this guide to get started.

To install or update the game, start SteamCMD then type in (with modified install directory if needed, in our example we will install the server to c:/sons-dedicated):

force_install_dir c:sons-dedicated
login anonymous
app_update 2465200 validate

For more advanced users, it is also possible to chain these commands by directly typing in Windows command line (or from a batch file). This could prove useful if you want to set up automatic auto-game updates for example.

steamcmd.exe +login anonymous +force_install_dir "c:/sons-dedicated/" +app_update 2465200 validate +quit

Making the Sons of the Forest Dedicated Server available to the Internet

In order to allow other players to connect to your server, you will have to make sure your machine is properly configured to allow traffic on the 3 different ports listed below, and in the configuration file.

Usual required steps are:

  1. setting up the appropriate Port Forwarding rules on your router or hosting service
  2. setting up the appropriate rules in your operating system Firewall, and/or in your router/switches built-in firewalls

Required Ports:

  • GamePort (UDP): 8766
  • QueryPort (UDP): 27016
  • BlobSyncPort (UDP): 9700

These ports are the default ports and can be changed in the configuration file which will be discussed later in this guide.

When starting, the game server has a self-test procedure that is going to check if the ports are open and accessible. If the test procedure fails, the server won’t start. In this case, you have 2 options:

  1. fix your port forwarding
  2. setup the “LanOnly” flag discussed below, which basically excludes your game from the public listing

This is how the Port Forwarding looks on my ISP for your Sons of the Forest Dedicated Server.

Sons of the Forest Dedicated Server

Exposing a game to LAN

When making a game available to LAN, you’ll have to consider the following.

you may want to optionally set the “LanOnly” flag to true if you want to hide your game from the internet search.

in LAN, you shouldn’t need any port redirection if you are running in the same network as the other clients, however you will still have to set up your firewall appropriately.

Your local network has to be trusted by your operating system and allow traffic, in order to do this, your Network Profile has to be Private.

there is a known issue when you have multiple network adapters, in some cases Steam will pick up the wrong one to do LAN games discovery and yield no result. If you have any issue, this can be confirmed by temporarily disabling all other network interfaces, and trying again.

User Data Folder

When running the dedicated server, it will be using a persistent user data folder for:

  • reading configuration files
  • saving and loading the game saves
  • writing server logs
  • etc…

This folder can be either configured to a particular directory, or left to default. The default place where the user data is stored is C:Users\AppDataLocalLowEndnightSonsOfTheForestDS

It can be overridden using a command line argument: -userdatapath “c:/path/to/directory”
If no argument is specified, the default directory will be used.

Throughout this guide, we will make reference to this folder as

Where to find the Configurations Files

All configuration files that will be discussed later in this document can be found / must be located in the game as described in the previous section.

This folder will contain:

  • the server owners list, in a file called ownerswhitelist.txt
  • the game server configuration, in a file called dedicatedserver.cfg
  • the saves (if the path is not overridden), in a folder called Saves
  • the game settings, in a file called SonsGameSettings

Note that these files do not exist right away after the installation, the game has to be started once for the default files to be created. Not all of these files need intervention to set up the dedicated server.

You should only need to touch:

  • ownerswhitelist.txt
  • dedicatedserver.cfg

Server Ownership

In order to be able to administrate your server from in-game directly, you will need to set up server ownership using the ownerswhitelist.txt file. This will allow you, as a player, to have full access to the in-game administration panel (Pause Menu / Players) where you will be able to:

  • upgrade other players to administrators
  • downgrade other players to guests
  • kick guests
  • ban and unban guests

How to create the default server ownership file

When first starting the server, the default configuration file will be created in the configurations folder, if it doesn’t exist already. You can either create it like this, or simply create a txt file as described in the following sections.

File name and format

In order to set up server ownership you will have to feed in the steam ids of all “server owners” in the file called ownerswhitelist.txt, one steam id per line. When first starting the server, the default configuration file will be created in the configurations folder, if it doesn’t exist already.

Server owners have essentially the same rights as P2P server hosts, it’s the highest role and gives access to all commands, so make sure to only add trusted people to this list. Below is an example file.

To find your SteamID, you can either navigate to this page https://store.steampowered.com/account/ or directly in Steam click on your name on the top right, then Account Details.

Configuration File

The dedicated game server can be configured with a JSON file in the configurations folder, called dedicatedserver.cfg

How to create the default configuration file

When first starting the server, the default configuration file will be created in the configurations folder, if it doesn’t exist already. You can either create it like this or simply create a JSON file as described in the following paragraph.

File name and format

Our configuration file is written in JSON format. You can find online a multitude of resources that can teach you how to deal with such files. We will list below some basic mistakes when editing JSON files:

  • keys are always written in quotation marks and followed up by a semicolon
  • a textual value will always be written in between quotation marks “the text”
  • integers, floating point values, and boolean (true/false), will be written without quotation marks
  • each setting (key-value pair) must be followed up by a comma (,)

Notes:

  • some settings can be set to null, which means that they have no value. The outcome depends on the settings and is described in the documentation below
  • no setting is mandatory, if the setting doesn’t exist it will be replaced by its default value
  • the order doesn’t matter

The file name has to be dedicatedserver.cfg and contains a JSON formatted document that defines all parameters related to the game server configuration. It has to be placed in the configurations folder. Below is the default file.

{
  "IpAddress": "0.0.0.0",
  "GamePort": 8766,
  "QueryPort": 27016,
  "BlobSyncPort": 9700,
  "ServerName": "Sons Of The Forest Server (dedicated)",
  "MaxPlayers": 8,
  "Password": "",
  "LanOnly": false,
  "SaveSlot": 1,
  "SaveMode": "Continue",
  "GameMode": "Normal",
  "SaveInterval": 600,
  "IdleDayCycleSpeed": 0.0,
  "IdleTargetFramerate": 5,
  "ActiveTargetFramerate": 60,
  "LogFilesEnabled": false,
  "TimestampLogFilenames": true,
  "TimestampLogEntries": true,
  "GameSettings": {},
  "CustomGameModeSettings": {}
}
Key Effect Accepted Values
IpAddress Listening interface for the game server, usually 0.0.0.0 if listening on all interfaces. any string formatted ipv4 address
GamePort UDP port used for gameplay netcode (Bolt). integer
QueryPort UDP port used by Steam to list the server and enable the discovery services. integer
BlobSyncPort BlobSyncPort UDP port used by the BlobSync system to initialize game systems and exchange data. integer
ServerName Name of the server visible in the server list, and in the Steam contacts. any string
MaxPlayers The maximum number of players allowed simultaneously on the server. integer (1-8)
Password Adds a password to make your server “private”. Upon connection, this password will be requested before the client can proceed. any string up to 40 characters long
LanOnly Allows or restricts the server visibility to LAN only. true, false
SaveSlot When creating a new save, this number will be the id of the save. integer greater or equal to 1
SaveMode Game save initialization mode.
“continue”: will create a new save on SaveSlot if it doesn’t exist, or load it if it exist.
“new”: will create a new game, with a new game id, and overwrite any game previously saved on the SaveSlot. If the server stops and restarts, the previous save will be overwritten for as long as the mode is set to “new”.
new, continue
GameMode Sets the difficulty game mode when creating a new save. This parameter is ignored if loading a save (save mode set to “continue” with a save that exists on the slot). If the game mode is set to “custom”, then the custom game mode settings will be read from CustomGameModeSettings option, described later. normal, hard, hardsurvival, peaceful, custom
SaveInterval How often the game server automatically saves the game to SaveSlot, in seconds. integer
IdleDayCycleSpeed A multiplier to how quickly the time passes compared to normal gameplay when the server is considered idle (no player connected). floating point value between 0 and 1, greater than or equal to 0
IdleTargetFramerate Target framerate of the server when it’s considered idle (no player connected). integer greater or equal to 1
ActiveTargetFramerate Target framerate of the server when it’s NOT considered idle (one or more player connected). integer greater of equal to 10
LogFilesEnabled Defines if the logs will be written to files. The logs will be output in /logs. true, false
TimestampLogFilenames Enabled log files timestamping.
“true”: every time the server runs will dump log output to a new file, with filename having the following format: sotf_log_{DateTime:yyyy-MM-dd_HH-mm-ss}.txt
“false”: the filename will be sotf_log.txt and previous log will be overwritten if it already exists.
true, false
GameSettings A key value map of all game settings you can use to tweak your game (in any mode). All parameters will be listed in a later paragraph along with their possible values. If the value is null, or empty, default settings will be used. Public Dedicated Server Configuration Guide
CustomGameModeSettings key value map of all settings available to customize your game in custom mode. All parameters are listed later in this guide along with their possible values. If the value is null, or empty, default settings will be used. This parameter is ignored if the game mode is not “custom” or if loading a save (save mode set to “continue” with a save that exists on the slot), whether is it “custom” or not. Public Dedicated Server Configuration Guide

Game Settings

These are extra settings that can be injected in the configuration file inside the “GameSettings” parameter.

"GameSettings": {
"Gameplay.TreeRegrowth": true,
"Structure.Damage": true
},

Key Effect Accepted Values
Gameplay.TreeRegrowth Enable automatic tree regrowth, triggered when sleeping. true, false
Structure.Damage Allow buildings to be damaged. true, false

Custom game mode settings

These are extra settings that can be injected into the configuration file inside the “CustomGameModeSettings” parameter. They will be ignored if the game mode is not “custom” or if loading a save (save mode set to “continue” with a save that exists on the slot), whether is it “custom” or not, since they are set once upon save creation.

“CustomGameModeSettings”: {
“GameSetting.Vail.EnemySpawn”: true,
“GameSetting.Vail.EnemyHealth”: “Normal”,
“GameSetting.Vail.EnemyDamage”: “Normal”,
“GameSetting.Vail.EnemyArmour”: “Normal”,
“GameSetting.Vail.EnemyAggression”: “Normal”,
“GameSetting.Vail.AnimalSpawnRate”: “Normal”,
“GameSetting.Environment.StartingSeason”: “Summer”,
“GameSetting.Environment.SeasonLength”: “Default”,
“GameSetting.Environment.DayLength”: “Default”,
“GameSetting.Environment.PrecipitationFrequency”: “Default”,
“GameSetting.Survival.ConsumableEffects”: “Normal”,
“GameSetting.Survival.PlayerStatsDamage”: “Off”,
“GameSetting.Survival.ColdPenalties”: “Off”,
“GameSetting.Survival.ReducedFoodInContainers”: false,
“GameSetting.Survival.SingleUseContainers”: false,
},

Key Effect Accepted Values
GameSetting.Vail.EnemySpawn Enable enemies spawning. true, false
GameSetting.Vail.EnemyHealth AAdjust enemy starting health. low, normal, high
GameSetting.Vail.EnemyDamage Adjust damage enemies can do. low, normal, high
GameSetting.Vail.EnemyArmour Adjust enemies armor strength. low, normal, high
GameSetting.Vail.EnemyAggression Adjust enemy aggression level. low, normal, high
GameSetting.Vail.AnimalSpawnRate Adjust animal spawn rate. low, normal, high
GameSetting.Environment.StartingSeason Set environmental starting season. spring, summer, autumn, winter
Structure.Damage Allow buildings to be damaged. true, false
GameSetting.Environment.SeasonLength Adjust season length. short, default, long, realistic
GameSetting.Environment.DayLength Adjust day length. short, default, long, realistic
GameSetting.Environment.PrecipitationFrequency Adjust the frequency of rain and snow. low, default, high
GameSetting.Survival.ConsumableEffects Enable damage taken when low hydration and low fullness normal, hard
GameSetting.Survival.PlayerStatsDamage Enable damage from each bad or rotten food and drink. off, normal, hard
GameSetting.Survival.ColdPenalties Adjusts the severity that cold will affect health and stamina regeneration. off, normal, hard
GameSetting.Survival.ReducedFoodInContainers Reduces the amount of food found in containers. true, false
GameSetting.Survival.SingleUseContainers Containers can only be opened once. true, false

Special Cases

  • if a parameter is missing from the config, the default value is used
  • if the game runs without a config file, the default configuration is used
  • all parameters can also be overridden by a command line argument (see paragraph below)

Overriding parameters with command line arguments

Every parameter listed in the configuration file can be overridden via the command line to allow more flexibility. You can even create the full configuration via command line if you want to. The format goes as below:

If you have any questions, we can try our best to help over on our Discord.

https://mmo-wiki.com/sons-of-the-forest/dedicated-servers/

Related Posts