Difference between revisions of "User:Nosoop/Guide/Setup"

From AlliedModders Wiki
Jump to: navigation, search
(Installing the Server: Add note on management panels)
m (Fix spacing)
 
(15 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
This page will walk you through manually installing the dedicated server software for your desired game, installing SourceMod, and selecting a text editor to use for development.
 
This page will walk you through manually installing the dedicated server software for your desired game, installing SourceMod, and selecting a text editor to use for development.
  
There are a number of third-party tools that can automate most of these steps, but we'll take the long way here so you understand exactly what goes on. If you are using a third-party tool to manage your server installation, refer to the tool's documentation for their instructions, then skip to [[#Installing SourceMod|Installing SourceMod]] to download the scripting toolchain for your desktop operating system.
+
There are a number of third-party tools that can automate most of these steps, but we'll stick to the first-party approach here to avoid abstractions from breaking under you.
 +
 
 +
If you are using a third-party tool to manage your server installation, refer to the tool's documentation for their instructions, then skip to [[#Installing SourceMod|Installing SourceMod]] to download the scripting toolchain for your desktop operating system.
  
 
= Installing the Server =
 
= Installing the Server =
  
{{note|While officially unsupported, SourceMod may be loaded on a game client (the game you launch); the server a game client creates is known as a listen server. However, there are many behavioral quirks that can only be reproduced on a listen server. It's highly recommended to stick to installing SourceMod on dedicated game server instances to ensure that any plugins you write will have the correct behavior.}}
+
{{note|<p>While officially unsupported, SourceMod may be loaded on a game client (the game you launch); the server a game client creates is known as a listen server. However, there are many behavioral quirks that can only be reproduced on a listen server, and you likely won't receive any solutions to those issues that aren't "use a dedicated server".</p>
 +
 
 +
<p>This guide does not provide instructions to load SourceMod on a game client. It's highly recommended to stick to installing SourceMod on dedicated game server instances to ensure that any plugins you write will have the correct behavior.</p>}}
  
 
To install the dedicated server software for the game of your choice, we will use <code>steamcmd</code>. If a game server provider (GSP) is hosting the server for you, skip this step as your provider has already provided you with an installation; if you are using a self-hosted game server management panel, refer to the instructions for your software of choice to install your game server in place of this step.
 
To install the dedicated server software for the game of your choice, we will use <code>steamcmd</code>. If a game server provider (GSP) is hosting the server for you, skip this step as your provider has already provided you with an installation; if you are using a self-hosted game server management panel, refer to the instructions for your software of choice to install your game server in place of this step.
Line 13: Line 17:
 
<code>steamcmd</code> is Valve's command-line Steam client. It is used to install and update dedicated game servers.
 
<code>steamcmd</code> is Valve's command-line Steam client. It is used to install and update dedicated game servers.
  
Refer to the [https://developer.valvesoftware.com/wiki/SteamCMD SteamCMD] section in the Valve Developer Wiki for download instructions. This varies on the operating system you're running the software on; you can either work on your own desktop or have a hosted (physical or virtual) machine off-premises.
+
Refer to [https://developer.valvesoftware.com/wiki/SteamCMD the SteamCMD entry] in the Valve Developer Wiki for download instructions. This varies on the operating system you're running the software on; you can either work on your own desktop or have a hosted (physical or virtual) machine off-premises.
 +
 
 +
Once <code>steamcmd</code> is extracted, you will need to install a game server. Continue reading the above wiki page to [https://developer.valvesoftware.com/wiki/SteamCMD#Running_SteamCMD run the application], [https://developer.valvesoftware.com/wiki/SteamCMD#SteamCMD_Login sign in (anonymously)], and [https://developer.valvesoftware.com/wiki/SteamCMD#Downloading_an_App download your game server].
  
Once <code>steamcmd</code> is extracted, you will need to install a game. Continue reading the above wiki page to run the application, sign in (anonymously), and download your game server.
+
You will need the AppID of the game's dedicated server to install it; note that it is different from the game client AppIDs. See the below table for that and additional related information for some of the supported games.
  
For your convenience, the following dedicated Source servers use the given Steam AppIDs (note that they are different from the game client AppIDs):
+
{{note|Be sure to write down the commands you used when installing the game server!  You will need to issue those commands again whenever the game is updated.}}
  
* Day of Defeat: Source: <code>232290</code>
+
{| class="wikitable"
* Team Fortress 2: <code>232250</code>
+
|+ Dedicated Server Information
* Counter-Strike: Source: <code>232330</code>
+
|-
* Counter-Strike: Global Offensive: <code>740</code>
+
! Game
* Left 4 Dead: <code>222840</code>
+
! AppID
* Left 4 Dead 2: <code>222860</code>
+
! Mod Directory
* Half-Life 2: Deathmatch: <code>232370</code>
+
! Notes
 +
|-
 +
| Day of Defeat: Source
 +
| <code>232290</code>
 +
| <code>dod</code>
 +
|-
 +
| Team Fortress 2
 +
| <code>232250</code>
 +
| <code>tf</code>
 +
|-
 +
| Counter-Strike: Source
 +
| <code>232330</code>
 +
| <code>cstrike</code>
 +
|-
 +
| Counter-Strike: Global Offensive
 +
| <code>740</code>
 +
| <code>csgo</code>
 +
|
 +
* As of 1.38.5.2 (2023-02-02), servers running under Linux will need to have a relatively modern libstdc++ installed.  [https://www.mail-archive.com/[email protected]/msg14291.html See this mailing list entry for further details.]
 +
* [[Introduction to SourceMod Plugins#Will SourceMod support Source 2? Will plugins for existing games continue to work if they are ported?|See the current state of Counter-Strike 2 here.]]
 +
|-
 +
| Left 4 Dead
 +
| <code>222840</code>
 +
| <code>left4dead</code>
 +
|
 +
* This is the one first-party game that requires a [https://www.metamodsource.net/?go=vdf custom VDF file for Metamod:Source].
 +
|-
 +
| Left 4 Dead 2
 +
| <code>222860</code>
 +
| <code>left4dead2</code>
 +
|-
 +
| Half-Life 2: Deathmatch
 +
| <code>232370</code>
 +
| <code>hl2mp</code>
 +
|-
 +
| No More Room in Hell
 +
| <code>317670</code>
 +
| <code>nmrih</code>
 +
|-
 +
| Zombie Panic! Source
 +
| <code>17505</code>
 +
| <code>zps</code>
 +
|-
 +
| Pirates, Vikings & Knights II
 +
| <code>17575</code>
 +
| <code>pvkii</code>
 +
|}
  
 
For post-install server configuration, take a look at the [[../Game Server Configuration|Game Server Configuration]] page.
 
For post-install server configuration, take a look at the [[../Game Server Configuration|Game Server Configuration]] page.
Line 39: Line 91:
 
#* Again, make sure you're downloading the correct package for your server; if you're using a hosted instance, it may not be using the same operating system as your personal desktop.
 
#* Again, make sure you're downloading the correct package for your server; if you're using a hosted instance, it may not be using the same operating system as your personal desktop.
 
# Copy the contents of the archive into your game's mod directory (one level below <code>srcds.exe</code> or <code>srcds_run</code>; the mod directory should contain <code>steam.inf</code>).
 
# Copy the contents of the archive into your game's mod directory (one level below <code>srcds.exe</code> or <code>srcds_run</code>; the mod directory should contain <code>steam.inf</code>).
#*You may need to extract the archive on, or upload the contents to a remote server.
+
#* You may need to extract the archive on, or upload the contents to a remote server.
#**If you are on Windows, the recommended software to use for extracting Linux (<tt>.tar.gz</tt>) archives is [https://www.7-zip.org/download.html 7-zip]; to upload files remotely via FTP, use [https://winscp.net/eng/index.php WinSCP].
+
#** If you are on Windows, the recommended software to use for extracting Linux (<tt>.tar.gz</tt>) archives is [https://www.7-zip.org/download.html 7-zip]; to upload files remotely via FTP, use [https://winscp.net/eng/index.php WinSCP].
#**If you are using a GSP, refer to their control panel.  Most provide FTP access, and some also allow for uploads directly via browser.
+
#** If you are using a GSP, refer to their control panel.  Most provide FTP access, and some also allow for uploads directly via browser.
 +
#** You should verify that the files were transmitted properly to the server; there have been reports of upload failures, zero-length files, and files that were mistakenly sent in text form and corrupted as a result.
 +
# After installing, you should verify that the installation was successful by starting your server and running <tt>meta version</tt>.  It should be treated as a known command at this stage.
 
#* Most games should work without further configuration, but if you find that MM:S isn't loading, you will want to [https://www.metamodsource.net/?go=vdf generate a custom VDF file].  Known games that require custom VDF files are:
 
#* Most games should work without further configuration, but if you find that MM:S isn't loading, you will want to [https://www.metamodsource.net/?go=vdf generate a custom VDF file].  Known games that require custom VDF files are:
 
#** Left 4 Dead 1
 
#** Left 4 Dead 1
 
#** Third-party mods using the Source SDK base
 
#** Third-party mods using the Source SDK base
#* Metamod:Source is known to fail to load on CS:GO servers running under Linux by default.  You will want to delete <tt>bin/libgcc_s.so.1</tt> relative to the installation directory.
+
#* Metamod:Source is known to fail to load on CS:GO servers running under Linux by default.  You will want to delete <tt>bin/libgcc_s.so.1</tt> relative to the installation directory, plus read the information in the next bullet point.
 +
#* If you are using a Linux server you have full control over, read over the [[User:Nosoop/Guide/Game Server Configuration#Platform-specific|Platform-specific setup]] information.
 +
#* Additional diagnostic information about load failures is available under <tt>metamod-fatal.log</tt>.
  
 
{{Note|On server startup, you may see an error message <tt>Unable to load plugin "addons/metamod/bin/${platform}64/server"</tt>.  This is normal behavior; the game server will always attempt to load both 32-bit and 64-bit binaries and fail on the one that doesn't match.  If you're sure that you're not running a 64-bit game server instance, you can delete <tt>addons/metamod_x64.vdf</tt> to only load the 32-bit version, or the other way around.}}
 
{{Note|On server startup, you may see an error message <tt>Unable to load plugin "addons/metamod/bin/${platform}64/server"</tt>.  This is normal behavior; the game server will always attempt to load both 32-bit and 64-bit binaries and fail on the one that doesn't match.  If you're sure that you're not running a 64-bit game server instance, you can delete <tt>addons/metamod_x64.vdf</tt> to only load the 32-bit version, or the other way around.}}
Line 57: Line 113:
  
 
If you plan on creating new plugins, you will also want to download SourceMod for your ''desktop'' operating system and extract the <code>addons/sourcemod/scripting/</code> folder to a location on your computer.
 
If you plan on creating new plugins, you will also want to download SourceMod for your ''desktop'' operating system and extract the <code>addons/sourcemod/scripting/</code> folder to a location on your computer.
 +
 +
In the future, you may need to follow [[Upgrading SourceMod|these instructions to upgrade SourceMod]] on your server because of:
 +
* game updates requiring SourceMod to be rebuilt against a new revision of the Source SDK
 +
* plugins compiled against newer versions of SourceMod to take advantage of added functionality
  
 
= Picking an IDE =
 
= Picking an IDE =
Line 66: Line 126:
 
The following editors are known to have good support for SourceMod plugins:
 
The following editors are known to have good support for SourceMod plugins:
  
* Spider (highly recommended when starting out due to it being zero-install; once you have multiple projects, move on to one of the non-web text editors)
+
* Spider &mdash; recommended when starting out due to it being zero-install; once you are doing more than one-off plugins, move on to one of the non-web text editors
 +
* Visual Studio Code (VSCode) &mdash; an increasingly popular choice combined with [https://marketplace.visualstudio.com/items?itemName=Sarrus.sourcepawn-vscode Sarrus's VSCode extension] [https://github.com/Sarrus1/sourcepawn-vscode (source code)]
 
* BasicPawn
 
* BasicPawn
 
* Notepad++
 
* Notepad++
 
* SPEdit
 
* SPEdit
* Sublime Text 3
+
* Sublime Text
* Visual Studio Code (VSCode)
 
  
 
For more details on each editor and, if necessary, how to set it up for writing SourceMod plugins, look at the [[../Development Environments|Development Environments]] section of the guide.
 
For more details on each editor and, if necessary, how to set it up for writing SourceMod plugins, look at the [[../Development Environments|Development Environments]] section of the guide.
  
 
Once you've settled on a development environment, you can start learning how to create plugins &mdash; head over to the [[../Basics|Basics]] section of the guide to get started.
 
Once you've settled on a development environment, you can start learning how to create plugins &mdash; head over to the [[../Basics|Basics]] section of the guide to get started.

Latest revision as of 16:35, 27 April 2024

This section assumes that you're starting out with nothing besides a desktop computer, an internet connection, and a drive to program some SourceMod plugins. No programming experience; no problem.

This page will walk you through manually installing the dedicated server software for your desired game, installing SourceMod, and selecting a text editor to use for development.

There are a number of third-party tools that can automate most of these steps, but we'll stick to the first-party approach here to avoid abstractions from breaking under you.

If you are using a third-party tool to manage your server installation, refer to the tool's documentation for their instructions, then skip to Installing SourceMod to download the scripting toolchain for your desktop operating system.

Installing the Server

Note:

While officially unsupported, SourceMod may be loaded on a game client (the game you launch); the server a game client creates is known as a listen server. However, there are many behavioral quirks that can only be reproduced on a listen server, and you likely won't receive any solutions to those issues that aren't "use a dedicated server".

This guide does not provide instructions to load SourceMod on a game client. It's highly recommended to stick to installing SourceMod on dedicated game server instances to ensure that any plugins you write will have the correct behavior.

To install the dedicated server software for the game of your choice, we will use steamcmd. If a game server provider (GSP) is hosting the server for you, skip this step as your provider has already provided you with an installation; if you are using a self-hosted game server management panel, refer to the instructions for your software of choice to install your game server in place of this step.

steamcmd is Valve's command-line Steam client. It is used to install and update dedicated game servers.

Refer to the SteamCMD entry in the Valve Developer Wiki for download instructions. This varies on the operating system you're running the software on; you can either work on your own desktop or have a hosted (physical or virtual) machine off-premises.

Once steamcmd is extracted, you will need to install a game server. Continue reading the above wiki page to run the application, sign in (anonymously), and download your game server.

You will need the AppID of the game's dedicated server to install it; note that it is different from the game client AppIDs. See the below table for that and additional related information for some of the supported games.

Note:Be sure to write down the commands you used when installing the game server! You will need to issue those commands again whenever the game is updated.
Dedicated Server Information
Game AppID Mod Directory Notes
Day of Defeat: Source 232290 dod
Team Fortress 2 232250 tf
Counter-Strike: Source 232330 cstrike
Counter-Strike: Global Offensive 740 csgo
Left 4 Dead 222840 left4dead
Left 4 Dead 2 222860 left4dead2
Half-Life 2: Deathmatch 232370 hl2mp
No More Room in Hell 317670 nmrih
Zombie Panic! Source 17505 zps
Pirates, Vikings & Knights II 17575 pvkii

For post-install server configuration, take a look at the Game Server Configuration page.

Installing Metamod:Source

Before you can install SourceMod on your server, you must first download and install Metamod:Source. Metamod:Source (MM:S) acts as a middleware for different Source Engine games, providing a unified interface for plugins to operate on the game.

SourceMod itself is an MM:S plugin.

  1. Download Metamod:Source. In most cases, you want a stable release. Use the download package according to your server's operating system.
    • If the latest download is unavailable, go down the "Latest 20 Builds" until you get to one that is.
    • Again, make sure you're downloading the correct package for your server; if you're using a hosted instance, it may not be using the same operating system as your personal desktop.
  2. Copy the contents of the archive into your game's mod directory (one level below srcds.exe or srcds_run; the mod directory should contain steam.inf).
    • You may need to extract the archive on, or upload the contents to a remote server.
      • If you are on Windows, the recommended software to use for extracting Linux (.tar.gz) archives is 7-zip; to upload files remotely via FTP, use WinSCP.
      • If you are using a GSP, refer to their control panel. Most provide FTP access, and some also allow for uploads directly via browser.
      • You should verify that the files were transmitted properly to the server; there have been reports of upload failures, zero-length files, and files that were mistakenly sent in text form and corrupted as a result.
  3. After installing, you should verify that the installation was successful by starting your server and running meta version. It should be treated as a known command at this stage.
    • Most games should work without further configuration, but if you find that MM:S isn't loading, you will want to generate a custom VDF file. Known games that require custom VDF files are:
      • Left 4 Dead 1
      • Third-party mods using the Source SDK base
    • Metamod:Source is known to fail to load on CS:GO servers running under Linux by default. You will want to delete bin/libgcc_s.so.1 relative to the installation directory, plus read the information in the next bullet point.
    • If you are using a Linux server you have full control over, read over the Platform-specific setup information.
    • Additional diagnostic information about load failures is available under metamod-fatal.log.
Note:On server startup, you may see an error message Unable to load plugin "addons/metamod/bin/${platform}64/server". This is normal behavior; the game server will always attempt to load both 32-bit and 64-bit binaries and fail on the one that doesn't match. If you're sure that you're not running a 64-bit game server instance, you can delete addons/metamod_x64.vdf to only load the 32-bit version, or the other way around.

Installing SourceMod

The following is mostly lifted from the Installing SourceMod page.

  1. Download SourceMod. Same as before; latest available stable release for your server's operating system.
  2. Copy the contents of the archive into your game's mod directory (one level below srcds.exe or srcds_run; the mod directory should contain steam.inf).

If you plan on creating new plugins, you will also want to download SourceMod for your desktop operating system and extract the addons/sourcemod/scripting/ folder to a location on your computer.

In the future, you may need to follow these instructions to upgrade SourceMod on your server because of:

  • game updates requiring SourceMod to be rebuilt against a new revision of the Source SDK
  • plugins compiled against newer versions of SourceMod to take advantage of added functionality

Picking an IDE

Now that you have the dedicated game server, Metamod:Source, and SourceMod installed, you have most of the tools you need.

If you've never done any programming, you'll need a text editor. It's completely possible to write code in plain old Notepad and invoke the compiler directly, but having a proper development environment makes it much easier to work with code.

The following editors are known to have good support for SourceMod plugins:

  • Spider — recommended when starting out due to it being zero-install; once you are doing more than one-off plugins, move on to one of the non-web text editors
  • Visual Studio Code (VSCode) — an increasingly popular choice combined with Sarrus's VSCode extension (source code)
  • BasicPawn
  • Notepad++
  • SPEdit
  • Sublime Text

For more details on each editor and, if necessary, how to set it up for writing SourceMod plugins, look at the Development Environments section of the guide.

Once you've settled on a development environment, you can start learning how to create plugins — head over to the Basics section of the guide to get started.