Insurgency

Insurgency

54 vurderinger
How to run an Insurgency dedicated server
Av George
A quick and easy way to set up a dedicated server on your own machine, so that your friends can join.
   
Utmerkelse
Favoritt
Favoritter
Fjern som favoritt
Foreword
I have tried to make this guide as simple as possible, so that you can get your server up and running with the least amount of trouble.

Everything after the "Running the server" chapter is just extra info.
Getting started
  • download and install the Insurgency Dedicated Server from Steam's Library/Tools
  • forward ports 27015 and 27016 TCP/UDP on your router
Map and game type (.bat file)
To set up the map and game type, you need to create a .bat file inside the Insurgency Dedicated Server folder (default location of the folder is inside Steam\steamapps\common). Create a .txt file, then change the extension to .bat. You can edit .bat files with Notepad.

For most game types, the .bat file should look like this:
srcds.exe -console -port 27016 -game insurgency +map "buhriz occupy"
or
srcds.exe -console -port 27016 -game insurgency +map "sinjar push"

For checkpoint co-op maps, the .bat files should look like this:
srcds.exe -console -port 27016 -game insurgency +map buhriz_coop
Use port 27016 instead of the default 27015 to avoid conflicts when joining your own server. All other parameters should be defined in the server config files (see next chapter).
Game settings (.cfg files)
Config files are where you set up all the game variables:
  • server settings (passwords, number of players)
  • timers (number of seconds between games)
  • team settings (friendly fire, display info)
  • bot difficulty and amount (skill, damage)
Config files are located in the Insurgency Dedicated Server/insurgency/cfg folder. The server.cfg is the primary config file that always applies to all game modes, plus there is a second config file that only applies to each specific game mode (for example: default_server_occupy.cfg only applies to Occupy games)

server.cfg:
//use the double forward slash to disable a line //SERVER SETTINGS "hostname" "My Server" //the server name "sv_password" "abracadabra1" //server password required to make game private "sv_lan" "0" //LAN only? 1=yes 0=no "mp_coop_lobbysize" "5" //number of max coop players "maxplayers" "32" //number of max players INCLUDING(!) bots "rcon_password" "abracadabra2" //password for remote control over server "sv_allowdownload" "1" //allow downloading, 1=yes 0=no //TIMERS "mp_timer_pregame" "10" //number of seconds before each game "mp_timer_preround" "30" //number of seconds before each round "mp_timer_postround" "20" //number of seconds after each round "mp_timer_postgame" "20" //number of seconds after each game //TEAM SETTINGS "mp_autoteambalance" "0" //automatic balance of teams, 1=yes 0=no "mp_scrambleteams_auto" "0" //automatically switch teams after each game, 1=yes 0=no "mp_friendlyfire" "1" //1=yes, 0=no "mp_tkpunish" "1" //punish team killing, 0 = none, 1 = warning, 2 = kill player "sv_hud_deathmessages" "1" //show who killed who during the game "sv_hud_targetindicator" "1" //shows friendly player names when looking at them "sv_deadvoice" "1" //dead players can talk to their team "sv_deadchat" "1" //dead players can send chat messages //BOT DIFFICULTY AND AMOUNT "ins_bot_difficulty" "0" //fixed bot difficulty, 0-3 "bot_damage" "0.6" //0.6-1 "ins_bot_quota" "0" //fills up this number of empty slots with bots

All other config files can be left at their default settings. If you want to change the number of bots in co-op games, find the appropriate config file for that game mode (for example default_server_checkpoint.cfg) and change the numbers in these lines:
"ins_bot_count_checkpoint_min" "[number of bots for 1 player]" "ins_bot_count_checkpoint_max" "[number of bots for 8 players]"
Running the server
  • to play Insurgency on your own dedicated server, you will have to be running two instances of Insurgency:
    1) insurgency.exe -- start the game from Steam
    2) your custom .bat file, which launches srcds.exe -- the dedicated server
  • first, start the game from Steam (if you do it the other way round, it will give an error saying that Insurgency is already running) then run a .bat file to start a server
  • the dedicated server window should say at the end: Connection fo Steam servers successful. Crash handler attached and ready. VAC secure mode activated.
  • using the in-game Server Browser you should now be able to see your game under the LAN section
------OPTIONAL STUFF BELOW------
Message of the day
motd.txt is located in the Insurgency Dedicated Server/Insurgency folder
Configuring the mapcycle
After a game has ended, a list of new maps and game modes appear for which you can vote for. The first list of choices is imported from Insurgency Dedicated Server/insurgency/mapcycle.txt.

In my experience, after the second round has ended, the list of maps is imported from the mapcycle file of the specific game type, for example mapcycle_occupy.txt.
Controlling the server in-game with RCON
The rcon console command lets you control the dedicated server from the in-game console. You can set up a password for RCON in the server.cfg file.

After joining the game, bring up the console in-game and type:
rcon_password *** rcon

You should now get a message saying autokick disabled for [your name]. From here on, always use rcon in front of a console command. For example:
rcon kick joey (the command will kick joey from the game) or rcon ins_bot_add_t2 (this command will add a bot to team 2, the insurgents)
Easily adding/removing bots with RCON
  • to control your server with RCON with shortcuts, you need to define key binds in your client (not the dedicated server) config.cfg file, which is located in the Insurgency folder: SteamApps\common\insurgency2\insurgency\cfg
  • open the config.cfg file and paste the following:
    bind "F5" "rcon ins_bot_add" bind "F6" "rcon ins_bot_add_t2" bind "F7" "rcon ins_bot_kick_t1" bind "F8" "rcon ins_bot_kick_t2" bind "F9" "rcon_password abracadabra2" bind "F10" "rcon" bind "F11" "toggleconsole"
  • make sure you don't have any other keys assigned to F5-F11
  • when you play the game, you can press F9-F10-F11 in a row, enabling remote control and bringing up the console
  • after you have control of the server, you can use F5-F6 to add bots and F7-F8 to remove bots from each team
Running custom maps
If you have subscribed to a custom map, it will have downloaded to SteamApps/common/insurgency2/insurgency/maps/workshop/[number].

Copy the .bsp file over to the Insurgency Dedicated Server/insurgency/maps folder, then create a .bat file for it as usual in the root directory.

You can find a very nice custom map that I made in the Steam workshop. :)
Troubleshooting
ERROR: custom config.cfg file settings get lost every time you run the game
SOLUTION: make it read only

ERROR: srcds.exe has stopped working
SOLUTION: not sure, but it is probably the server.cfg or the mapcycle.txt that is causing the problem (maybe it occurs when you create a different game type to what is in the mapcycle -- like if you create a checkpoint game while the mapcycle has push maps.)

ERROR: client gets a message saying it cannot connect because the server is full
SOLUTION: the maxplayers variable needs to be increased in the server.cfg because this number also includes the bots, even in co-op
"maxplayers" "32" //number of max players INCLUDING(!) bots

ERROR: client can connect to game, but the game crashes during loading
SOLUTION: the client doesn't have enough RAM, so they should change Paged Pool Memory to Low in the video settings

General network troubleshooting tips
When testing your own server, it should appear among the internet games as well, not just under LAN. If clients can see the game, but cannot join, it's probably a firewall problem. If clients cannot see the game at all, it's probably a port forwarding problem on your end.
  • set up firewall: crash_handler.exe, insurgency.exe, srcds.exe + all steam related .exe files (steam.exe, steamwebhelpwer.exe, steamerrorreporter.exe)
  • for troubleshooting, preferably use a firewall that can show incoming traffic
19 kommentarer
Dexter 7. juni 2023 kl. 12.19 
No @George , I must have formulated my comment badly. I did intend to make a dedicated for my friends to reach over the internet.
I got some help from elsewhere so its resolved now and the dedicated is running. I believe the the mistakes were in the batch and server.cfg.

for reference
this is my batch:
srcds.exe -console -port 27016 +clientport 27005 -game insurgency +map district_coop

and this is my server.cfg:
sv_playlist nwi/coop
sv_password "..."
sv_tags "..."


bit different than in this guide, but it worked after these changes.

thanks for the guide and your helpfulness!
George  [skaper] 7. juni 2023 kl. 11.56 
@Dexter, I just tested this by unplugging my internet cable, this way I couldn't see my own server on the LAN tab either. However, if I went to the Favorites tab and pressed "Add a Server", then entered my local IP (192.168.0.100), then I could connect. So this way you can at least see that your server is working, and then you just have to troubleshoot the network (port forwarding, firewall).
George  [skaper] 7. juni 2023 kl. 11.28 
@Dexter, in your server.cfg config file, make sure "sv_lan" is set to "0". If you have "sv_lan" "1" then you won't get "Connection to Steam servers successful" because you're limiting your server to LAN. But even if you just have "Attached and Ready (in process)" then your server should be working fine, but it's limited to LAN only.

Try using these server.cfg and .bat files [www.dropbox.com].

Not sure why you can't see your server under the LAN tab. Are you using port 27016 in the .bat file, and are ports 27015 and 27016 forwarded on your router?
Dexter 7. juni 2023 kl. 6.16 
Hello George, the server doesnt seem to appear even in the LAN tab.
the dedicated server window never reaches "Connection fo Steam servers successful. Crash handler attached and ready. VAC secure mode activated.", but only "CCrashHandler - Attached and ready. (in-process)".
any idea what the problem might be?
l4k56 17. mars 2020 kl. 0.42 
Everytime I run the bat file, it opens and then closes
NYKnicks33 28. sep. 2018 kl. 5.18 
thanks George - the sample file worked a charm! :)
George  [skaper] 16. sep. 2018 kl. 1.21 
First of all, make sure your "server.cfg" is named "server" and not "sever". Next, you could try this sample file [www.dropbox.com]. In the command prompt window, if you scroll up to ---- Host_NewGame ---- after the server has been created, you should see a line where it says "Executing 'server.cfg' config file". If there is an error, it will say "exec: couldn't exec server.cfg".
NYKnicks33 15. sep. 2018 kl. 20.23 
Thanks George. I couldn't see a file called "sever.cfg" only - all the .cfg files I see seem to have other words/names in it. I created a file called "sever.cfg" and copied the text you suggested above into it. I can run a server, but I suspect its not reading/recognising the information in the "sever.cfg" file I created because it doesn't have the specific server name I've picked and its not password protected (etc). Is there anything I might be missing? Thanks again!
George  [skaper] 15. sep. 2018 kl. 10.18 
@NYKnicks33, you're welcome.
(1) I just tested it and found that it does still look for the "server.cfg" when it's loading.
(2) For game types like occupy or push, where there are two teams fighting each other, you use "ins_bot_quota" to set up the number of bots on each team. However, this command is useless in co-op checkpoint games, so that's when you would use "ins_bot_count_checkpoint_min" and "..._max".
NYKnicks33 15. sep. 2018 kl. 8.13 
Thanks for up this 'how to guide'. I just downloaded the dedicated server to play coop modes. A few questions:
(1) is the main server config file still called "server.cfg" or it is called something else currently? (I can't see a file called "sever.cfg" in the cfg folder - but I can see a bunch of bespoke .cfg files such as "sever_official_ow.cfg" (etc)
(2) How does "ins_bot_quota" differ from commands like "ins_bot_count_checkpoint_max" command?