Server configuration: различия между версиями
(overhaul) |
м (→Configuration) |
||
Строка 53: | Строка 53: | ||
You can set what threads Turbostroi should use to get even better perfomance: | 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> | <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> | <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. | 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. |
Версия 23:21, 25 марта 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
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.