Battlefield 2 Tweak Guide
[Page 7] Advanced Tweaking
Config Files
Aside from the in-game settings, Battlefield 2 has a large number of config (.con) files spread throughout its directories. These files can be edited using a text editor like Windows Notepad or Wordpad. Before editing any .con file, first make sure you make a backup copy of it.
However as you may have noticed, editing many of these .con files can prove pointless as the changes seem to have no impact. I have found that the main configuration files which do have an impact are found under your \Documents and Settings\[username]\My Documents\Battlefield 2\Profiles\ directory, with the settings for each profile (whether an online or offline profile) are listed under a numbered directory (e.g. \0001 for the first profile, etc.). Note, I don't recommend that you edit the files under the \Default directory. To see which particular profile is currently in use, open the Global.con file under the \Profiles parent directory first, then see which number it mentions, and go to that particular numbered directory to find the files mentioned below.
Most of the settings in these .con files can and should be altered using the in-game options. However there are a few things you can adjust which are unique to the .con files:
Video.con
VideoSettings.setResolution 1280x960@75Hz
This setting controls your current resolution in Battlefield 2. The format is Width x Height@Refresh Rate. If you cannot start up BF2 and change the resolution from within the game, try altering it here to help you startup the game. In particular when you want to launch BF2 for the first time and the game just crashes back to desktop (See Troubleshooting Tips section), you can change the resolution from its default of 800x600@60Hz to one your monitor supports. Note however that certain resolutions are unsupported and entering them here will not work - see the Command Line section further below.
VideoSettings.setTerrainQuality 4
VideoSettings.setGeometryQuality 4
VideoSettings.setLightingQuality 4
VideoSettings.setDynamicLightingQuality 4
VideoSettings.setDynamicShadowsQuality 4
VideoSettings.setEffectsQuality 4
VideoSettings.setTextureQuality 4
VideoSettings.setTextureFilteringQuality 4
All of the above settings can be adjusted from within the in-game Video settings. However the highest they can be set to is High from within the game (a value of 3). By setting them each to 4 in Video.con (as shown above), you will have them displayed as 'Videosettings_Ultrahigh' in the in-game Video settings screen, and some people believe this increases the graphics quality to Ultrahigh levels. I didn't see any impact from this change, but if you want the absolute best quality in BF2 give it a try.
Update: As of the 1.3 Patch, you can no longer set Ultra High quality, the highest value which works for these settings is 3, which is also the maximum possible when using the in-game settings.
Profile.con
This file contains details of your online account including the username (GameSpyNick), the Email attached to that name, and the Password (encrypted). You can't change these details here - doing so will have no impact on your online account, except maybe cause problems logging on or with Punkbuster. If you want to change your online account name, email, or both, the correct way to do so is by going directly to the GameSpyID site, and first login using your current details. Then change the relevant information, enter the correct password and submit it to save the changes. Then when you return to BF2, enter your new details and retrieve your new account details then login to your multiplayer account.
General.con
GeneralSettings.addServerHistory
This settings show you the last servers you have successfully connected to. This list is handy because it provides the server names as well as the IP Number and Port Number. You can use these details in the Server Browser window to quickly connect to the same server again. The quickest way however is to simply go to the Favorites tab which has a record of the last 20 servers you've played on as well as any servers you've tagged as favorites. See the Multiplayer section of the In-Game Settings section for more details.
Interestingly, you can add console commands to General.con, and they will be implemented at startup for BF2. So for example if you want the FPS counter to appear whenever you launch BF2 and join a game, add the renderer.drawFps 1 command at the bottom of General.con. The list of console commands is on the next page.
Controls.con
This file contains all of the control mappings for actions in the game. The file structure is quite complex, and rather than cover it at length here, I recommend you see this detailed thread on the PlanetBattlefield Forums: Anatomy of Controls.con.
These are pretty much all of the useful things you can do by way of tweaking the .con files which I am aware of. As I mentioned, most of the settings in the .con files can be (and should be) changed using the in-game settings, and many of the settings in the numerous .con files spread throughout the game directories have no impact on the game. In fact there are a whole series of legacy files using the BF1942 file structure in the \Program Files\EA Games\Battlefield 2\mods\bf2 which use old commands no longer used in BF2.
Usersettings.con
This file is found under your \Program Files\EA Games\Battlefield 2\mods\bf2\Settings directory. There are two particular settings of interest here which are reported to help reduce the inaccurate feel /hit detection of weapons fire in BF2:
SettingsManager.floatSet GSDefaultLatencyCompensation 0.100000
This setting controls latency (or 'lag') compensation, which involves the game attempting to offset the delay between information being sent from your machine to the server and back again (as measured in milliseconds by your Ping). In games without client-side latency compensation, you have to lead your target by a certain amount, since whenever you fire a weapon your bullets will actually register in the game world with a delay equal to your Ping. In BF2, whenever you fire a weapon, whatever appears in your crosshairs at that particular moment is registered as being hit, regardless of where they actually are at that point in time. This removes the need to predict where your target will be based on ping delay, and makes the game feel more responsive. However it can also introduce quirks like ducking behind a wall and still being hit.
In any case, this setting controls the default latency compensation applied, and the normal value is 0.100000 = 100ms. Some people claim that by adjusting this value to match your average ping in the servers you play, it can improve hit detection. For example, if you typically have a 50ms Ping, setting this to 0.050000 should improve the feeling of accuracy in the game. To be honest having experimented with this setting in isolation I didn't notice much difference either way. I believe the latency compensation is actually dynamic, only starting at the default value given in this setting, and adjusting to match your average ping over time. However even if it isn't, in general you can try to match your Ping with this setting to see the results. Note that lowering this setting well below or above your average Ping will only add to lag and may decrease your accuracy at best, so stick with keeping it equal to the Ping you get on most servers.
SettingsManager.U32Set GSInterpolationTime 100
Interpolation is a technique used to increase the smoothness of an online game. Basically interpolation is the prediction of where a particular moving object or character is currently located in the game world, based on data received on where they were and where they are. For example if an enemy soldier is running across the screen, interpolation allows their movement to appear fluid, calculating their predicted movement across the screen even though your computer is receiving only periodic updates of where they actually are. So instead of seeing a person jerkily warping from point to point, you see smooth animated motion all the way along. This especially helps to keep things smooth if/when packets are momentarily lost between the server and you; the game knows where the player currently is, where they were a moment ago, and calculates and displays the movements in between.
By default, Battlefield 2 appears to have a 100 millisecond buffer for interpolation. The problem with this is that while making things appear smoother, it also means that when firing upon a fast-moving object you may miss where they actually are as you're effectively facing an additional 100ms delay. At least that's the theory, and in general in my experimentation I found slightly improved hit detection results (and no noticeable increase in jerkiness) by using a lower value of 50 or even 30 for this setting. Note however that this variable should not be set too low (and certainly not a value of 0) as it will result in increased warping/jerky movements, and if you generally have a ping higher than 100 you shouldn't lower this setting. For those who do try this, also remember that the improvement from lowering this setting is not dramatic, since we're talking a difference of say 50ms (1/20th of a second). However particularly in situations where your opponent(s) are moving fast and/or erratically your accuracy should be noticeably improved.
It is important to understand that the generally inaccurate feel of most weapons in BF2 is intentional, as realism has been sacrificed for the sake of gameplay. Techniques to steady your aim such as going prone and using short bursts can help improve hit rates. Furthermore it appears that much of the time the lack of hit registration is due to lost packets. I've noticed the Battlefield series suffers quite a bit from packet loss, often manifesting as serious warping or jerkiness, getting caught against walls or other barriers, and incidents where you can appear to be firing at an unmoving target at point blank range and still somehow miss with most bullets; information is being lost to/from the server.
The key thing to note about both settings above is that unfortunately neither I nor anyone else knows for sure what the real story is - only EA/DICE know the truth about how their netcode works, and they've stated nothing to clarify these settings. What I've written above is based on my own experimentation, understanding and research about these settings. For the most part I haven't found any problems with PunkBuster by using the recommended settings above, though some servers may be very strict and not allow these values to be changed. If altering these values seems to make things worse for you, or you experience more jerkiness, lag or disconnections, reset them to the defaults shown above and leave them be.
Command Line
There are a range of commands - mainly designed for servers running BF2 - which can be activated via the BF2 command line. You can use these commands by going to your main Battlefield 2 shortcut you use to launch the game, right-click on it and select Properties. Note that in Windows Vista, you should open Games Explorer, right-click on the Battlefield 2 icon, select Customize, highlight the first 'Play' commend and select Edit. Then in the Target box, after the "C:\Program Files\EA Games\Battlefield 2\BF2.exe" text, insert another space, then use any of the commands below. Each command must have a single space between it and the next command.
For example, one of the most commonly requested commands is to run BF2 in a custom resolution - particularly for LCD displays which display the best image at their native resolution. To do this, change your command line to look like this:
"C:\Program Files\EA Games\Battlefield 2\BF2.exe" +menu 1 +fullscreen 1 +szx 1280 +szy 1024
Note the addition of the +szx and +szy commands which respectively set the width and height of the resolution to be used. Substitute other values for other resolutions (e.g. +szx 1900 +szy 1200). Also note that as of the 1.03 Patch, 1280x1024 is now a supported resolution and can be selected within the in-game settings, and as of the 1.50 Patch, widescreen resolutions are also supported, so you don't need to use the +szx/+szy commands to force these resolutions anymore.
The following are the known command line commands for BF2, and descriptions where possible:
+playerName - Set the player name
+playerPassword - Sets the player password
+joinServer - Join a server by IP address or hostname
+fullscreen - Start game in full screen mode
+nosound - Start game without sound
+szx - Set resolution width
+szy - Set resolution height
+dedicated - Start in dedicated server mode
+multi - Allow starting multiple BF2 instances
+password - Set the server password when joining a server
+config - Sets path to the ServerSettings.con file to use
+maplist - Sets the path to the MapList.con file to use
+lowPriority - Run the game with slightly lower priority
+loadLevel - Set the level to load
+wx - Position game window on the screen at certain x-position
+wy - Position game window on the screen at certain y-position
+demo - Sets the con-file with demo options
+maxPlayers - Sets max players
+gameMode - Sets the game mode
+modPath - Sets the mod path (default /mods/bf2)
+help - Displays help
+ranked - Allows GamSpy snapshot sending
+playNow - Use PlayNow functionality
+port - Specifies the network port to be used
+pbPath - Set the path to use for PunkBuster on multi-instance configs
+hostServer -
+checkForAvailablePatch -
+checkForPatch -
+ai -
+restart - skips intro movies
Note: You must use the correct case for these commands to work - for example the +playername command only works if used thusly: +playerName - note the capitalized N. These all work as of the latest version, including commands like +joinServer.
As you can see, most of these commands are really only useful for those running BF2 servers, and the descriptions are fairly vague. However a couple of the more useful commands are covered in more detail on the last page of this guide.
The next page concludes the Advanced Tweaks with a list of known Console Commands.