Server configuration: различия между версиями
(не показано 26 промежуточных версий 5 участников) | |||
Строка 5: | Строка 5: | ||
| en = Server configuration | | en = Server configuration | ||
}} | }} | ||
+ | For the best Metrostroi experience you should set up a dedicated server using Source Dedicated Server (srcds). This page contains instructions on how to set up a server, populate it with Metrostroi content and play on it. | ||
− | + | {{Important|The machine on which you intend to run this server should be running Windows or a Windows virtual machine. This is because it is highly recommended to install Turbostroi, a Windows-only binary that allows far greater performance. Servers hosted on other operating systems will perform poorly without Turbostroi.}} | |
− | + | ||
− | + | =Setting up a basic server = | |
− | + | Follow [https://wiki.facepunch.com/gmod/Downloading_a_Dedicated_Server this guide] to install a basic Garry's Mod server. This server will have no extra content other than the base game. There are lots of high-quality server setup and maintenance guides available on Google/Bing/Yandex/etc. | |
− | <pre> | + | {{Important|You must set the server tickrate to 33 or Metrostroi may be unstable. Add this to the server launch command-line: <pre>-tickrate 33</pre>}} |
− | + | ||
− | + | =Installing Metrostroi= | |
− | </pre> | + | The easiest way to install addons on a dedicated sever is to connect the server to a Steam Workshop collection. |
− | + | ||
− | = | + | If you will only be playing Metrostroi on this server, the [https://steamcommunity.com/sharedfiles/filedetails/?id=1660685783 default Metrostroi collection] (ID 1660685783) will be adequate. |
− | The | + | |
+ | Alternatively, you can add more content, even content not related to Metrostroi, by making your own collection. You can can do this [https://steamcommunity.com/workshop/editcollection/?appid=4000 here]. (Make sure you are signed in to Steam on your browser before clicking this link or it will redirect you somewhere else) This collection should contain at an absolute minimum: | ||
* [http://steamcommunity.com/workshop/filedetails/?id=261801217 Metrostroi (Subway Simulator)] | * [http://steamcommunity.com/workshop/filedetails/?id=261801217 Metrostroi (Subway Simulator)] | ||
− | * Metrostroi Subway Simulator - Content | + | * Metrostroi Subway Simulator - Content Packs: |
− | * | + | ** [https://steamcommunity.com/workshop/filedetails/?id=1095094174 Part 1] |
− | * | + | ** [https://steamcommunity.com/workshop/filedetails/?id=1095098251 Part 2] |
+ | ** [https://steamcommunity.com/workshop/filedetails/?id=1095100683 Part 3] | ||
+ | ** [https://steamcommunity.com/workshop/filedetails/?id=1095105863 Part 4] | ||
+ | ** [https://steamcommunity.com/workshop/filedetails/?id=1095109617 Part 5] | ||
+ | ** [https://steamcommunity.com/workshop/filedetails/?id=1095111608 Part 6] | ||
+ | * [https://steamcommunity.com/workshop/filedetails/?id=1095130789 Metrostroi Subway Simulator - Scripts] | ||
+ | * Any of the Metrostroi maps from [https://wiki.metrostroi.net/wiki/List_of_maps here] or [https://steamcommunity.com/workshop/browse/?appid=4000&searchtext=Metrostroi&childpublishedfileid=0&browsesort=textsearch§ion=items&requiredtags%5B%5D=Map here]. | ||
+ | |||
+ | You must then append the server startup command-line with the following: | ||
+ | <pre>+host_workshop_collection WORKSHOPID</pre> | ||
+ | {{Important|'''Replace WORKSHOPID with either 1660685783 (the default collection) or your own collection ID.''' A collection's ID is found at the end of the collection's URL.}} | ||
+ | |||
+ | ==Configuration== | ||
+ | A list of available convars is available [https://wiki.metrostroi.net/wiki/Console_Commands#Server-side_Commands here]. | ||
+ | |||
+ | As a server administrator you can enable the use of Metrostroi trains on non-Metrostroi maps by unchecking the box "Require third rail" in the spawn menu (hold Q) under Utilities, Metrostroi, Admin. Many trains will still expect an ARS signal and may not work well without it. | ||
+ | |||
+ | The [https://steamcommunity.com/sharedfiles/filedetails/?id=1838480881 Metrostroi Advanced] addon provides additional facilities for server administrators, as well as quality-of-life enhancements for players such as station teleports and an automatic train re-railer. It requires [https://steamcommunity.com/workshop/filedetails/?id ULX], which in turn requires [https://steamcommunity.com/workshop/filedetails/?id=557962238 ULib]. | ||
+ | |||
+ | =Installing Turbostroi= | ||
+ | Turbostroi speeds up the Metrostroi simulations by allowing the simulations to use multiple CPU threads, improving performance. A dedicated server with Turbostroi installed is often over 5x as fast as playing Metrostroi in the built-in Singleplayer mode in Garry's Mod. | ||
+ | |||
+ | {{Important|'''Turbostroi is only compatible with the Windows version of the Garry's Mod server. It is not compatible with Garry's Mod servers on other operating systems or the game itself.'''}} | ||
+ | |||
+ | Download the Turbostroi binary from [https://metrostroi.net/turbostroi here] and place it into the "/garrysmod/lua/bin/" folder in your server. Create the "bin" folder if it isn't already present. | ||
+ | |||
+ | {{Important|Because it is a DLL file, some web browsers may mark the Turbostroi file as harmful. This is a false positive and can be safely ignored. VirusTotal results for Turbostroi can be viewed [https://www.virustotal.com/gui/file/fca58b3700d2753db783bb1d9cdec399ce5e3a8cb92eae6f47555093954982f0/detection here].}} | ||
+ | |||
+ | ==Configuration== | ||
+ | '''It is recommended to disable hyper-threading if possible.''' | ||
+ | |||
+ | You can set what threads Turbostroi should use to get even better perfomance: | ||
+ | |||
+ | This command sets the SRCDS main thread to x, where x is a binary or bitwise value. | ||
+ | <pre>turbostroi_main_cores x</pre> | ||
+ | |||
+ | This command sets the Metrostroi train threads to x, where x is a binary or bitwise value. | ||
+ | <pre>turbostroi_train_cores x</pre> | ||
+ | |||
+ | For example, on a 4-core system you should set turbostroi_main_cores and turbostroi_train_cores to 8 and 7 respectively, or 128 and 127 respectively with hyperthreading enabled. This setup will run the main SRCDS thread on the last CPU thread, leaving the rest for Metrostroi. | ||
+ | |||
+ | =Connecting to the server= | ||
+ | The method for connecting to the Metrostroi server varies depending on your circumstances. | ||
+ | |||
+ | ==Localhost LAN== | ||
+ | If you are playing by yourself and hosting the server on the same computer you are playing on, the game server should appear in the LAN section of the server browser in Garry's Mod. Alternatively, you can run this in the Garry's Mod developer console: <pre>connect localhost</pre> | ||
+ | |||
+ | ==LAN== | ||
+ | If you are playing by yourself and hosting the server on a different computer to the one you are playing on, the game server should appear in the LAN section of the server browser in Garry's Mod. Alternatively, if you know the other computer's local IP address (normally starting with 192) you can connect to it by running this in the Garry's Mod developer console: <pre>connect IPADDRESS</pre> (where IPADDRESS is replaced with the other computer's local IP) | ||
+ | |||
+ | You can find a computer's local IP address by running the [https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/ipconfig ipconfig] command in Command Prompt on Windows. | ||
+ | |||
+ | ==WAN== | ||
+ | If you are hosting the server on a computer on a different network to the computer on which you will be playing, or you wish to make your server open for multiplayer, you will need to forward ports 27005 and 27015 on the router for both TCP and UDP. The exact process for this varies between routers; [https://portforward.com/ portforward.com] hosts comprehensive guides for thousands of routers. | ||
+ | |||
+ | Once you have forwarded ports 27005 and 27015, you can connect to the server with its public IP address. You can find its public IP by opening [https://www.whatismyip.com/ this link] on the server computer. Run this command in the Garry's Mod developer console to connect: | ||
+ | <pre>connect IPADDRESS</pre> | ||
+ | (where IPADDRESS is replaced with the server's public IP). The server should also automatically appear in the server browser. | ||
− | + | You can password protect your server to prevent strangers from joining by adding the following to the /garrysmod/cfg/server.cfg file in the server: <pre>sv_password "PASSWORD"</pre> where PASSWORD is replaced with a password of your choice. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Текущая версия на 04:16, 24 апреля 2021
Available languages: Русский · English |
For the best Metrostroi experience you should set up a dedicated server using Source Dedicated Server (srcds). This page contains instructions on how to set up a server, populate it with Metrostroi content and play on it.
Setting up a basic server
Follow this guide to install a basic Garry's Mod server. This server will have no extra content other than the base game. There are lots of high-quality server setup and maintenance guides available on Google/Bing/Yandex/etc.
-tickrate 33
Installing Metrostroi
The easiest way to install addons on a dedicated sever is to connect the server to a Steam Workshop collection.
If you will only be playing Metrostroi on this server, the default Metrostroi collection (ID 1660685783) will be adequate.
Alternatively, you can add more content, even content not related to Metrostroi, by making your own collection. You can can do this here. (Make sure you are signed in to Steam on your browser before clicking this link or it will redirect you somewhere else) This collection should contain at an absolute minimum:
- Metrostroi (Subway Simulator)
- Metrostroi Subway Simulator - Content Packs:
- Metrostroi Subway Simulator - Scripts
- Any of the Metrostroi maps from here or here.
You must then append the server startup command-line with the following:
+host_workshop_collection WORKSHOPID
Configuration
A list of available convars is available here.
As a server administrator you can enable the use of Metrostroi trains on non-Metrostroi maps by unchecking the box "Require third rail" in the spawn menu (hold Q) under Utilities, Metrostroi, Admin. Many trains will still expect an ARS signal and may not work well without it.
The Metrostroi Advanced addon provides additional facilities for server administrators, as well as quality-of-life enhancements for players such as station teleports and an automatic train re-railer. It requires ULX, which in turn requires ULib.
Installing Turbostroi
Turbostroi speeds up the Metrostroi simulations by allowing the simulations to use multiple CPU threads, improving performance. A dedicated server with Turbostroi installed is often over 5x as fast as playing Metrostroi in the built-in Singleplayer mode in Garry's Mod.
Download the Turbostroi binary from here and place it into the "/garrysmod/lua/bin/" folder in your server. Create the "bin" folder if it isn't already present.
Configuration
It is recommended to disable hyper-threading if possible.
You can set what threads Turbostroi should use to get even better perfomance:
This command sets the SRCDS main thread to x, where x is a binary or bitwise value.
turbostroi_main_cores x
This command sets the Metrostroi train threads to x, where x is a binary or bitwise value.
turbostroi_train_cores x
For example, on a 4-core system you should set turbostroi_main_cores and turbostroi_train_cores to 8 and 7 respectively, or 128 and 127 respectively with hyperthreading enabled. This setup will run the main SRCDS thread on the last CPU thread, leaving the rest for Metrostroi.
Connecting to the server
The method for connecting to the Metrostroi server varies depending on your circumstances.
Localhost LAN
If you are playing by yourself and hosting the server on the same computer you are playing on, the game server should appear in the LAN section of the server browser in Garry's Mod. Alternatively, you can run this in the Garry's Mod developer console:
connect localhost
LAN
If you are playing by yourself and hosting the server on a different computer to the one you are playing on, the game server should appear in the LAN section of the server browser in Garry's Mod. Alternatively, if you know the other computer's local IP address (normally starting with 192) you can connect to it by running this in the Garry's Mod developer console:
connect IPADDRESS
(where IPADDRESS is replaced with the other computer's local IP)
You can find a computer's local IP address by running the ipconfig command in Command Prompt on Windows.
WAN
If you are hosting the server on a computer on a different network to the computer on which you will be playing, or you wish to make your server open for multiplayer, you will need to forward ports 27005 and 27015 on the router for both TCP and UDP. The exact process for this varies between routers; portforward.com hosts comprehensive guides for thousands of routers.
Once you have forwarded ports 27005 and 27015, you can connect to the server with its public IP address. You can find its public IP by opening this link on the server computer. Run this command in the Garry's Mod developer console to connect:
connect IPADDRESS
(where IPADDRESS is replaced with the server's public IP). The server should also automatically appear in the server browser.
You can password protect your server to prevent strangers from joining by adding the following to the /garrysmod/cfg/server.cfg file in the server:
sv_password "PASSWORD"
where PASSWORD is replaced with a password of your choice.