Modular Combat

Modular Combat

37 ratings
[Official] Dedicated Server Howto
By ⓅⒶⓁ-①⑧
This guide will show you how to setup a Modular Combat server. In order to make this HOWTO understandable for all users, it has been simplified.

Note: At this time there is no Linux server version of Modular Combat, so you will need to host the server in Windows or use Wine/Mono in Linux.

Currently to install the mod on your server you will need to use a steam account that has the game installed (went to Modular Combat store page and clicked "Install Game"). You can either do this with your steam account or make a new one for the server. I suggest you make a new one for increased security (so your steam account isn't stolen if the server is hacked).

If you're unable to get your server working, its too laggy or you want to get it set up easily, then i suggest you use a Game Server Providor.
   
Award
Favorite
Favorited
Unfavorite
Changelog
This section was added so you can keep track of changes and updates to this guide.

10/23/2016 - Remove PurePings GSP information because it seems they closed.
11/30/2015 - Added server list fix to "Questions and Answers" section.
8/3/2017 - Master server list fix.
Questions & Answers
Question: Steam gives me the error: ERROR! failed to install app "366360" (no subscription)

Answer: You will need to log into Steam with your account and subscribe to the mod (click the green "Play Game" button on the Steam Store page). You can immediately cancel the download of the files, so they dont take up any space on your hard disk. After this is done, you will then be able to download the server files through SteamCMD.
---
Question: I downloaded the files, but i dont see srcds.exe in the 2007 folder.

Answer: Sometimes SteamCMD refuses to download new files. When this occurs, you need to delete the following directories in your SteamCMD folder: "appache", "depotcache". Then run the update again and it should download everything.
---
Question: Why do i have to own Half-Life 2, Portal, Portal 2, Left 4 Dead, or Left 4 Dead 2 to be able to install?

Answer: For a few months you didn't need to own anything to download and play Modular Combat. Valve introduced their "Community-Made Mod" program and changed the requirements to line up with their program. We managed to get the requirement expanded but getting it totally removed is not possible.
---
Question: Why do i have to use SteamCMD to download the files? Can't i use my client install in my Steam Client?

Answer: While you can use your Steam client Modular Combat installation, it isn't recommended because Steam will download updates for the game while your server is running and this will cause instability and other issues to occur. This server guide is written with SteamCMD in mind because it's far superior for hosting game servers than the Steam client is.
---
Question: I have all required ports open and my server still doesn't appear on the server list, how do i fix this?

Answer: This usually happens because your server is connecting to the wrong master server list (its how valve distributes server lists). You will need to add the following at the top of "cfg\autoexec.cfg" and "cfg\server.cfg" and if you have Sourcemod installed, "cfg\sourcemod\sourcemod.cfg":

// Master Server Settings
setmaster enable
setmaster add 208.64.200.65:27011
setmaster add 208.64.200.39:27011
setmaster add 208.64.200.52:27011
heartbeat

NOTE: This fix works with any SRCDS game/mod that is having this problem.

Question: After doing the fix above my server still doesn't appear on the server list!

Answer: Valve can't seem make up their mind in regards to how the master server list is configured. Try adding "sv_master_legacy_mode 1" to your server.cfg file. Then restart the server. If it still doesn't appear on your server list, then change the 1 to a 0 so the cvar now looks like "sv_master_legacy_mode 0", then restart your server again.
SteamCMD Download
  • Download SteamCMD from valve’s servers here.
  • Extract the contents of the zip someplace on your harddrive. For the sake of simplicity, this guide will be using "C:\SteamCMD".
  • Navigate to your SteamCMD directory and run steamcmd.exe once for it to initialize itself (a bunch of files will download and it will close itself).
Modular Combat Download
  • Right click "steamcmd.exe" and select "Copy" near the middle of the context menu. Then right click any white area in the folder window and select "Paste" (also near middle) to create a shortcut to steamcmd. Right click the profile, select "Rename" from the context menu, type "Update Modular Combat" and click enter key on keyboard.

  • Right click this new shortcut and select "Properties" at the very bottom of the context menu. In the "Target" box copy and paste the following to the end of the line (including a space between the last double quote and the hyphen):
    +login USERNAME PASSWORD +force_install_dir "C:\Modular Combat Server" +app_update 366360 validate +quit
    NOTE: Replace USERNAME with your Steam username and PASSWORD with your Steam password.



  • If you get any messages about Steam Guard asking for an authorization code, check the email address associated with the Steam account, in the steam email get the code and copy/paste it into the steamcmd update window.

  • Now double click this edited shortcut to start the Modular Combat installation process. Depending on your internet speed and how busy Valve's content servers are, this can take anywhere from a few minutes to a few hours so go take a break from the computer or play a single player game as downloading other things while the update is running will just slow it down. Wait until this download finishes before continuing with next section.
Server Configuration
  • Download this[www.modularcombat.net] file and extract its contents to your "C:\Modular Combat Server\2007\modularcombat\cfg" directory. It contains the text files: autoexec.cfg, banned.cfg, banned_ip.cfg, banned_user.cfg, server.cfg and valve.rc If you want to change more Modular Combat settings, see here for other CVARs.
  • Open up server.cfg and edit the file to your liking.
Server Shortcut Configuration
If your server computer does not have the Steam client running on it, then do not include the "-steam" parameter listed below as it will prevent your server from starting up.*

  • Navigate to "C:\Modular Combat Server\2007" and create a shortcut to srcds.exe in the same folder (newbies see Modification Download section on how to create shortcuts).
  • Go into the properties of this shortcut and enter the following to the end of the "Target" box:
    -console -game "modularcombat" -steam +map dm_datacore -secure +ip 1.2.3.4 +port 27015 +maxplayers 16 +exec server.cfg +rcon_password "ch@ng3me"
    Parameter Explanation:
    -console - This is required for the server to run. Never remove it.
    -game "modularcombat" - This tells SRCDS to load Modular Combat.
    -steam - This is required for the server to be shown on the server list (If and only if the steam client is installed on the same computer)*.
    +map dm_datacore - This tells SRCDS to load the specified map. If you do not choose a map, then your Modular Combat server will not start up properly.
    -secure - This tells SRCDS to enable VAC (Valve Anti Cheat). Change it to -insecure if you dont want VAC to run.
    +ip 1.2.3.4 - This tells the server to listen on a specific IP (change 1.2.3.4 to any IP). It's mainly useful if you have access to multiple IPs (not router IPs) from your ISP or server host. If you're running this server from home, then remove this parameter completely as the server will not start (see Addedum at bottom for more info).
    +port 27015 - This tells SRCDS to listen on port 27015. Generally most servers run on ports 27015 to 27019. Don't change it to anything outside of this range or else some players may not be able to connect to your server.
    -maxplayers 16 - This tells SRCDS to run with 16 slots. Modular Combat is limited to 16 slots (engine limitations) so even if you put more than 16 slots, the mod will never allow more than 16 players.
    +exec server.cfg - This tells SRCDS to execute server.cfg upon server startup.
    +rcon_password "ch@ng3me" - This sets your RCON password to "ch@ng3me". You should never ever set the rcon password in server.cfg because there is an exploit (that still hasn't been fixed by Valve) that allows hackers to download files and if a hacker gets access to your rcon password, they will wreak mega havok (Info on exploit[wiki.alliedmods.net]).
  • Now you can start the server! Just go back to "C:\Modular Combat Server\2007" and double click your SRCDS shortcut.
Server CVARS
A CVAR is a variable that allows you to change a setting. Every variable has a minimum and maximum setting. To see the range you can use, just enter the CVAR into the server console.

  • pvm_difficulty - scales all monster stats by this value - an easy way to make everything easier / harder
  • pvm_monsters_base - the base number of monsters spawned
  • pvm_monsters_per_player - the extra number of monsters spawned, per player
  • pvm_max_monsters - monsters will not spawn if there are this many (or more) present. The more monsters you have, the higher the server CPU usage will be.
  • pvm_max_monster_level_offset_below_player_average - if the average player level is 5 and this value is 1, then the lowest monster level will be 4, even if there are level 0 players.
  • pvm_wave_interval - pvm monsters will respawn at this frequency
  • mc_player_startlevel - the level that new characters start at, with appropriate number of module points
  • mc_perlevel_modulepoints - how many module points are awarded per level. Including level zero!
  • mc_experience_monster - scaling applied to experience from killing a monster, compared to a player
  • mc_experience_minion - scaling applied to experience from killing a minion, compared to a player
  • mc_faction_win_experience - the experience awarded to each player of the winning faction in a team game
  • ally_experience_boost_fraction - how much extra experience is awarded for being near allies in team games
  • pvm_buff_interval_aperture - how frequently the armor regen effect ticks when aperture players are near each other in a team game
  • pvm_buff_interval_resistance - how frequently the health regen effect ticks when aperture players are near each other in a team game
  • pvm_buff_combine_scale - the damage bonus that combine players get for being near each other in team games
  • mc_spawn_protect_time - how long players will be invulnerable for after spawning
  • mc_gamemode - changes the gamemode.

Server CVARS only work when you execute them through RCON, the example below will show you how to do this with the mc_gamemode CVAR:
  • Find out your server's RCON password (in the next step, replace "RCONPASSWORD" with your server's RCON password).
  • Connect to your server and type in your console: rcon_password RCONPASSWORD
  • You only need to type rcon_pass once.
  • Now type: rcon mc_gamemode
  • The console will show you all the options you can use.
  • Let's say you wanted to change to Hoarder gamemode, your command would look like:
    rcon mc_gamemode 5

NOTE: Changing any server CVAR will result in "[Modified]" being added to the gamemode title.

There are also some cheat CVAR's that allow admins to create high level characters right away.

mc_admin_add_exp <Player Name> <Number>
mc_admin_set_level <Player Name> <Number>

Max level is currently 25.

So using the above example, adding 1337 exp and setting level 12 to a player named The Dude would look like:

mc_admin_add_exp "The Dude" 1337
mc_admin_set_level "The Dude" 12
Addendum 1
If you're able to connect to your server but no one else (on the internet) can, then its a ports issue. Ignore what other sites say about what ports you need to open. Through a long process of trial and error i found the following list to be the absolute bare minimum for your server to work without compromising security.

UDP: 26901, 27014 to 27017, 27030 to 27039

I did not include TCP 27015 (or whatever your server port is set to) because this port allows remote RCON connections and just allows your server to be hacked easier. Use sourcemod's sm_rcon command if you want to execute RCON commands. It doesn't require you to know the rcon password but it does require your sourcemod admin level to have access to execute rcon commands.

How you open ports entirely depends on what Firewall and/or Router you have. You can find out how to open ports by reading the manual that came with your Firewall/Router or by going to Port Forward[portforward.com]. Again ignore what this site says about what ports you should open for SRCDS. Use the list above instead.

Opening ports can also be dangerous. Someone i know learned this the hard way in when a server he was hosting from home got hacked. The previous day he banned a cheater and the next day was attacked. The attacker corrupted the bios of his router, and then proceeded to format the server box and gaming computer while he was at it trying to scan for viruses.

If you get the error message "Server uses different class tables" when trying to connect to your server. Then either the Modular Combat files on the server are out of date or an Source 2007 update came out and you need to run the SteamCMD again. Always stop your server before installing Modular Combat updates or running the SteamCMD (use the shortcut you created in step 5).

If you plan on hosting the server on the same computer you use to play other games, then you're in for some bad news. When you do anything on the server computer that uses lots of CPU, your Modular Combat server will lag heavily. So either put the Modular Combat server on an extra computer or turn off the server when you plan on playing games (players will simply avoid your server if its too laggy).

Servers tend to eat bandwidth like its candy and most ISPs won't allow you to host a server from home. So either don't tell them and hope you dont get caught (they can cancel your internet) or rent a server at a hosting company, the latter costs more (around $16 per month) but saves you headaches as you dont have to open ports, worry about going over your monthly bandwidth limits and they automatically restart a crashed server (and you get a web cp to start/stop/restart). If you do plan on hosting from home, make sure you have at least 50KBs of upload bandwidth. With some tweaking to the rates on your server, you can comfortably host a server even with 50KBs of upload. See this[www.reece-eu.net] site for a calculator that will help you to set your rates.

Crashes are the single most annoying thing that will happen. When they do, they typically take down your server and if you arent around, it will stay down until you restart it. There are products online that can automatically restart your server if/when it crashes but these cost around $30 (FireDaemon Pro is once such example).

These are just the basic tips to help you on your way, there's a lot more out there so look around on a site such as Forums.srcds.com.[forums.srcds.com]
Addendum 2
It is possible to have your server automatically restart in the event of a soft crash via a batch script.

Create a new .bat file in the same folder as srcds.exe, and paste the following code in it.

@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 Watchdog
:srcds
echo (&#xti;me%) srcds started.
start /wait srcds.exe -console -game "modularcombat" -secure -ip 1.2.3.4 +port 27015 +maxplayers 16 +exec server.cfg +maxplayers 16 +rcon_password "ch@ng3me"
echo (&#xti;me%) WARNING: srcds closed or crashed, restarting.
goto srcds


Save it, and run your server by opening this script. Credits to srcds.com authors for this script.

The above script will only work if srcds completely closes, if the process is still active (server is frozen) then it will not restart the server.

-------
The above doesn't recover from all crashes though, especially crashes that open an error popup. In addition, if you log out of your OS account; the server will shutdown. If you want the server to remain up for both of these events, then get FireDaemon Pro[www.firedaemon.com]. (and follow this guide[forums.firedaemon.com] too)
Credits
Addendum 2 batch script was originally written by Evil Police (Previous Lead Programmer)
Part of Server Icon By: Fast Icon[www.fasticon.com]
106 Comments
tbeetz2018 Jun 2 @ 9:11am 
i used to know how to but i forgot
tbeetz2018 Jun 2 @ 9:10am 
how do you change game modes?
knotsif Apr 4, 2021 @ 5:02am 
game is dead
Union of Universes and Patrons Aug 19, 2020 @ 1:26am 
How to fix this?
https://imgur.com/G6CL6cj
Union of Universes and Patrons Aug 19, 2020 @ 1:18am 
I know, that is the guide for dedicated server. Just when I downloaded app 366360, It didn't contains srcds.exe, but I read guide again and fixed it.
ⓅⒶⓁ-①⑧  [author] Aug 18, 2020 @ 5:04pm 
@Union, this is the guide for dedicated server. If you want to run a temporary server where you can play at same time then you'll have to download the client.
Union of Universes and Patrons Aug 17, 2020 @ 4:05pm 
I downloaded through SteamCMD, but there is no srcds.exe, only hl2.exe. Why we need to download just Modular Combat through SteamCMD?
ⓅⒶⓁ-①⑧  [author] Jun 24, 2020 @ 10:50pm 
Website still loads for me.
$[SwatVip]$ Jun 16, 2020 @ 7:56am 
i cant find any servers with players in it and when i tryed to go home in modularcombat.net it only says error
ⓅⒶⓁ-①⑧  [author] May 21, 2020 @ 6:51pm 
They're still up, theres a bug that prevents them from showing up in-game. You can find them listed on the website and connect from there.