Garry's Mod dedicated server meta-guide (Non-final)
6 replies, posted
[B]Disclaimer: Not responsible for any confusion induced by this tutorial. If you don't understand the basics underlined from here on out, you don't deserve to have a server of your own.[/B]
[B] SECOND more important disclaimer: Make sure to edit the files posted to your needs. I'm not going to help you if you come to me saying: ohmagawd i kant kunnekt to ip 192.168.2.5! zomg u quack! [/B]
I'm going to keep this moderately concise. Feel free to post / pm if you need help.
[B]Requirements[/B]
[LIST=1]
[*]A dedicated server computer. I don't care if you have multiple cores and dual LAN cards. It's the stupidest idea EVER to host the server on your local machine. I don't even think it works.
[*]A good internet connection (512k if it's a dedicated connection, many more if not. Dedicated as in, nobody uses it but your server.)
[*]A Windows OS. Anything Win2K up should work just fine. Windows Server Edition == Bonus points (Less bloat, when you get down to it. You're not running accelerated graphics or media daemons. Vista and Seven are no-no's unless you're using classic theme.)
[*]A brain. This takes a bit of tweaking to get right.
[*]Some patience. Actually, lots of patience.
[/LIST]
[B]Installing the base[/B]
Go [URL="http://srcds.com/"]here[/URL] and download the Windows version of SRCDS. Ignore everything else.
Access your server, copy the install file, and install to [B]C:\srcds[/B] for easy access.
Now, open up Notepad, and copy and paste these lines.
[CODE]@echo off
cd .\
echo Updating/installing CS:S
hldsupdatetool -command update -game "Counter-Strike Source" -dir .
echo Updating/installing dods
hldsupdatetool -command update -game "dods" -dir .
echo Updating/installing hl2mp
hldsupdatetool -command update -game "hl2mp" -dir .
echo Updating/installing tf
hldsupdatetool -command update -game "tf" -dir .
echo Installing Episodic Content
hldsupdatetool -command update -game "episode1" -dir .
echo Updating/installing Garrysmod
hldsupdatetool -command update -game garrysmod -verify_all -retry -dir .
echo Update/installation Complete
pause
[/CODE]
Here's the tricky part.
[LIST=1]
[*]Click File > Save As...
[*]In the file name box, type hldsupdater.bat
[*]In the box that says "Text documents (.txt)", change it to All Files (*.*)
[*]Leave encoding set to whatever it is. It doesn't matter.
[*]Save it to C:\srcds
[/LIST]
Volia. If there are game content files that you don't want, remove the two lines for it from the batch file.
For example, lets say I don't want DOD:S on my server. I remove this:
[CODE]echo Updating/installing dods
hldsupdatetool -command update -game "dods" -dir .[/CODE]
Anyways. Let that sucker run, It will take a while.
[B]Customizing[/B]
You have to do some tweaking now.
Your server's garrysmod folder is C:\srcds\orangebox\garrysmod now, so you can install addons that you like. Remember this, though. The more addons you have, the more likely it is that you will get join crashes when people join. This is even more true on weaker serving machines. Trust me, I've spent hours picking out addons that I simply don't need because they just joincrash so much.
Add maps too, you can never have too many maps.
So, now you have addons and maps. This is good, but we still need to configure some server settings.
Rule of thumb: It is an addon, when, if you go inside the folder it has a file called "info.txt"
If it's an addon, go out of the folder and drag the entire folder into the addons folder.
Open up the cfg folder inside your server's garrysmod folder. Create a file called "server.cfg" if it doesn't already exist (Use the method we did earlier, saving a file as All Files (*.*) except instead of hldsupdate.bat, use server.cfg)
Here is an example, taken from my server.
[CODE]"ServerSettings"
{
"hostname" "Ark's 24/7 Spacebuild of WIN"
"rcon_password" "nottherealpassword"
"sv_password" ""
"sv_region" "0" // eastcoast: 0 - westcoast: 1 - south america: 2 - europe: 3 - asia: 4 - australia: 5 - middle east: 6 - africa: 7 - world: 255
"sv_lan" "0"
fps_max 700
// Sandbox server settings
"sbox_allownpcs" "1"
"sbox_godmode" "0"
"sbox_plpldamage" "0" // set this to 1 to disable player vs player damage.
"sbox_playergod" "0"
"sbox_noclip" "1"
// Sandbox limits
"sbox_maxprops" "150"
"sbox_maxragdolls" "5"
"sbox_maxnpcs" "10"
"sbox_maxballoons" "10"
"sbox_maxeffects" "50"
"sbox_maxdynamite" "10"
"sbox_maxlamps" "20"
"sbox_maxthrusters" "30"
"sbox_maxwheels" "20"
"sbox_maxhoverballs" "20"
"sbox_maxvehicles" "6"
"sbox_maxbuttons" "20"
"sbox_maxsents" "20"
"sbox_maxemitters" "5"
"sbox_maxspawners" "3"
"sbox_maxturrets" "2"
"sbox_maxwire_wheels" "20"
"sbox_maxwire_waypoints" "30"
"sbox_maxwire_values" "20"
"sbox_maxwire_twoway_radioes" "30"
"sbox_maxwire_turret" "10"
"sbox_maxwire_thrusters" "30"
"sbox_maxwire_target_finders" "10"
"sbox_maxwire_speedometers" "14"
"sbox_maxwire_emitters" "25"
"sbox_maxwire_simple_explosive" "30"
"sbox_maxwire_sensors" "30"
"sbox_maxwire_screens" "20"
"sbox_maxwire_relays" "20"
"sbox_maxwire_rangers" "20"
"sbox_maxwire_radioes" "30"
"sbox_maxwire_sockets" "20"
"sbox_maxwire_plugs" "20"
"sbox_maxwire_pixels" "20"
"sbox_maxwire_panels" "20"
"sbox_maxwire_outputs" "20"
"sbox_maxwire_oscilloscopes" "20"
"sbox_maxwire_locators" "30"
"sbox_maxwire_lights" "16"
"sbox_maxwire_inputs" "20"
"sbox_maxwire_indicators" "21"
"sbox_maxwire_hoverballs" "20"
"sbox_maxwire_gyroscopes" "10"
"sbox_maxwire_gpss" "10"
"sbox_maxwire_gate_trigs" "30"
"sbox_maxwire_gate_times" "30"
"sbox_maxwire_gate_selections" "30"
"sbox_maxwire_gate_memorys" "30"
"sbox_maxwire_gate_logics" "30"
"sbox_maxwire_gate_comparisons" "30"
"sbox_maxwire_gates" "50"
"sbox_maxwire_explosive" "30"
"sbox_maxwire_dual_inputs" "20"
"sbox_maxwire_detonators" "20"
"sbox_maxwire_buttons" "25"
"sbox_maxwire_adv_inputs" "20"
}[/CODE]
Adjust to your needs. If you want to use less system resources set the limits lower. I just wing it and change the limits in-game by admin mod (Which, we'll get to later.)
Now, go to your server desktop or somewhere easy to access, and create this .bat file:
[CODE]@echo off
cls
echo Protecting srcds from crashes...
echo If you want to close srcds and this script, close the srcds window and type Y depending on your language followed by Enter.
title srcds.com Watchdog
:srcds
echo (%time%) srcds started
start /wait c:\srcds\orangebox\srcds.exe -console -game garrysmod -hostname -ip 192.168.2.5 -port 27015 +sv_lan 0 +map sb_gooniverse -gamemode sandbox +sv_gamemode SB3 +sv_defaultgamemode sandbox +maxplayers 24 +sv_maxfps 512 -maxfps 512
echo (%time%) WARNING: srcds closed or crashed, restarting.
goto srcds
[/CODE]
Name it whatever you want, as long as it ends with .bat
Let's examine the main line.
[CODE]start /wait c:\srcds\orangebox\srcds.exe -console -game garrysmod -ip 192.168.2.5 -port 27015 +sv_lan 0 +map gm_construct -gamemode sandbox +maxplayers 24 +sv_maxfps 512 -maxfps 512 [/CODE]
Basically, here's what it's saying.
Launch the orangebox engine in console mode, run the game Garry's Mod, set IP to the network adapter's assigned IP (You don't need this unless you have multiple network adapters connected and only want it to listen on one, in which case you can find the IP of the desired adapter by opening a command prompt and typing "ipconfig", where you will be able to find the adapters and their corresponding IP addresses.)
Set listening port to 27015 (Default, but you have to change it if you have multiple servers on one machine.)
Make sure it's not a LAN server but an internet server
Start with map gm_construct
Set gamemode to sandbox (default)
Set maximum player slots (Usually want to set this lower.)
Set maximum frames per second.
(Frames per second is how many physics frames the server calculates a second. It's nice to have this at a high level, but by default it runs at 64 maximum, even with sv_maxfps set, but i will add the workaround later.)
Edit the BAT file for your specific situation
So now you have a se
Great tutorial.
Great tutorial man! Really helpful, better than any other guide i've used!:woop:
Good job mate, submit it to Interlopers.
Fantastic thread; geared toward the less computer-savvy but it allows those of us that already know approximately what we're doing to flesh it out completely and thoroughly with a lot less pain involved.
Providing direct links to the files mentioned would be a nice addition, though I'm uncertain of FP's policy regarding that. Also, for those who really just want a rough-and-ready server and haven't got the slightest clue how to use a computer, you might consider adding the files for which you give the code (i.e. the batch file near the beginning) to avoid the people who go "OMG MY FILE SAVES AS *.txt.bat OMGGGGGG!!!!"
Anyhow, excellent work.
[quote]A dedicated server computer. I don't care if you have multiple cores and dual LAN cards. It's the stupidest idea EVER to host the server on your local machine. I don't even think it works.[/quote]
It Works. Its Stupid. but it Works.
I do that because my local machine is the only machine capable of doing so, and I leave it on all the time anyway.
I bumped an old thread, I'm retarded.
Sorry, you need to Log In to post a reply to this thread.