American Truck Simulator

American Truck Simulator

27 beoordelingen
American Truck Simulator - Dedicated Server Setup
Door MaDmaX
Setup a ATS Dedicated Server on Windows.
2
   
Prijs
Toevoegen aan favorieten
Toegevoegd aan favorieten
Verwijderen uit favorieten
Get SteamCMD
Download SteamCMD and extract it wherever you want preferably in a folder.

Open it and wait!
Install the Server
Create a .bat file eg "updater.bat" where SteamCMD is located and paste following:

steamcmd.exe +force_install_dir "C:\GameServer\" +login anonymous +app_update 2239530 +quit pause

Edit force install dir as necessary.

And run it. Meanwhile go to next step.
Enable Console & Export Server Packages
Go to "C:\Users\%username%\Documents\American Truck Simulator" and open up the config.cfg and edit following:

uset g_developer "0"
to
uset g_developer "1"


uset g_console "0"
to
uset g_console "1"

Save file!



Now run ATS and hit the console key "~" and enter following:

export_server_packages
or
export_server_packages destination file

Wait until its finished!


2 new files has been created in \Documents\American Truck Simulator:

server_packages.dat
- contains internal map data
server_packages.sii
- contains map details, dlc and mods configuration
Generate & Configure the Server Config
First launch will create server home folder and default server_config.sii.

By default server home directory is configured to point at the Game User Path. C:\Users\<your_user_name>\Documents\<game_name>

This location can be changed with -homedir start up parameter, however it must be changed for both game and server.

Next you will receive following error: "<ERROR> [MP] Error: Server packages file not found. This is required to load proper map, DLCs and mods". This means, you have to provide additional server configuration according to following steps.


Optional:
You can create a .bat file and set your home directory which you will find the following file.

amtrucks_server.exe -homedir "C:\GameServer\ATSDocs"


By default in your \Documents\American Truck Simulator following file should be created:

server_config.sii
- contains session description and configuration, connections ports info, logon token and list of moderators
- ports and logon token must be different for each session instance running at the same time
- default configuration is generated automatically


Open it up and start editing as you wishes.


Note:
If you have set a homedir, you must put following files in there:
server_packages.dat
server_packages.sii
Required files to run dedicated server
In the server/game home folder the following files are used to set up a dedicated server session:

server_config.sii

contains session description and configuration, connections ports info, logon token and list of moderators
ports and logon token must be different for each session instance running at the same time
default configuration, which is generated automatically on first launch
server_packages.sii

contains map details, dlc and mods configuration
server_packages.dat

contains internal map data
server_packages.sii and server_packages.dat must be generated manually via calling the `export_server_packages` command while normal game is running. Generated configuration will mirror your game configuration. These files are necessary for a dedicated server to start. If you are running a server without the base game installed on it, you have to manually copy these files to the server home directory.

These files are NOT linked to your account in any way.
Adding Moderators
Please note that the following entry already exists:

moderator_list: 0


Add following to "server_config.sii":

moderator_list: 1
moderator_list[0]: 76561198001220177
(steamID64)


like:

moderator_list: 1
moderator_list[0]: 76561198001220177
76561198001245683


Any player who is a moderator can now change the game time. This can be done via chat message box by sending message `/set_time HH:MM'


Hint:

Find your SteamID64 here: https://www.steamidfinder.com/
Server Commands
Any player who is a moderator can now change the game time or disable rain. This can be done via chat message box by sending a message containing an admin command. Available admin commands are

/set_time <HH:MM>
/set_rain_factor <value from 0 to 1>
/help
Server Logon Token - Steam Gameserver Token
By default whenever a dedicated server is launched it is using an anonymous account. For such an account non-persistent server id is generated (used for direct search). To avoid this you can acquire a logon token on https://steamcommunity.com/dev/managegameservers (game ownership is required).


Enter the token in following value in "server_config.sii":

server_logon_token: "TOKEN HERE"
How to launch a dedicated server
You can launch the dedicated server by directly starting its executable. Game ownership is not required. If you want to launch a server with different configuration, use following startup parameters:

-homedir "set a home directory"
-server "server packages file name"
-server_cfg "server config file name"


Exemple for a Single Server and homedir:
amtrucks_server.exe -homedir "C:\GameServer\ATSDocs\"

Exemple for a none Single Server and homedir:
amtrucks_server.exe -nosingle -homedir "C:\GameServer\ATSDocs2\"

Exemple for a none Single Server, different server files and no homedir:
amtrucks_server.exe -nosingle -server "server_packages_en.sii" -server_cfg "server_config_en.sii"

No homedir means, the gameserver will use the default location, Documents American Truck Simulator.

You do not need to rename the server files if you set a -homedir if you want to setup multible instances.
Port Forwarding & Firewall Whitelist
Dedicated server does not handle NAT punching and public IP or port forwarding is required to show server in session browser.
However, session direct search works even for server that is behind NAT and it is possible to connect to such server.

Search id is listed when starting dedicated server or in convoy info screen for hosted sessions.


You need to open following ports:

TCP port 27015-27016
UDP port 27015-27016


If you run it on a Root or VPS you only must add it to your Firewall. If local pc then both.
Hint for Root or VPS users
You do not have the ATS folder in your documents at your Root or VPS. If you installed the Server, just start it once to generate the ATS documents folder.

And yeah its clear to understand i mean, that you need to copy the server packages to the Root or VPS ATS documents folder.

Or if you have set a homedir then there.
Useful: Auto Restarter on Server Crash
Create a .bat file where "amtrucks_server.exe" is located and paste following:

::Made by eRazeri @echo off C:\Windows\System32\mode con cols=50 lines=3 >nul set /a var=0 :start echo Running ATS Server start "" /wait /HIGH "amtrucks_server.exe" set /a var+=1 cls echo Server has crashed %var% times, restarting goto start
29 opmerkingen
TRAPSPOTSAVAGE 30 dec 2024 om 19:47 
onknown commanbd???
SireDragonChester 26 jul 2023 om 17:15 
@thomaskloos

No as far I know you just need generate the file in ATS Game, then copy that to your server. But ever other server I have ever ran (Bob/Ark/7days etc). The dedicated server has always also required mods too.

As said for me the dedi server is not stable and docs/info for its almost non existing/poorly written atm. I gave up running dedi cus just seems too buggy atm. unless somebody else is more experience with setting it up and or actually get one running correctly (With mods) and not randomly kicking off the server.

As said as ex beta tester/serv admin/ex mod (Tech help guy) from small indie dev team. This first dedicated server software I ran that didn't req actually copy of the mods, which is very strange imo.
thomaskloos 21 jul 2023 om 2:13 
So do you have to actually upload the mods to the mod folder? Or just use the export_server_packages command? I don't think we have to upload the actual mods.
SireDragonChester 5 mei 2023 om 20:05 
Anybody having there server randomly kick you and any friends off with "Error reason 7" or "Reason 8?" (which seem to point to server loosing connection with steam)

If anybody having this issue? please let me know. Cus I think SCS needs fix it.
Thanks.
𝔾𝕒𝕝𝕖𝕘𝕠 5 mei 2023 om 19:42 
Thank you very much for the guide! :steamthis:
SireDragonChester 26 apr 2023 om 11:44 
How do you upload SCS DLC's? I got my server showing up now, was minor mistake I made in server_config. But there no doc on how upload the DLC? per docs, it say you don't need to upload any maps or mods? Just the server packages. which I have done.

Also for some reason my server keep randomly kicking us both off with error reason 7 or reason 8. This is so frustration compared to any other server I have run, the docs are horrible. The dedi has run bit better, AI seem smarter, but keeps kicking me and friend off server, but server hasn't crashed or anything.

As ex beta tester/smaller server admin/ex mod (Tech help guy) from another small indie dev team, this is worst dedi server I've ever used.

Thanks for your site, it has been useful, but SCS needs to improve there documentation. Dedicated server feels very beta.
MaDmaX  [auteur] 25 apr 2023 om 0:08 
Always you add or remove mods you need to generate the server_packages. And also you need to upload them to the server itself.
SireDragonChester 24 apr 2023 om 11:01 
My server is not showing all the DLC installed, but I created server_packages.dat
server_packages.sii and they show all DLC but server is not see or reading them.

Is there something I am missing or need to config for server list all DLC as installed?
I've seen few other servers list all DLC, but mine just shows one DLC.

Thanks
MaDmaX  [auteur] 3 mrt 2023 om 21:11 
@dhparadox74
This is the only and one command available.
dhparadox74 3 mrt 2023 om 20:25 
are there any other moderator commands than /set_time? I cant find a list of commands