Stormworks: Build and Rescue

Stormworks: Build and Rescue

Оценок: 139
Dedicated Server Setup
От Beginner
A short instruction of how to install, config and run a dedicated server
2
2
7
2
   
Наградить
В избранное
В избранном
Удалить
Server Requirements
Hardware
Since most of the physics is calculated on the server side, it's better to have a CPU with a high clock rate. Intel i7-i9 (8-10th generations) or AMD Ryzen 5-9 (2-3 generations) will be better here. For Xeon's would be good if the clock rate was over 3.5 GHz. Roughly speaking, each server instance will take 2-3 threads, so you can run multiple servers on dedicated machines with the mentioned CPUs.

Of course, it all depends on the number of servers you plan to create and how loaded they will be. For example, I'm running two simple servers (Climb and Battlebots) that can run even on systems with just two cores and clock speed of about 2Ghz. On the other hand, there can be servers that use much more complex vehicles and missions for their game modes. And there is no guarantee that the server will not start slowing down the simulation even if it has a top-notch CPU.

There are only two things that you shouldn't really care about: the GPU and RAM. I don't think you will ever need more than 4 GB per single server (unless you are using mods).

Network
A lot of data is required to be sent and received. The more players online, the more traffic there will be. There are no exact numbers because it all depends on the world scene (the number of objects, vehicles and their logic that needs to be synced) but roughly, I would say you need to expect 50-300Kb/s per player.

System
Only Windows systems are supported for now. Confirmed to work on Window 7, Windows 10, Windows Server 2016 and 2019. It should work with no issues on Windows 8 and 8.1 as well.

Overall
Minimum:
CPU: 2 GHz
RAM: 4 GB free RAM
Bandwidth: 10 Mbps

Recommended:
CPU: 4-5 GHz
RAM: 4 GB free RAM
Bandwidth: 20 Mbps + static IP address for a public server
Server Settings
Dedicated Server executables are located right in the game folder.

Run server.exe or server64.exe from the game folder at least once to create a server_config.xml file in %appdata%\Stormworks directory.

Close the server app and edit that file using any text editor:
Please, keep the XML syntax right.

Server parameters
Server settings are not dependent on the world save and are applied every time you launch your server:
port="25564" game and query ports that will be used for the server name="Stormworks" name of the server save_name="" world save name that will be used for saving and loading max_players="32" max number of the players for server password="" password (empty means no password) despawn_on_leave="true" automatic character despawn when player disconnects physics_timestep="180" physics resolution: 60, 120, 180 (0 is auto by default) wildlife_enabled="true" birds and fish simulation

Remember that you cannot edit server config when the server is running.

Admins
This section is used for giving admin permissions to the clients based on their Steam64 ID. To find Steam ID you can use websites like https://steamid.xyz/ or https://steamidfinder.com/
Example:
<admins> <id value="76561198080294966"/> </admins>

Blacklist
Blacklist is basically a ban list. A new entry is created when ?ban command is used on the server. You can manually edit it as well to unban players or sync with other ban lists, for example.

Whitelist
Whitelist also fills in the same way, but note that the server will be automatically switched into whitelist mode if there is at least one entry. In that mode, only players from that list will be able to connect to the server.

Authorized
A list of players that are allowed to interact with the workbench. By default, only admins and whitelisted players are allowed to spawn, despawn and return vehicles, so if you want other players to have that permission as well, then you should add them to that list or use ?auth command.

Playlists
Here we put all addons (missions playlists and environment mods) that we want to be on the server.
Example for enabling all default addons:
<playlists> <path path="rom/data/missions/default_ai"/> <path path="rom/data/missions/default_ai_aircraft"/> <path path="rom/data/missions/default_cargo"/> <path path="rom/data/missions/default_creatures"/> <path path="rom/data/missions/default_dock_bollards"/> <path path="rom/data/missions/default_fish_survey"/> <path path="rom/data/missions/default_elevators"/> <path path="rom/data/missions/default_forest_fire_missions"/> <path path="rom/data/missions/default_landmarks"/> <path path="rom/data/missions/default_mission_locations"/> <path path="rom/data/missions/default_mission_transport_locations"/> <path path="rom/data/missions/default_mission_zones_arctic"/> <path path="rom/data/missions/default_mission_zones_arid"/> <path path="rom/data/missions/default_mission_zones_building"/> <path path="rom/data/missions/default_mission_zones_delivery"/> <path path="rom/data/missions/default_mission_zones_main"/> <path path="rom/data/missions/default_mission_zones_moon"/> <path path="rom/data/missions/default_mission_zones_sawyer"/> <path path="rom/data/missions/default_mission_zones_underwater"/> <path path="rom/data/missions/default_natural_disasters"/> <path path="rom/data/missions/default_oil_survey"/> <path path="rom/data/missions/default_paths"/> <path path="rom/data/missions/default_railroad_signals"/> <path path="rom/data/missions/default_resource_storage"/> <path path="rom/data/missions/default_resource_trading"/> <path path="rom/data/missions/default_tutorial"/> <path path="rom/data/missions/dlc_weapons_ai"/> </playlists>

Mods
If you want to create a game with mods enabled then you need to list them like that:
<mods> <path path="C:/Users/User/AppData/Roaming/Stormworks/data/mods/tutorial_block"/> <path path="D:/Steam/steamapps/workshop/content/573090/3360543435"/> </mods>

Command line parameters
If you want your server config file to be in a more comfortable folder (let's say, in the same folder where you have your server files, like absolutely most dedicated servers do) then you can use +server_dir launch parameter to set the path you need.

For example, a server launched with these parameters will look for config and world saves in C:\swds:
server.exe +server_dir c:\swds
Or it will create them with default settings if these files and folders are missing:
But if you want to run multiple servers, you will need to use aseparate path for each one. This is how batch script look for my Mad Max server, for example:
@echo off title Mad Max Server :start C:\steamcmd\steamcmd.exe +force_install_dir c:\swds +login anonymous +app_update 1247090 validate +quit C:\swds\server.exe +server_dir c:\swds\mad_max goto start
This will use server_config.xml from the mad_max folder and automatically update and restart the server on process termination (or simply on a server crash).
World Parameters
Besides the server settings, we can also configure some initial world parameters when we're creating a new save. Note that a new game is only created when world save is not found or when that field is empty in the server config.

World parameters are only used when you start a new game (i.e. save_name is empty), which means that changing these settings in the server config file will not change already saved games.

These parameters are only set on world creation and cannot be changed after (without editing world save scene.xml):
seed="" seed that will be used for the world generation (empty is random) base_island="" player base that will be owned on start (empty is start base) starting_currency="30000" starting money settings_menu="true" custom settings menu (available only for admins if locked) dlc_weapons="true" Search & Destroy DLC content for new world dlc_arid="true" Industrial Frontier DLC content for new world

These parameters are set on world creation too, but can be changed using a Custom menu anytime:
day_length="30" length of the day time (in minutes) night_length="30" length of the night time (in minutes) override_time="false" time override override_weather="false" weather override (fog, wind, rain/snow) override_wind="false" wind direction override vehicle_damage="true" vehicle damage player_damage="true" player characters damage npc_damage="true" NPC characters damage aggressive_animals="true" aggressive creatures sea_monsters="true" aggressive monsters lightning="false" lightnings that can hit vehicles at some altitude infinite_resources="true" money, fuel and minerals requirement for vehicle workbenches infinite_batteries="false" electric power requirement for components unlock_components="true" vehicle components research infinite_fuel="false" fuel/air requirement for vehicle components engine_overheating="true" engine overheating simulation ceasefire="false" weapons usage (requires DLC) infinite_ammo="false" ammo requirement for weapons (requires DLC) map_show_players="true" displays player icons on map map_show_vehicles="true" displays player vehicle icons on map show_3d_waypoints="true" displays player waypoint on HUD third_person="true" allows third person camera for player character third_person_vehicle="true" allows third person camera for player vehicle show_name_plates="true" displays player name plates above their characters no_clip="true" allows no clip camera map_teleport="true" allows player teleport using a map fast_travel="true" allows player fast travel to bases teleport_vehicle="true" allows workbench spawned vehicles teleport back to bases vehicle_spawn="true" allows workbench vehicle spawning for authorized players photo_mode="true" allows photo mode respawning="true" allows player character respawning cleanup_vehicle="true" allows player vehicle clean using a map clear_fow="true" removes fog of war on the map (cannot be undone using menu) unlock_all_islands="false" sets all bases to a purchased state (cannot be undone using menu)

List of bases to use for base_island in server config:
Main Biome data/tiles/island_15.xml Creative Island data/tiles/island_43_multiplayer_base.xml Multiplayer Base data/tiles/island_34_military.xml Military Base data/tiles/island_25.xml Harbour Base data/tiles/island12.xml Starter Base data/tiles/test_tile.xml Helicopter Base data/tiles/island_24.xml Airstrip Base data/tiles/island_33_tile_33.xml Mainland Airstrip data/tiles/island_33_tile_32.xml Terminal Spycakes data/tiles/island_33_tile_end.xml Terminal Camodo Custom Bases data/tiles/island_29_playerbase_submarine.xml Custom Base Submarine data/tiles/island_32_playerbase_heli.xml Custom Base Heli (structure workbench only) data/tiles/island_30_playerbase_boat.xml Custom Base Large Boat data/tiles/island_31_playerbase_combo.xml Custom Base Small Boat data/tiles/oil_rig_playerbase.xml Custom Base Oil Rig (structure workbench only) Arcitc Islands data/tiles/arctic_island_playerbase.xml Arctic Island Base data/tiles/arctic_tile_22.xml Arctic Mainland Outpost data/tiles/arctic_tile_12_oilrig.xml Arctic Oil Platform Sawyer Islands data/tiles/mega_island_2_6.xml Harrison Airbase data/tiles/mega_island_12_6.xml O'Neill Airbase data/tiles/mega_island_9_8.xml North Harbor Dock data/tiles/mega_island_15_2.xml Fishing Village Dock Arid Islands (Industrial Frontier DLC biome): data/tiles/arid_island_5_14.xml North Meier Outpost data/tiles/arid_island_6_7.xml Serpentine Trainyard data/tiles/arid_island_7_5.xml Ender Airfield data/tiles/arid_island_8_15.xml Uran Wind Power Plant Docks data/tiles/arid_island_11_14.xml Brainz Train Yard data/tiles/arid_island_12_10.xml Mauve Train Yard data/tiles/arid_island_19_11.xml Clarke Airfield data/tiles/arid_island_19_12.xml Monkey Brain Launch Site data/tiles/arid_island_24_3.xml JSI Dock data/tiles/arid_island_26_14.xml FJ Warner Docks
Admin Commands
All commands work in the chat only. You can see the session peer ID of player in players menu:
?save <savename> saves the game (if savename is not set then will save in autosave_server and also overwrite the save defined in server settings) ?kick <id> kick player ?ban <id> ban player ?add_admin <id> add player to the admins list ?remove_admin <id> removes player from the admins ?add_auth <id> add player to authorized list ?remove_auth <id> removes player from authorized
Firewalls and Portforwarding
To make your server be visible to other players, you need to have a public IP and set your firewall to allow connections for the server executable (Stormworks Dedicated Server). Here is how it looks for the default Windows Firewall:

If you install Stormworks Dedicated Server as a tool using a Steam client, then Steam will add that rule automatically for the default Windows Firewall. For all other security software, you will need to add it manually.

Port Forwarding
If you are running a server on the machine that is behind the NAT (a Wi-Fi router in most cases) then you will also need to forward all three game ports. There are thousands of different router models that go with different hardware and firmware versions, so I can't show you how to forward these ports, but you can use https://portforward.com/ website for that.

Here is how it may look on popular D-Link routers with "orange" firmware:
If you run more than one server from your network, you need to use a different port range for each.

But be aware, that if you run server and client from the same network or even from the same computer then to see your own server you will need to enable NAT Loopback or install Microsoft Loopback adapter for example.

Installing Microsoft Loopback Adapter
This is a workaround for those who run a dedicated server on the same computer/network as the game client. Please, use it only if other players can already see and join your server, but you can't.

  • Open Control Panel > Device Manager and select Network Adapters
  • Select menu Action > Add legacy hardware
  • Next
  • Select Install the hardware that I manually select from a list (Advanced)
  • Next
  • Select Network Adapters in the list
  • Next
  • Select Microsoft in Manufacturer list
  • Select Microsoft KM-TEST Loopback Adapter in Model list
  • Next > Next > Finish
  • Close Device Manager window
  • Open Control Panel > Network and Internet > Network Connections
  • You should see a new connection that uses Microsoft Loopback Adapter but cannot establish connection
  • Right click on that connection and select Properties
  • Double click Internet Protocol Version 4 (TCP/IPv4)
  • Select Use the following IP address
  • NOTE: If it was already selected and you see some IPs entered then you opened a wrong connection. Get out of here by clicking Canel in both windows.
  • Enter in IP address field your external IP address (you can see it here for example https://www.myip.com/)
  • You can leave default Subnet mask
  • Click OK buttons in opened windows to save settings

If you did all right, you should be able to see your own server when that connection is enabled.
If you lost your Internet connection, then you probably changed IPv4 parameters of your actual Internet connection.
Known Issues
Server is not launching at all
Make sure that Visual C++ Redistributable 2013[www.microsoft.com] is installed.
Server stops on launch with settings parse error
It's usually means that server config file is corrupted or have a syntax error.
I can launch but don't get to the status screen
It could be server config error or something wrong with the missions or environment mods. Try to start a server with the default config.
Server is running fine but it does not shows up on Internet tab
Make sure that server ports are forwarded on your router and that your firewall is not blocking server executable. Check server in the Steam server browser [url]steam://open/servers[/url] or ask your friends to check server visibility. It could be that it's just because of NAT.
Server is running fine and shows up on Internet tab but have an empty name
There is no support for non-latic characters so you better to avoid them in server naming.
Комментариев: 281
Jodian 27 апр в 16:44 
Just wondering if you would get a noticeable performance boost by disabling;

<path path="rom/data/missions/default_ai"/>
<path path="rom/data/missions/default_ai_aircraft"/>
<path path="rom/data/missions/default_cargo"/>

Or would this severely hamper the game experience on the server?
Matt Horsecock 14 апр в 22:41 
@Petals_Sora We tried the suggestion, but it didn't seem to work. We have no idea what the issue is, as the ports work correctly, that isn't the issue we think.
Petals_Sora 13 апр в 6:28 
@Matt Horsecock Have you ever tried run the exe as admin? I had the same problem with you and fixed using this method
koupichi 22 мар в 8:17 
I have one more question.
How can I add add-ons from the workshop to my server?
If I put it in <mods> in the xml of server_comfig like any other mod, it will not be added and worked.
koupichi 21 мар в 19:21 
Sorry,I was mishearing.
I would be happy to answer again if you don't mind.
The correct is that my internet speed has been slow ever since I opened the server, it won't go faster than double digit KB/S.

The person who set up the server takes a few seconds to connect, but my friend takes tens of minutes to connect.

I could not find anything related to internet speed in the server settings.
What should I do?
koupichi 21 мар в 18:56 
Thank you for teaching Lawh.
OK,I'll play with it in this state for a while and wait until the development supports it.
Lawh 21 мар в 8:00 
It's possible that his machine or connection is not good enough for the game. I don't know why, but I think the developers made it so that if someone lags the server, everyone will suffer. The server seems to start waiting on the slowest person. t's not a great way to handle traffic.
koupichi 21 мар в 7:56 
I was able to successfully set up the server and it runs very comfortably when I, the host, connect to it.
However, when my friend connects, the internet speed drops only on the server and it takes a long time to load.
Other apps and browsers work fine as usual, only this server at StormWorks is very slow.
Is there a solution?
Lawh 16 мар в 20:00 
Local IP should probably be the IP to your PC, and that should be made static in your PC settings. You have a public IP given to you by your internet provider, which might change when you disconnect. Then you have IP addresses for each device behind your router.

The local port is to your PC, and the external port is what others will use. I think they can be the same.

You can set the protocol to both if you are unsure which is needed.
WillTP 16 мар в 19:47 
when forwarding ports, I'm in my routers settings to forward ports but there's a local range, "Local start port" and "Local end port", and an external range with start port and an end port. all four of these numbers i have to put somethin in for, what do i put? also is it protocol TCP or UDP or both?
also i don't know what to put as local ip, would it stay the same?