General

General configuration for IW4x.

Folder structure

  • IW4x\[1]
    • iw4x.dll[2]
    • iw4x.exe[3]
    • iw4x\[4]
    • main\[5]
    • mods\[6]
    • players\[7]
    • usermaps\[8]
    • userraw\[9]
    • zone\[10]

[1] Your Modern Warfare 2 folder.
[2] The part where all our magic happens.
[3] The binary of the game.
[4] Do not touch anything or put anything in here, unless we told you to!
[5] Do not touch anything or put anything in here, unless we told you to!
[6] Here you can store any mod you want to apply, by using fs_game.
[7] Your configuration and all data related to your playerprofile is kept there.
[8] Your custom maps are stored here.
[9] This is a folder we have added for you to store your custom raw- and iwd files (e.g. custom camos etc.).
[10] Do not touch anything or put anything in here, unless we told you to!

Client

Here you can find client specific configuration.

Installation

You have to fulfill the following requirements to play IW4x:

To install IW4x follow the instructions below:

  • Copy the game folder to a separate location
  • Download the Updater or the zip archive from our website. Use the mirrors if you want to get your full download speed.
  • Updater: Copy the updater to the game folder and start the updater.
  • Zip: Extract the zip archive directly in your game folder.
  • Start the game with the IW4x executable.

Multiple clients in the same game folder can lead to crashes.

Command line parameters

Those are the client related command line parameters.

parameter description
-console Enables the external console.
-dedicated Starts as a server.
-dump Dumps raw map entities.
-nosteam Disables Steam integration.
-repair Not implemented yet.
-version Shows game version.
-zonebuilder Starts the IW4x Zonebuilder.
+connect <ip:port> Directly connect to specified server, the default port (28960) will be used when no one has been provided.
+set <dvar> <value> Provide any dvar to the game, e.g. +set r_fullscreen 0.

Color Codes

Color codes allow coloring of any text, mainly player and server names. Modern Warfare 2 itself defines the following colors:

^1 Red.
^2 Green.
^3 Yellow.
^4 Blue.
^5 Cyan.
^6 Pink.
^7 White.
^8 This color changes depending on what map you’re playing on:

  • American maps
    • Dark green.
  • Russian maps
    • Dark red.
  • British maps
    • Dark blue.

^9 Grey.
^0 Black.

Additionally, IW4x introduces new color codes for more fanciness:

^: Rainbow color.
^; A color set by the server using the sv_customTextColor dvar.

You can let the color of the nametag above your player model change by using ^^::!

Direct3D 9Ex

Direct3D 9Ex is an improved version of Microsoft’s Direct3D 9[1].

In IW4x it has been implemented to reduce the RAM usage of the game. If you have some problems you can simply disable it in the video options.

Native cursor

This setting allows you to disable the custom game cursor and use the native one your operating system provides, you can change this in the video options.

Security levels

Every player has an identity with which they can join servers. Normally such an identity would be some sort of login information like a forum login or an ID like you would get on steam. IW4x is not able to use such a way of authentication since it is completely decentralized. Instead, the client generates a random, unique identity for each player if they don’t have one yet.

Whenever a player gets banned, their identity gets added to a server-side blacklist which prevents them from joining with that identity again. In order to circumvent such a ban, a player can then create a new identity.

This is where the security level comes in: It determines the level of complexity an identity has to fulfill before it can be seen as an identity that is allowed to join the server. This implies that the client has to do a certain amount of work. The higher the complexity, the more work a client will statistically have to do.

Of course, a client is still able to pregenerate identities to prepare for instant ban evasion. This is where the server admin can reconfigure the security level on their server to a higher value, which automatically invalidates all identities below that level, requiring all clients trying to join to recalculate a valid identity token.

The security level is set to 23 by default, which in average leads to a waiting time of about 30 seconds for the identity token to be calculated.

[1] MSDN: Direct3D 9Ex Improvements.aspx)

Server

Quick setup and advanced configuration for IW4x servers.

⚠️ Warning
You can only host up to 15 servers on the same IP address, additional servers will be rejected by the decentralized node system. This has been implemented as a security measurement to prevent flooding the server list.

Server types

Party

A party[1] is a dedicated lobby, which uses a playlist for its configuration and will take players back into a lobby after each map. The advantage of the party system is:

  • adjust classes and killstreak rewards without leaving the server
  • vote to skip next map
  • map rotation is random

Because of that, a party server is ideal for a public game servers.

⚠️ Warning
Party servers are very buggy and unstable, they will crash often and even with scripts the server might not properly restart. It is advised to not use party servers and stick to match servers instead!

Match

A match is a normal dedicated server, which uses a map rotation, ideal for private servers.

Requirements

You have to fulfill the following requirements to be able to host a server for IW4x:

  • An internet connection
  • A clean installation of Call of Duty: Modern Warfare 2
  • Notepad++ to edit config files
  • 7-ZIP to extract the client files
  • Basic knowledge about your current operating system
  • Common sense (in case of a public server)

Quick instructions for hosting a match server

😡 Warning
If you forget to remove the < and > around the port, tech support is legally allowed to call you retarded.
In case you didn't get that, this means remove them.

  • Copy your ‘Call of Duty Modern Warfare 2’ folder to another location
  • Extract the client files into your copied folder
  • Download the 📥 server.cfg and place it in your ‘players’ folder, edit it to your needs
  • Download the 📥 startserver.bat and place it into the root, edit it as needed
  • Forward the TCP and UDP port you've specified in +set net_port <port>
  • Run the batch and have fun!

Quick instructions for hosting a party server

  • Copy your ‘Call of Duty Modern Warfare 2’ folder to another location
  • Extract the client files into your copied folder
  • Download the 📥 server.cfg and place it in your ‘players’ folder, edit it to your needs
  • Download the 📥 startserver.bat and place it into the root, edit it as needed
  • Forward the TCP and UDP port you've specified in +set net_port <port>
  • Run the batch and have fun!

File mirrors

If the above links don't work, you can download Zip files containing the files you need from here!

Alternatively, you can download the files individually from here

Advanced server configuration

Further information for advanced server configuration:

General
Match server
Party server
Docker
Setting up FastDL
API
Gameserver file optimization
List of map names

[1] A server starts per default as a party.

General

General server configuration for advanced options.

Command line parameters

parameter default valid description
-dedicated Starts the game as a dedicated server
-stdout Starts the server without a console, only text output - useful for running server in wine
-console Starts the server in a dedicated console
+set net_ip <ip> 0.0.0.0 Configures the ip the server is listening on
+set net_port <int> 28960 1 - 65535 Configures the port the server is listening on
+set sv_lanonly <int> 0 0 - 1 Starts server for LAN only
+exec <string> Loads a given server configuration
+set fs_game <string> Configures which mod to load
+set party_enable <int> 1 0 - 1 Configures wether to use the party or match system
+set sv_maxclients <int> 18 1 - 18 Configures the amount of clients on the server (match only)
+map_rotate Starts map rotation (match only)
+set playlistFilename <string> “playlists_default.info” Configures which playlist to load (party only)
+playlist <int> 0 - 99 Loads playlist number +1 from playlist file (party only)

Supported gametypes

abbreviation gametype
war Team Deathmatch
dm Free-for-all
dom Domination
koth Headquarters
sab Sabotage
sd Search and Destroy
arena Arena
dd Demolition
ctf Capture the Flag
oneflag One-Flag CTF
gtnw Global Thermo-Nuclear War

Additional gametypes are possible with mods.

Supported maps

See List of map names

Match server

This is how you configure your server to run as a match server.

Server config

This is how you can configure your server to run as a match server. The configuration has to be done in the server.cfg file that your server is using.

General server configuration is required for general configuration options.

Info

parameter default valid description
set sv_hostname <string> “IW4x Server” Sets the server hostname
set sv_securityLevel <int> 23 0 - 256 Configures the servers security level
set sv_motd <string> Sets a custom motd which is shown on the loadscreen when a player joins
sets _Admin <string> Configures admin name
sets _Email <string> Configures admin email
sets _Website <string> Configures website
sets _Location <string> Configures location

Non gameplay configuration

parameter default valid description
set rcon_password <string> "" Configures password for rcon
set g_password <string> "" Configures password for gameserver
set g_inactivity <int> 120 0 - 999 Enable auto kick feature for idle/AFK players
set g_inactivitySpectator <int> 180 0 - 999 Time in seconds before a spectator gets kicked
set g_logSync <int> 1 0 - 1 1 = always flush games_mp.log, 0 = only flush on game end
set g_log <string> logs/games_mp.log Configures gamelog filename
set sv_allowClientConsole <int> 1 0 - 1 Enable players ability to access server commands
set sv_maxPing <int> 0 0 - 999 Maximum ping allowed, any higher and players will get kicked
set sv_timeout <int> 20 0 - 1800 Timeout time period
set sv_reconnectlimit <int> 3 0 - 1800 How many times you can try to reconnect
set sv_pure <int> 0 0 - 1 Verifying client files
set sv_sayName <string> ^7Console Name server-side ‘say’ commands show up as
set sv_floodProtect <int> 1 0 - 1 Chat Spam Protection
set sv_kickBanTime <int> 300 0 - 3600 Configures kick ban duration
set scr_game_objectiveStreaks <int> 1 0 - 1 Enable Chopper, AC130 and Nuke
set scr_classic <int> 0 0 - 1 Enable IW3 killstreak system
set scr_intermission_time <int> 30 0 - 999 Change timer before server loads the next map (currently broken)

Base game configuration

parameter default valid description
set g_gametype <string> "war" Choose a gametype from the list
set scr_player_forcerespawn <int> 1 0 - 1 Players respawn automatically after being fragged
set scr_thirdperson <int> 0 0 - 1 Enable third-person mode
set scr_game_hardpoints <int> 1 0 - 1 Enable Killstreak rewards
set scr_hardpoint_allowhelicopter <int> 1 0 - 1 Allow Attack Helicopters
set scr_hardpoint_allowuav <int> 1 0 - 1 Allow UAV
set scr_hardpoint_allowartillery <int> 1 0 - 1 Allow Airstrikes
set scr_game_perks <int> 1 0 - 1 Allow players to have perks
set scr_game_allowkillcam <int> 1 0 - 1 Allow Killcam
set scr_nukeTimer <int> 10 0 - 999 Timer when nuke goes off
set scr_diehard <int> 0 0 - 1 Enable die-hard mode
set scr_teambalance <int> 1 0 - 1 Enable auto balance
set scr_game_spectatetype <int> 2 0 - 2 Allow Spectators. 0 = Disabled, 1 = Team/Player only, 2 = Free
set scr_player_suicidespawndelay <int> 0 0 - 999 Wait before you respawn if you committed suicide
set scr_player_sprinttime <int> 4 0 - 999 Sprint time, duration a player can run

Hardcore configuration

parameter default valid description
set g_hardcore <int> 0 0 - 1 Enable Hardcore Mode
set scr_game_deathpointloss <int> 0 0 - 1 Enable point loss on death
set scr_game_onlyheadshots <int> 0 0 - 1 Enable only headshots mode. You can only kill players by taking headshots.
set scr_player_maxhealth <int> 30 0 - 100 Percent of health players will have on respawn
set scr_team_fftype <int> 1 0 - 3 Enable Friendly Fire. 1 = on, 2 = reflect, 3 = shared
set scr_player_healthregentime <int> 5 0 - 999 Time it takes to recover damage
set scr_team_kickteamkillers <int> 0 0 - 1 Enable autokick for team kill
set scr_team_teamkillspawndelay <int> 20 0 - 999 Configure respawn penalty for team kill

Airdrop configuration

Higher weights increase random selection chance.

paramter default valid description
set scr_airdrop_ac130 <int> 3 0 - 1000 Configures drop chance for AC130
set scr_airdrop_ammo <int> 17 0 - 1000 Configures drop chance for ammo
set scr_airdrop_counter_uav <int> 15 0 - 1000 Configures drop chance for Counter UAV
set scr_airdrop_emp <int> 1 0 - 1000 Configures drop chance for EMP
set scr_airdrop_harrier_airstrike <int> 7 0 - 1000 Configures drop chance for airstrike
set scr_airdrop_helicopter <int> 7 0 - 1000 Configures drop chance for helicopter
set scr_airdrop_helicopter_flares <int> 5 0 - 1000 Configures drop chance for helicopter flares
set scr_airdrop_helicopter_minigun <int> 3 0 - 1000 Configures drop chance for helicopter minigun
set scr_airdrop_nuke <int> 0 0 - 1000 Configures drop chance for nuke
set scr_airdrop_precision_airstrike <int> 11 0 - 1000 Configures drop chance for precision airstrike
set scr_airdrop_predator_missile <int> 12 0 - 1000 Configures drop chance for predator missile
set scr_airdrop_sentry <int> 12 0 - 1000 Configures drop chance for sentry
set scr_airdrop_stealth_airstrike <int> 5 0 - 1000 Configures drop chance for stealth bomber
set scr_airdrop_uav <int> 17 0 - 1000 Configures drop chance for UAV

Emergency airdrop configuration

Higher weights increase random selection chance.

parameter default valid description
set scr_airdrop_mega_ac130 <int> 2 0 - 1000 Configures drop chance for AC130
set scr_airdrop_mega_ammo <int> 12 0 - 1000 Configures drop chance for ammo
set scr_airdrop_mega_counter_uav <int> 16 0 - 1000 Configures drop chance for Counter UAV
set scr_airdrop_mega_emp <int> 0 0 - 1000 Configures drop chance for EMP
set scr_airdrop_mega_harrier_airstrike <int> 5 0 - 1000 Configures drop chance for airstrike
set scr_airdrop_mega_helicopter <int> 5 0 - 1000 Configures drop chance for helicopter
set scr_airdrop_mega_helicopter_flares <int> 3 0 - 1000 Configures drop chance for helicopter flares
`set scr_airdrop_mega_helicopter_minigun 2 0 - 1000 Configures drop chance for helicopter minigun
set scr_airdrop_mega_nuke <int> 0 0 - 1000 Configures drop chance for nuke
set scr_airdrop_mega_precision_airstrike <int> 10 0 - 1000 Configures drop chance for precision airstrike
`set scr_airdrop_mega_predator_missile 14 0 - 1000 Configures drop chance for predator missile
set scr_airdrop_mega_sentry <int> 16 0 - 1000 Configures drop chance for sentry
set scr_airdrop_mega_stealth_airstrike <int> 3 0 - 1000 Configures drop chance for stealth bomber
set scr_airdrop_mega_uav <int> 12 0 - 1000 Configures drop chance for UAV

Free for all gametype settings

parameter default valid description
set scr_dm_scorelimit <int> 1500 0 - 99999 Score limit to win the game
set scr_dm_timelimit <int> 10 0 - 999 Duration in minutes for the game to end if the score limit isn't reached
set scr_dm_playerrespawndelay <int> 0 -1 - 999 -1 is no respawn delay, 0 is automatic, > 0 is X seconds
set scr_dm_numlives <int> 0 0 - 999 Number of lives per Player, 0 for unlimited
set scr_dm_promode <int> 0 0 - 1 Extra bullet damage unconfirmed

Domination gametype settings

parameter default valid description
set scr_dom_scorelimit <int> 200 0 - 99999 Configure score limit to win the game
set scr_dom_timelimit <int> 60 0 - 999 Duration in minutes for the game to end if the score limit isn't reached
set scr_dom_playerrespawndelay <int> -1 -1 - 999 -1 is no respawn delay, 0 is automatic, > 0 is X seconds
set scr_dom_waverespawndelay <int> 0 0 - 999 Duration in seconds before the first respawn in each round
set scr_dom_numlives <int> 0 0 - 999 Number of lives per Player, 0 for unlimited
set scr_dom_roundlimit <int> 1 0 - 999 Rounds per game
set scr_dom_winlimit <int> 1 0 - 999 Amount of wins needed to win a round-based game
set scr_dom_promode <int> 0 0 - 1 Extra bullet damage unconfirmed

Demolition gametype Settings

parameter default valid description
set scr_dd_scorelimit <int> 2 0 - 99999 Score limit needed to win
set scr_dd_timelimit <float> 2.5 0 - 999 Duration in minutes for the game to end if the score limit isn’t reached
set scr_dd_roundswitch <int> 1 Rounds before the teams switch sides
set scr_dd_bombtimer <float> 45 Time the bomb takes to detonate
set scr_dd_defusetime <float> 5 Time taken to defuse the bomb
set scr_dd_extratime <int> 3
set scr_dd_numlives <int> 0 0 - 999 Lives per player, 0 for unlimited
set scr_dd_planttime <float> 5 0 - 99 Time it takes to plant a bomb in seconds
set scr_dd_roundlimit <int> 3 0 - 99 Rounds the game is limited to, if there are no winners
set scr_dd_playerrespawndelay <int> 0 -1 - 999 -1 is no respawn delay, 0 is automatic, > 0 is X seconds
set scr_dd_promode <int> 0 0 - 1 Extra bullet damage unconfirmed

Search and destroy gametype settings

parameter default valid description
set scr_sd_scorelimit <int> 1 0 - 99999 Score limit required to win the game
set scr_sd_timelimit <float> 2.5 0 - 999 Duration in minutes for the game to end if the score limit isn’t reached
set scr_sd_playerrespawndelay <int> -1 -1 - 999 -1 is no respawn delay, 0 is automatic, > 0 is X seconds
set scr_sd_waverespawndelay <int> 0 0 - 999 Delay for first respawn
set scr_sd_numlives <int> 1 0 - 999 Number of lives per player per game
set scr_sd_roundlimit <int> 0 0 - 99 Rounds the game is limited to 0 for unlimited
set scr_sd_winlimit <int> 4 0 - 999 amount of wins needed to win a round-based game
set scr_sd_roundswitch <int> 1 after X rounds, switch sides
set scr_sd_bombtimer <int> 45 Time taken for the bomb to detonate
set scr_sd_defusetime <int> 5 Time taken to defuse the bomb
set scr_sd_multibomb <int> 0 0 - 1 allow multiple people to ‘have the bomb’
set scr_sd_planttime <int> 5
set scr_sd_promode <int> 0 0 - 1 Extra bullet damage unconfirmed

Sabotage gametype settings

parameter default valid description
set scr_sab_scorelimit <int> 0 0 - 99999 Score limit to win the match
set scr_sab_timelimit <int> 10 0 - 999 Duration in minutes for the game to end if the score limit isn’t reached
set scr_sab_bombtimer <int> 45 Duration in seconds the bomb takes to detonate
set scr_sab_defusetime <int> 5 Time taken to defuse the bomb
set scr_sab_hotpotato <int> 0 One bomb that the teams must fight over. One defending and one have to plant at the site.
set scr_sab_numlives <int> 0 0 - 999 Number of lives players get
set scr_sab_planttime <int> 2.5 Time taken to plant the bomb
set scr_sab_playerrespawndelay <float> 7.5 -1 - 999 Time before respawn
set scr_sab_roundlimit <int> 1 0 - 99 Rounds per game
set scr_sab_roundswitch <int> 1 Rounds needed to be played before the teams switch sides
set scr_sab_waverespawndelay <int> 0 0 - 999 Time delay for first respawn before the game
set scr_sab_promode <int> 0 0 - 1 Extra bullet damage unconfirmed

Capture the flag gametype settings

parameter default valid description
set scr_ctf_scorelimit <int> 3 0 - 99999 Target score before the round ends
set scr_ctf_timelimit <int> 10 0 - 999 Duration in minutes for the game to end if the score limit isn’t reached
set scr_ctf_numlives <int> 0 0 - 999 Number of lives per player 0 for unlimited
set scr_ctf_playerrespawndelay <int> 0 -1 - 999 Respawn wait in seconds
set scr_ctf_roundlimit <int> 1 0 - 99 How many rounds match would last
set scr_ctf_roundswitch <int> 1 Rounds before the teams switch sides
set scr_ctf_waverespawndelay <int> 10 0 - 999 Time delay for first respawn before the game

One flag gametype settings

parameter default valid description
set scr_oneflag_scorelimit <int> 1 0 - 99999 Target score before the round ends
set scr_oneflag_timelimit <int> 3 0 - 999 Duration in minutes for the game to end if the score limit isn’t reached
set scr_oneflag_numlives <int> 0 0 - 999 Number of lives per player, 0 for unlimited
set scr_oneflag_playerrespawndelay <int> 0 -1 - 999 Respawn wait in seconds
set scr_oneflag_roundlimit <int> 1 0 - 99 How many rounds match would last
set scr_oneflag_roundswitch <int> 1 Rounds before the teams switch sides
set scr_oneflag_waverespawndelay <int> 0 0 - 999

Headquarters gametype settings

parameter valid default description
set scr_koth_scorelimit <int> 250 0 - 99999 Score limit to win the game
set scr_koth_timelimit <int> 10 0 - 999 Duration in minutes the game will continue if the score isn’t reached
set scr_koth_numlives <int> 0 0 - 999 Number of lives per game. 0 for unlimited.
set scr_koth_playerrespawndelay <int> 0 -1 - 999 Players respawn wait
set scr_koth_roundlimit <int> 1 0 - 99 Rounds to be played
set scr_koth_roundswitch <int> 1 Rounds to be played before teams switch sides
set scr_koth_winlimit <int> 1 0 - 999 Rounds per game
set scr_koth_waverespawndelay <int> 0 0 - 999 First respawn delay for each round
set scr_koth_proMode <int> 0 0 - 1 Extra bullet damage unconfirmed

Arena gametype settings

parameter default valid description
set scr_arena_scorelimit <int> 1 0 - 99999 Score limit to win the game
set scr_arena_timelimit <float> 2.5 0 - 999 Duration in minutes the game will continue if the score isn’t reached
set scr_arena_numlives <int> 1 0 - 999 Number of lives per game 0 for unlimited
set scr_arena_roundlimit <int> 0 0 - 99 Rounds to be played
set scr_arena_roundswitch <int> 3 Rounds before the teams switch sides
set scr_arena_winlimit <int> 4 0 - 999 rounds per game
set scr_arena_promode <int> 0 0 - 1 Extra bullet damage unconfirmed

Global thermonuclear war gametype settings

parameter default valid description
set scr_gtnw_scorelimit <int> 100 0 - 99999 Score limit to win the game
set scr_gtnw_timelimit <int> 6 0 - 999 Duration in minutes the game will continue if the score isn’t reached
set scr_gtnw_numlives <int> 0 0 - 999 Number of lives per game, 0 for unlimited
set scr_gtnw_playerrespawndelay <int> 0 -1 - 999 Players respawn wait
set scr_gtnw_roundlimit <int> 1 0 - 99 Rounds to be played
set scr_gtnw_roundswitch <int> 0 Rounds before the teams switch sides
set scr_gtnw_waverespawndelay <int> 0 0 - 999 First respawn delay for each round
set scr_gtnw_winlimit <int> 1 0 - 999 rounds per game
set scr_gtnw_promode <int> 0 0 - 1 Extra bullet damage unconfirmed

Party server

This is how you configure your server to run as a party server.

Server config

This part of the configuration has to be done in the server.cfg file that your server is using. Please put your server configuration file in the Players folder in your MW2 root directory.

General server configuration is required for general configuration options.

Info

parameter default valid description
set sv_hostname <string> "IW4x Server" Sets the server hostname
set sv_securityLevel <int> 23 0 - 256 Configures the servers security level
set sv_motd <string> Sets a custom motd which is shown on the loadscreen when a player joins
sets _Admin <string> Configures admin name
sets _Email <string> Configures admin email
sets _Website <string> Configures website
sets _Location <string> Configures location

Non gameplay configuration

parameter default valid description
set rcon_password <string> "" Configures password for rcon
set g_password <string> "" Configures password for gameserver
set g_inactivity <int> 120 0 - 999 Enable auto kick feature for idle/AFK players
set g_inactivitySpectator <int> 180 0 - 999 Time in seconds before a spectator gets kicked
set g_logSync <int> 1 0 - 1 1 = always flush games_mp.log, 0 = only flush on game end
set g_log <string> logs/games_mp.log Configures gamelog filename
set sv_allowClientConsole <int> 1 0 - 1 Enable players ability to access server commands
set sv_maxPing <int> 0 0 - 999 Maximum ping allowed, any higher and players will get kicked
set sv_timeout <int> 20 0 - 1800 Timeout time period
set sv_reconnectlimit <int> 3 0 - 1800 How many times you can try to reconnect
set sv_pure <int> 0 0 - 1 Verifying client files
set sv_sayName <string> ^7Console Name server-side ‘say’ commands show up as
set sv_floodProtect <int> 1 0 - 1 Chat Spam Protection
set sv_kickBanTime <int> 300 0 - 3600 Configures kick ban duration
set scr_game_objectiveStreaks <int> 1 0 - 1 Enable Chopper, AC130 and Nuke
set scr_classic <int> 0 0 - 1 Enable IW3 killstreak system
set scr_intermission_time <int> 30 0 - 999 Change timer before server loads the next map (currently broken)

Required mod configuration has to be done in this file as well.

Playlist config

The following configuration has to be done in your playlist. Do not edit your iw4x/playlist_default.info file directly as this file is updated via the updater and will be resetted to defaults.

Instead put your playlist in the players folder in your MW2 root directory.

General

Playlists are limited to 32 Gametypes and 23 playlists. It is possible to create multiple seperate playlists. A single server can only run a single playlist at a time.

Function script

In playlists you can use the following parameters to configure your game server:

  • gametype <string>: Unique name for your configured gametype. Everything until the next gametype configures your gametype. Eg.: gametype tdm
  • name <string> "<string>": Configures a specific localized name for the gametype which is shown to the user. Eg.: name english "Team Deathmatch"
  • script: Gametype the game actually loads. Eg.: script war
  • More gametypes can be found here
  • teambased: Currently unknown
  • hardcore: Currently unknown
  • rule <string> <string>: Rule is used to customize dvars. Eg.: rule scr_thirdperson 0
  • For possible values you can check the options for your preferred gametype here

Playlist

The first playlist in your file has to be playlist 1. To start this playlist on your server, you have to pass the parameter +set playlist 0.

  • playlist <int>: Configures playlist
  • rule <string> <string>: Overwrites rules configured in your function.
  • <mapname>,<gametype>,<mapweight>: Configures your playlist. Put every map you want in your map rotation on a seperate line. The higher the mapweight the more likely this map will be picked. Eg.: mp_rust,tdm,4 or mp_fuel2,tdm,1

Docker

It is possible to run an IW4x server on Linux as an container using Docker, but you will have to build the image by yourself.

At first create a few folders

$ mkdir -p iw4x-dedicated/image
$ mkdir -p iw4x-dedicated/data
$ cd iw4x-dedicated/

Then create the following file with the name Dockerfile inside of iw4x-dedicated/image

FROM alpine:3.8
LABEL maintainer="The IW4x Team" \
        com.iw4x.description="Alpine based Wine environment for IW4x dedicated server."

ENV LANG en_US.utf8

# UID and GID of the iw4x user the server is running as.
ARG USER_ID=1000
ARG GROUP_ID=1000


# This hack is necessary, because it is the only way to install 32-bit wine on 64-bit alpine.
RUN echo "x86" > /etc/apk/arch &&\
        apk add --no-cache wine &&\
        echo "x86_64" > /etc/apk/arch &&\
        addgroup -g ${GROUP_ID} iw4x &&\
        adduser -h "/iw4x" -G iw4x -D -u ${USER_ID} iw4x

ENV WINEARCH win32
ENV IW4X_PORT 28960
ENV IW4X_ARGS -dedicated +set net_port ${IW4X_PORT} +exec server.cfg +party_enable 0 +sv_maxclients 12 +map_rotate

USER iw4x
WORKDIR /iw4x

RUN mkdir -p server

COPY ./init.sh /iw4x/init.sh

VOLUME ["/iw4x/server"]

EXPOSE ${IW4X_PORT}/udp
EXPOSE ${IW4X_PORT}

CMD ["/bin/sh", "/iw4x/init.sh"]

And the following file with the name init.sh inside of iw4x-dedicated/image

#!/bin/sh -e
cd server/
wine iw4x.exe ${IW4X_ARGS}

Do not forget to make init.sh executeable

$ chmod +x image/init.sh

Now create a file called docker-compose.yml inside of iw4x-dedicated with the following content

version: "3.7"
services:
  server:
    build:
      context: "./image/"
      args:
        # You can change these matching the ids of your current user, except if you are root.
        - USER_ID=1000
        - GROUP_ID=1000
    image: "iw4x:latest"
    # Will auto-restart your server if it crashes.
    restart: always
    environment:
      # Do not forget to adjust the ports section down below if chaning the port.
      IW4X_PORT: 28960
      # Here you can change the commandline arguments of your server.
      IW4X_ARGS: "-dedicated +set net_port ${IW4X_PORT} +exec server.cfg +party_enable 0 +sv_maxclients 12 +map_rotate"
    volumes:
      # Copy the whole dedicated server into iw4x-dedicated/data/ and make sure the files are owned by the values of ${USER_ID} and ${GROUP_ID}
      - "./data/:/iw4x/server/"
    ports:
      - "28960:28960/udp"
      - "28960:28960"

After you have copied the serverfiles into iw4x-dedicated/data/ and have adjusted the file ownerships you can build your Docker image and start your server

$ docker-compose build --compress --force-rm --no-cache --pull
$ docker-compose up -d

If you want to see the output of your server you can use

$ docker-compose logs -f

IW4x Server API

IW4x dedicated servers have an api endpoint that you can use to get some information about the server. The currently implemented endpoints are documented here.

Endpoints

  • /serverlist
  • /info
  • /list
  • /map

Serverlist

The /serverlist endpoint returns a json array of all known servers excluding itself. If you query your own server you will in most cases not get a single of your own hosted servers (as long as they are on the same IP). This is a limitation of how NAT works and cannot be fixed. As a workaround I suggest merging your own servers with the array.

Example: ["x.x.x.x:28960", "x.x.x.x:28960"]

Info

The /info endpoint returns a json with the server's scoreboard and some server information.

List/Map

The /list & /map endpoints are used in our implementation of the mod/map download. The files are downloaded from /file/<name>. You can only download active mods and maps from the server.

Gameserver file optimization

You can delete some files that are not needed when hosting a dedicated server. This will save some space on your hard drive, but is not necessary.

The following files can be safely deleted:

  • logo.bmp
  • splash.bmp
  • main\video
  • main\iw_01.iwd
  • main\iw_02.iwd
  • main\iw_03.iwd
  • main\iw_04.iwd
  • main\iw_05.iwd
  • main\iw_06.iwd
  • main\iw_07.iwd
  • main\iw_08.iwd
  • main\iw_09.iwd
  • main\iw_10.iwd
  • main\iw_11.iwd
  • main\iw_12.iwd
  • main\iw_13.iwd
  • main\iw_14.iwd
  • main\iw_15.iwd
  • main\iw_16.iwd
  • main\iw_17.iwd
  • main\iw_18.iwd
  • main\iw_19.iwd
  • main\iw_20.iwd
  • main\iw_21.iwd
  • main\iw_22.iwd
  • main\iw_23.iwd
  • main\iw_dlc4_01.iwd
  • main\iw_dlc6_00.iwd
  • main\iw_dlc7_00.iwd
  • main\localized_english_iw00.iwd
  • main\localized_english_iw01.iwd
  • main\localized_english_iw02.iwd
  • main\localized_english_iw03.iwd
  • main\localized_english_iw04.iwd
  • main\localized_english_iw05.iwd
  • main\localized_english_iw06.iwd
  • main\localized_english_iw07
  • miles
  • iw4x\video
  • iw4x\iw4x_01.iwd

The following files can safely be modified (open them with 7-Zip or WinRAR):

main\iw_00.iwd
Delete everything inside the file except fileSysCheck.cfg.

main\iw_dlc3_00.iwd
Inside the file delete the images and sound folder.

main\iw_dlc4_00.iwd
Inside the file delete the images folder.

main\iw_dlc5_00.iwd
Inside the file delete the images and Sound folder.

main\iw_dlc5_01.iwd
Inside the file delete the images folder.

main\iw_dlc8_00.iwd
Inside the file delete the images folder.

iw4x\iw4x_00.iwd
Inside the file delete the images and vision folder.

List of map names

Basegame

mp_afghan - Afghan
mp_derail - Derail
mp_estate - Estate
mp_favela - Favela
mp_highrise - Highrise
mp_invasion - Invasion
mp_checkpoint - Karachi
mp_quarry - Quarry
mp_rundown - Rundown
mp_rust - Rust
mp_boneyard - Scrapyard
mp_nightshift - Skidrow
mp_subbase - Sub Base
mp_terminal - Terminal
mp_underpass - Underpass
mp_brecourt - Wasteland

DLC1 STIMULUS

mp_complex - Bailout
mp_crash - Crash
mp_overgrown - Overgrown
mp_compact - Salvage
mp_storm - Storm

DLC2 RESURGENCE

mp_abandon - Carnival
mp_fuel2 - Fuel
mp_strike - Strike
mp_trailerpark - Trailer Park
mp_vacant - Vacant

DLC3 NUKETOWN

mp_nuked - Nuketown

DLC4 CLASSICS 1

mp_cross_fire - Crossfire
mp_bloc - Bloc
mp_cargoship - Cargoship

DLC5 CLASSICS 2

mp_killhouse - Killhouse
mp_bog_sh - Bog

DLC6 FREIGHTER

mp_cargoship_sh - Freighter

DLC7 RESURRECTION

mp_shipment_long - Long:Shipment
mp_rust_long - Long: Rust
mp_firingrange - Firing Range

DLC8 RECYCLED

mp_storm_spring - Chemical Plant
mp_fav_tropical - Tropical: Favela
mp_estate_tropical - Tropical: Estate
mp_crash_tropical - Tropical: Crash
mp_bloc_sh - Forgotten City

SP MAPS to MP

oilrig - Oilrig
iw4_credits - Test map
co_hunted - Village

Mods

Create a mod

Nothing here yet :(

Create a map

This is how you create a custom map for IW4x.

Requirements

You have to fulfill the following requirements to be able to create a custom map for IW4x:

Create a map

Creating a custom map requires to create a map for Call of Duty 4 first.
For that you can follow various existing tutorials.
You can then follow the steps to convert your map for IW4x.

Convert a map

Notes

  • Automatic conversion for now only works for multiplayer maps
  • Your map might have a lot of bugs, map conversion is in an early alpha stage
  • Once we update the tools, you might have to reconvert your map

Conversion

  • Open the Build Map tab in the IW4x Mod-Builder
  • You will see a list of maps if you correctly configured all paths:
    • Stock Maps are the maps located in your <Call of Duty 4>/zone/<language>/ directory
    • User Maps are the maps located in your <Call of Duty 4>/usermaps/ directory
    • Other Maps are the maps you already converted, they will be in your <Modern Warfare 2>/mods/ directory
  • Select the map you want to convert and click Export COD4 Map, this will export all required files into your <Modern Warfare 2>/mods/ directory
  • After the export, you can optionally edit the map’s CSV source[1] or edit the arena to change the name or teams of your map.
  • Click on Build MW2 Map to create the map, it will be located in <Modern Warfare 2>/usermaps/
  • At this point, you are able to test your map by clicking Run MW2 Map

Deployment

Once you followed all the steps for converting your map, you have to generate the IWD by clicking Generate IWD for the map you selected in the IW4x Mod-Builder. This will compress the images for your map. All required files should be located in <Modern Warfare 2>/usermaps/<your map>/. Those are all files you need, you can then run the map on your server or client using map <your map>. Players connecting to your server will automatically download all required ressources to play the map.

[1] Sometimes, you will get missing techset errors. This means you will need other dependency maps in your CSV. For now, as it is still hard to find the correct dependency, you can contact the IW4x staff on discord.

Seeing few servers

When playing IW4x you may notice the serverlist occasionally showing less servers or showing different amounts of servers for your friends.

This is due to IW4x's decentralisation. Under normal circumstances you would receive a list of servers from one or multiple master servers, like so:

IW4x however uses a decentralized system in which servers directly inform the client of their presence and send their information, like so:

So instead of having one incoming connection delivering a server list, you have multiple, potentially hundreds of simultaneous incoming connections sending information to your client.

So why does this cause problems?

Seeing few servers is almost always a problem of your router; old, low-end routers may not be able to handle the amount of incoming connections at once, some might even crash due to that; newer, high-end routers may see the amount of incoming connections as a DDoS attempt, therefore blocking them.
This will cause servers to not appear. IW4x developers attempted to fix this by slowing down the requests, spreading them out over a longer time period, this is where the Dvars net_serverQueryLimit and net_serverFrames come in.

net_serverQueryLimit defines how many servers are queried per query frame. A higher number means more servers simultaneously sending their information to you. A value of 10 will mean that ten servers are sending their information to you per query frame.
net_serverFrames defines the amount of query frames per second. A value of 1 will mean that there is only one query frame per real time second.
Together, these two Dvars form a formula you can use to calculate the amount of servers being queried per second:
(value of serverQueryLimit) * (value of serverFrames) / 1 second
The default values for these Dvars using the fix DLL file are 10 each. This means that there are 10 * 10 / 1 second = 100 servers / second requested. The values are higher without the DLL.
Values of 3 on each will mean that there are 3 * 3 / 1 second = 9 servers / second requested, significantly lowering the amount of incoming connections and helping with the server list.