Overview
A detailed guide of how to install, config and run a dedicated server.Developed based off of Beginner’s guide, with alot of lessons learned along the way.Much credit goes to Beginner
Prerequsites
The server is mostly responsible for calculating the physics of the creations in-game. To do this, the server process relies on the FPU (Floating Point Unit) or better known as the math coprocessor built into the CPU in order to compare and resolve the positions of vehicles and their subgrids.
(Yes, this is why vehicles with lots of subgrids destroy servers.)
Now that I have explained the what the server wants the most, lets help you decide what you want to run the server.
CPU
FPU speed does not scale much with the product stack of a processor. Instead, FPU speed scales with processor generation. Biggest leap is 5000 series Ryzen, which saw 2x performance leap in FPU speed over previous gen. CPU clock speed and single threaded performance also helps, so basically get 5000 series Ryzen.
Good FPU, high clock speeds and single threaded performance.
Min: 4-7th gen i3-i5, 1st gen Ryzen
Good: 4-7th gen i7, 2-3rd gen Ryzen
Great: 8-11th gen i3-i9, 5th gen Ryzen
RAM
The server program has a memory leak issue, so high ram amounts are just stability buffer.
The whole system only needs minimum 4gb of ram to run the server properly, but a popular server will need around 8gb.
Low ram usage, but memory leak will hamper uptime and stability.
Min: 4gb DDR3
Good: 8-16gb DDR4
Great: 32-64gb DDR4 ECC
GPU
The server process does not need one, but your eyeballs might. If intel, you have integrated graphics, if AMD, you are going to need a gt 710 or something.
Storage
Nothing special here, but you should be using an SSD of some sort as a boot drive when using windows 10.
The faster the better. Storage does not matter.
Min: 30gb HDD
Good: 64gb SSD
Great: 128gb NVME SSD
Network
Large amounts of data is only sent and received when a new vehicle is spawned. Other than that, idle bandwidth usage is around 300kbps per player. That’s 3.6mbps for 12 players. Latency should be the biggest worry of a network.
Speed is negligible, ping is our worry
Min: 10mbps with 30ms ping (Average DSL)
Good: 50mbps with 20ms ping (Slow cable)
Great: 100mbps with 2ms ping (Really slow fiber)
OS
This whole guide is written for windows 10 (both normal and server), but the server is said to work on windows 7, 8, and 8.1. Some brave souls also say that it can run on linux, but if you are reading a guide on how to use the dedicated servers, you are not skilled enough to configure this on linux. (Im not hating on you, im just clearing up our expectations).
I love windows, and you should too.
Min: Windows 10
Good: WIndows 10 Pro, Edu, or LTSC
Great: Windows Server 2019
Min: An acceptable experience, fit for up to 8 players or so. Consider 8gb RAM.
i3-4370, r3 1200
4gb DDR3/4
30gb HDD
10mbps internet with 30ms ping (Average DSL)
Windows 7
Good: A great start for dedicated server hosting, ripe for a single 12 player server or two servers with few players.
i7-7700, r5 2600
16gb DDR3/4
64gb SSD
50mbps internet with 20ms ping (Slow cable)
Windows 10 LTSC
Great: An excellent experience. This is the ideal system, fit for up to 6 servers, and ready for handling insane uptimes and a super active community.
i9-10900k, r5 5600x (remember, 5th gen has upgraded FPU and incredible single core performance)
64gb DDR4 ECC
128gb NVME SSD
100mbps internet with 2ms ping (Really slow fiber)
Windows Server 2019
And there is our hardware configurations! Funnily enough, the optimization of the server software is just so bad that upgrading any part of any one of the builds (aside from maybe storage) will increase its function at least a little bit. Obviously the min spec build would like to see any part be better, but even our “good” build could benefit from a better cpu, more ram, lower latency internet, and maybe even windows server.
Hopefully this lets you gauge the kind of experience you can expect to get from the computer you plan to use for your server.
Installation
We will be installing steamcmd on windows, which is steam, but command line (do not be scared)
- Download SteamCMD
- Unzip to C:steamcmd
- Go to folder and launch steamcmd
- Paste this code into it (it installs the stormworks server)
login anonymous force_install_dir c:swds app_update 1247090 validate
- Once it finished type quit to exit and close SteamCMD
- Go to the server folder and run server.exe at least once to create a server_config.xml file that will be in %appdata%Stormworks folder by default.
- Complete!
Configuring the XML File
Hit Win+R and type in %appdata%Stormworks in order to access the configuration file for the server.
Edit that file with any text editor such as default Notepad or more advanced Notepad++
(Notepad++ highly recomended, get it here[notepad-plus-plus.org].)
This section is needed to give admin permissions for clients by using Steam64 ID. To find ID of your or your friends accounts you can use websites like [link].
Example:
Blacklist: Blacklist is simply a ban list. We fill it in the same way as we add admins. Accounts of players that were banned by admins will be automatically stored here too.
Whitelist: Whitelist also fills the same way but note that the server will be automatically switched into whitelist mode if there will be at least one entry. In that mode only players from that list will be able to connect.
Authorized: A list of players that allowed to interact with 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 then you should add them to that list.
Alright, now that we have our server settings set up (what a mouthful), lets jump over to making sure we can join the server.
Networking!
Stormworks servers use UDP packets to transfer all data. Most data is transferred on random ports that are willing to accept application data, but to see the server in the server list, your computer must ping the server.
The other server guide wants you to forward the port that you set in the XML file as well as the 2 ports that follow, but stormworks only sends and receives data on the third port (eg, if you set your port to 25564, data is only being sent on 25566) (This is old information, forward all ports)
To keep your network as safe as possible (open ports are major security vulnerabilities), I recommend forwarding only the third port.
In the port forwarding rules section of your internet router, please forward all three ports, and only the UDP portion of that port. This should allow your server to be viewable in the server browser.
Should you fail to see your server, you may be on the same network or even computer as the server. If this is the case, you must install the microsoft loopback adapter.
- 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 Cancel in both windows.
- Enter in IP address field your external IP address (you can see it here for example [link])
- You can leave default Subnet mask
- Click OK buttons in opened windows to save settings
Ready for the Real First Run
Hopefully you completed all previous steps correctly. If not, complete the previous steps correctly.
(server64.exe that is, server.exe can only address 4gb of ram[www.quora.com])
Hopefully you can use the server now, but if you have issues, contact me on discord (thatcoolcat1#6969)
The glee and glory may be empowering right now, but what if the server crashes while you are away?
What if you want to authorize anyone that joins?
Well you are in the ONLY guide that provides this information. Continue on to save hours of coding and waiting for help on the sw official discord lua chat.
In-Game Scripts
Ripe for the picking, here are some mission scripts that you can use to preform different things in the game.
Mission scripts normally reside in the C:swdsromdatamissions directory. here you can find the default missions, and also where you should most likely put your missions as well.
For the following missions, preform this process to transfer the file.
- Paste the code into the lua editor in the mission editor
- Save the mission
- Copy the mission folder from the %appdata%RoamingStormworksdatamissions directory
- Paste the mission folder into the C:swdsromdatamissions directory
- Reference the mission in the server config XML file
Now for the scripts!
Server Management Scripting
Over the past month or so, I have been working on an interconnected system of autohotkey scripts in order to automatically restart my server, while also reporting to a log in a discord channel.
Here is a guide on how to implement that same system. script included.
Firstly, you must create a .bat file with this code and place it in the root directory (C:)
This code updates the server application when it is run, and is a dependency of the server management script.
Next, we have to install autohotkey so the script can be run.
- Go here[www.autohotkey.com]
- Download
- Install
- Done
And get a discord web hook set up in our discord server
- Open your Server Settings and head into the Integrations tab:
- Click the “Create Webhook” button to create a new webhook!
Now that we have the program to run the script, and the webhook set up, we must now paste the script.
- Right click on the desktop and select “new autohotkey script”
- Name the file “server manager”
- Right click on the file and open with notepad++
- Paste following code, and follow instructions after the code block
- Continue this list of instructions
- Edit lines 11 and 118 with your discord webhook URL
- Save the file
- In order to make this script run on startup, continue list.
- Close the file
- Hit Win+R
- Type shell:startup
- Enter
- Copy and paste the script file into this folder
- Right click on the file in the folder, and select “create shortcut”
- Copy the shortcut to the desktop so it is easier to start the script if it closes.
- Finished
Now you should be able to restart the computer, and see that the server starts up when the computer starts. It also updates every time that it starts, and if you close the server, or the server crashes, it should come back in a maximum time of around 7 seconds.
Conclusion
Great!
Hopefully this works, and if you followed every part of the guide, you understand alot about stormworks servers, how they function, and how to get your server running at the level of other professional sw servers.
_