Team Fortress 2

Team Fortress 2

Not enough ratings
Team Fortress 2 Vintage: Linux Dedicated Server Setup
By sour dani and 1 collaborators
This is a guide on how to start a Source Dedicated Server in Linux for Team Fortress 2 Vintage!

This guide is based off of the Pre-Fortress 2 Linux Server guide
   
Award
Favorite
Favorited
Unfavorite
Introduction

Team Fortress 2 Vintage is a Source 2013 modification based off of Team Fortress 2 Classic as a re-imagining of retail TF2, focusing on being a museum to the game.

Feel free to give feedback in the comments!
1. Software requirements: Package Dependencies
Dependencies:
  • On 64-bit Ubuntu / Debian based distros run:
    sudo dpkg --add-architecture i386; sudo apt update; sudo apt install lib32gcc1 libstdc++6 libstdc++6:i386 libncurses5:i386 libtinfo5:i386 libcurl4-gnutls-dev:i386 screen 7za
    ⁠ ⁠ On 32-bit run:
    sudo apt install libstdc++6 libncurses5 libtinfo5 libcurl4-gnutls-dev screen 7za
  • On 64-bit CentOS / Fedora run:
    sudo yum install libgcc.x86_64 libgcc.i686 glibc.i686 libstdc++.x86_64 libstdc++.i686 ncurses-libs.i686 libcurl.i686 screen 7za
    ⁠ ⁠ * Use dnf instead of yum on Fedora/RHEL.

  • On Arch Linux run:
    sudo pacman -Syy lib32-gcc-libs gcc-libs lib32-ncurses lib32-libcurl-gnutls screen 7za
2. Install Steam CMD for Linux
For consistency's sake, we'll be working in a directory named servers in the home folder of a user named steam. You can folllow exactly what we do here or rename commands and paths accordingly to your setup.

If you haven't already, create a new directory named servers in your user's home directory if you and go into it
cd ~ mkdir servers && cd servers
Next, download the linux SteamCMD Tar archive and unpack it

You can now run steamcmd with
./steamcmd.sh
And exit it with
quit
3. Install TF2 and Source SDK 2013
For automation and ease of use's sake, we'll be using auto-update scripts to ease the updating process.

While still in the /servers/ directory, create a file named fullupdate.txt with the following contents:
@ShutdownOnFailedCommand 1 @NoPromptForPassword 1 login anonymous force_install_dir "./tf2d" app_update 232250 force_install_dir ./sdk app_update 244310 quit

And now to install the necessary Team Fortress 2 files and Source SDK 2013 MP files using that newly created script, run that script in steamcmd once with the following command:
./steamcmd.sh +runscript fullupdate.txt
This will install the necessary files in directories named /Team Fortress 2 Dedicated Server/ and /sdk/ within the /servers/ directory.
4. Install TF2 Vintage via Nightly Build
Go into the folder named /sdk/ from the previous step, and run this code line by line:
wget https://nightly.link/TF2V/TF2Vintage/workflows/release/3.6/tf2vintage.zip unzip tf2vintage.zip 7za x -y tf2vintage.7z rm -rf tf2vintage.zip tf2vintage.7z
This will download a copy of the latest files on the official Team Fortress 2 Vintage repository.
5. Final Links
Go into the /sdk/ directory and from there go into the /bin/ directory.
And in /sdk/bin paste & run these commands:
ln -s datacache_srv.so datacache.so ln -s dedicated_srv.so dedicated.so ln -s engine_srv.so engine.so ln -s materialsystem_srv.so materialsystem.so ln -s replay_srv.so replay.so ln -s scenefilecache_srv.so scenefilecache.so ln -s shaderapiempty_srv.so shaderapiempty.so ln -s soundemittersystem_srv.so soundemittersystem.so ln -s studiorender_srv.so studiorender.so ln -s vphysics_srv.so vphysics.so
6. Remounting TF2
For this section you need to access gameinfo.txt in the tf2vintage folder

Look for the line that says:
  • Mount in missing assets from TF2

The following entries should be in a row.
game_lv, game+mod, game+mod, game+mod+vgui, game+mod

Change them to:
game_lv "|all_source_engine_paths|../tf2d/tf/tf2_lv.vpk" game+mod "|all_source_engine_paths|../tf2d/tf/tf2_textures.vpk" game+mod "|all_source_engine_paths|../tf2d/tf/tf2_sound_misc.vpk" game+mod+vgui "|all_source_engine_paths|../tf2d/tf/tf2_misc.vpk" game+mod "|all_source_engine_paths|../tf2d/tf/tf2_sound_vo_english.vpk"

Towards the bottom of the page there should be a:
  • Load in all loose TF2 content second to last, to try and prevent as much overrides as possible.

Replace game+mod with:
game+mod "|all_source_engine_paths|../tf2d/tf/."

Save gameinfo.txt your server should now mount all the files correctly.
7. How to start the server
And that's all. Wasn't so hard, was it?
Now, how to run a server.

Create a script to run your server in the /servers/sdk/ directory, name it something like run-tf2v.sh. Here's a sample server run script.
#!/bin/sh ./srcds_run -console -game tf2vintage +maxplayers 24 +map ctf_2fort
Make it executable with
chmod +x run-tf2v.sh
Change the launch parameters of the script (whatever is after "./srcds_run") to your heart's content. Remember to keep -console -game tf2vintage though.

Run the newly created run-tf2v.sh script (prefferably in a screen - read below) to start the server.
It's recommended to run the server in a screen session. Screen is a utility that allows you to run things in "virtual" consoles, so that you can easily attach or detach them, allowing you to run the server without having a terminal open all the time.

To start a new screen session, just type
screen -dmS tf2v ./run-tf2v.sh
Your new screen session will be automatically "detached".

To reattach a screen session, type
screen -r tf2v
  • To detach from the screen session, press CTRL+A and then D.
  • To kill a screen session, just press CTRL+D while in the screen.
8. Auto Updating
It's important to keep your gameserver updated, otherwise players who update their local copies will eventually encounter problems or won't be able to play on your server at all.

To update TF2 and and SDK 2013 automatically, place the following in your launch parameters in /servers/sdk/run-tf2v.sh:
-autoupdate -steam_dir ~/servers -steamcmd_script ~/servers/sdk/fullupdate.txt

For Pre Fortress 2 content however you'll need something more.
Here's a script that will update just Pre Fortress 2 in the setup from this guide. Place it in the /servers/sdk directory and name it update-tf2v.sh and make it executable (with chmod +x)
#!/bin/bash mv tf2vintage/gameinfo.txt temp-gameinfo.txt wget https://nightly.link/TF2V/TF2Vintage/workflows/release/3.6/tf2vintage.zip unzip tf2vintage.zip # Wait till it's downloaded screen -X -S tf2v quit 7za x -y tf2vintage.7z rm -rf tf2vintage.zip tf2vintage.7z mv -f temp-gameinfo.txt tf2vintage/gameinfo.txt screen -dmS pf2 ./run-tf2v.sh

Now, this script won't run itself, so run
crontab -e
Pick your editor of choice (if it prompts you) and at the end of the file place the following:
0 5 * * * cd /home/steam/servers/sdk && ./update-tf2v.sh
This will check every day at 5AM for an update and restart the server.
9. Server settings, configuration
Whatever comes out of the box doesn't have to be your server forever! Team Fortress 2 Vintage and the Source engine have a LOT of server settings that can change how your server works, what gamemodes it runs etc.



To change them, create a file named server.cfg if it doesn't exist in the ~/servers/sdk/tf2vintage/cfg/ directory and edit it with your custom Convars (Console Variables), which control the server's functionality.
A few notable Convars:
// Changes your server's name visible in the server browser. hostname "My Swaggy Video Game Server" // Sets your RCON password to allow for remote console command execution on the server. // DO NOT SHARE THIS! This grants anyone who has the password control over your server! rcon_password "thisPasswordShouldBeVeryLongAnd_c0mpl1c4t3d!@#$" // Set to 1 to make your server LAN-only. Keep at 0 otherwise. sv_lan 0 // Time per map in the rotation, in minutes. 0 to never rotate the map on a timer. mp_timelimit 10 // Maximum number of rounds to play per map before forcing a mapchange mp_maxrounds 1 // Allow clients to upload customization files (e.g. sprays) sv_allowupload 1 // Allow clients to download files (e.g. sprays, custom maps, custom content, etc.) sv_allowdownload 1 // Maximum allowed file size for uploading in MB (Optional) net_maxfilesize 15
Type tf_ inside the in-game console to find configs you prefer on your server.
Documentation on TF2 Vintage specific convars is currently only available for internal use at this time.

There are also launch parameters, settings that only can be applied on server start. They are the settings with dashes (-) or pluses (+) visible after
./srcds_run
In your run-tf2v.sh file. Change any launch parameters over there.
Launch parameters with pluses (+) instead of dashes (-) are console commands that will be executed on server start but can also be run while the server is running. Parameters with minuses cannot. These launch options have to go inside your run-tf2v.sh file.
Most popular launch parameters:
// Sets your server's max player connected limit. +maxplayers 24 // Bind the server to a different port (27015 is the default) -port 27015 // Disables VAC. -insecure // Timeout before the server restarts if it crashes. Only works if you have // the -autoupdate parameters from the previous step. -timeout 0 // Disables SourceTV functionality on your server - may reduce RAM used by the server. -nohltv // The map that the server starts with. Use the changelevel command if the // server is already running instead of map. +map ctf_badlands
10. (Optional) Using GitHub/GitLab as FastDL Server
If your server uses custom maps and you want your players to be able to download the maps quickly.

Made by Cyanide originally for use with TF2Classic
Compatible with any Source Mod.

If you're using GitLab please follow this guide

Code from the Video
server.cfg
sv_allowdownload 1 sv_allowupload 1 sv_downloadurl "https://USERNAME.github.io/fast-dl/tf2vintage"

index.html
<!doctype html> <html> <body> <p>This is a blank webpage.</p> </body> </html>
Outro
Your server should be ready to have hours of Team Fortress 2 Vintage fun!
Please share your servers with us on the Discord![discord.gg]
Check the latest version of the URL link on the Team Fortress 2 Vintage Steam Group

For any troubleshooting please visit our Discord!
Troubleshooting!
Please check the TF2V Discord server[discord.gg] first before posting your errors here. We are more likely to get to your questions there!

Please also look at the OF Linux Server guide we referenced, as your problem might have already been solved in their troubleshooting section.

  • My server didn't start!
    Make sure you followed the instructions exactly as specified. Look over your files to see if you put any binaries in the wrong folder when doing the "Final Links" step.