The (self-proclaimed) Official BF2 Optimizing thread!
Page 1 of 1
gutyreader




Posts: 365

PostPosted: Wed, 29th Jun 2005 16:15    Post subject: The (self-proclaimed) Official BF2 Optimizing thread!
Post usefull informations about optimizing and bug/problem fixing you have found here. Please stay concise and on-topic.

The EAX problem:

On many systems, disabling EAX in the sound option menu gave a remarkable increase in framerate. This is mostly due to bad implementation of the EAX and the aweful optimizing for cheaper, on-board sound cards.


The AC97 sound card issue(s):

Updating the AC97 with the latest realtek drivers can fix many issues with stuttering and general lag if you have an AC97 based sound card. (this includes a vast majority of on-board sound cards.)
http://www.realtek.com.tw/downloads/dlac97-2.aspx?lineid=5&famid=12&series=8&Software=True


The PunkBuster manual update:

In some cases, Punkbuster can slow down your system because it is unable to automatcly update itself. This usually happens on system with tight firewalls (all computers should run an aggressive firewall, in my opinion.)
Follow these instructions:
http://www.bf2world.net/bbs/rid-the-lag-vt594.html


The firewall ports issue:


In many cases, firewalls can be a double sided blade. Opening these ports should allow Battlefield 2 to run properly
http://www.eagames.com/official/battlefield/battlefield2/us/editorial.jsp?src=communityupdate_061405_02
This should help reduce the amound of servers that ping with 0 latency.


Plenty of useful tips posted here by Nerrd
Code:

---------------------------------------------------
trick for play with 64 Gamers in Singleplayer
---------------------------------------------------
search: BF2/mods/bf2/ai than open aidefault.ai with Wordpad

read the instructions and change:

rem aiSettings.overrideMenuSettings 1
rem aiSettings.setMaxNBots 32
rem aiSettings.maxBotsIncludeHumans 0
rem aiSettings.setBotSkill 1.0

delete the rem before the aiSettings... and change 32, in 48, 64 so you want

so now start game and you can play with more bots...

---------------
Serial change
---------------
( for ppl ho allready have installed the game open regedit and find this entry HKYE_LOCAL_MACHINE\SOFTWARE\Electronic Arts\EA GAMES\Battlefield \ergc there you have your cdkey)

------------------
Unlock weapons
------------------
*works in single player and lan games, will work online *IF* the server hosting *AND* all the clients have the same hacked python file.

navigate to:
C:\Program Files\EA GAMES\Battlefield 2\python\bf2\stats

Open the file unlocks.py with notepad

find the line:
Code:

defaultUnlocks = [0, 0, 0, 0, 0, 0, 0]


change to:
Code:

defaultUnlocks = [1, 1, 1, 1, 1, 1, 1]

--------------
infinite time
--------------
open up the file gpm_cq.py with notepad, it's under Battlefield 2 Standalone Demo Server\mods\bf2\python\game\gamemodes
then locate:
host.registerHandler('TimeLimitReached', onTimeLimitReached, 1)
and replace by:
#host.registerHandler('TimeLimitReached', onTimeLimitReached, 1)
that is in the line 32 Very Happy


-----------------
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 the 'Battlefield 2 Demo' shortcut you use to launch the game, right-click on it and select Properties. Then in the Target box, after the "C:\Program Files\EA Games\Battlefield 2 Demo\BF2.exe" +menu 1 +fullscreen 1 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 1280x1024 resolution (or another 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 Demo\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).

The following are the known command line commands for BF2, and descriptions where possible:

+dedicated - Start in dedicated server mode

+multi - Allow starting multiple BF2 instances

+joinserver - Join a server by IP address or hostname

+playername - Set the player name

+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

+szx - Set resolution width

+szy - Set resolution height

+fullscreen - Start game in full screen mode

+nosound - Start game without sound

+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

+playerPassword - Sets the player password

+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 -


-------------
Config Files
-------------
Battlefield 2 has a large number of config (.con) files spread throughout its directories. These can be edited using a text editor like Windows Notepad or Wordpad. Before editing any .con file, first make sure you have a backup copy of it.

However as you may have noticed, editing some of the .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 Demo\Profiles\ directory, with the settings for each profile listed under a numbered directory (e.g. \0001 for the first profile, etc.). You should stick to editing the files for your specific profile, as messing with those under the \Default directory will affect all profiles. 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.

For the moment I've found few useful tweaks to these files, as most of their settings can be altered using the in-game options, or the tweaks have no impact. However here are a couple of things to note:

Video.con

This file contains the graphics-related settings. Note however that if you try to alter your resolution here for example, it will typically lead to BF2 not starting up, or crashing after the login screen, or simply not applying the desired resolution. Use the Command Line method further below to set a custom resolution.

Controls.con

To change particular keys which are automatically bound to certain functions in the game (and can't be changed in the in-game settings), find the line for that particular key (e.g. IDFKeyboard IDKey_LeftCtrl is the line which contains the Left Control key mapping), and delete that line. It should now be free to be mapped in the Controls section of the in-game settings.

Sadly the above is all I know about the config files at the moment, more will follow as I experiment and get reader feedback.

Click to enlarge

Console Commands

To open the BF2 in-game console, press the '~' key (or the key above TAB) to open/close the console. To see the list of command categories, press the TAB key twice. To see particular sub-types, enter the start of the command press TAB twice. E.g. enter renderer, then press TAB twice to see the renderer sub-class of commands.

The list below is the full list of console commands, however many commands don't have descriptions. Please Email Me if you are absolutely certain what a particular command does through your own personal testing. This will help me finish this list as soon as possible for all to share.

Renderer Commands

renderer.drawHud [0,1] - Turns the Heads Up Display (HUD) on or off.

renderer.drawConsole [0,1] - Turns off access to the in-game console if set to 0.

renderer.drawFps [0,1] - Displays the current and average frames per second (FPS) in the top left corner.

Game Commands

game.sayAll [string] - Says the specified text in global chat

game.sayTeam [number] [string] - Says the specified text in team chat

game.lockFps [framerate] - Caps the game's maximum framerate to specified number

game.allowToggleFullscreen [0,1] - If set to 1 allows toggling of fullscreen/windowed mode

game.toggleFullscreen - Toggles between fullscreen and windowed mode

Demo Commands

demo.recordDemo [demoname] - Starts recording current gameplay and saves the file as demoname.bf2demo in your \Program Files\EA Games\Battlefield 2 Demo\mods\bf2\Demos directory

demo.stopRecording - Stops current demo recording

demo.ShutdownDemo -

Localprofile Commands

localProfile.setName [name] - Sets the name for your current account

localProfile.setNick [nick] - Sets the nickname for your current account

localProfile.setGamespyNick [GameSpyNick] - Sets the GameSpy login name for your account

localProfile.setEmail [email account] - Sets the email account for the current account

localProfile.setPassword [password] - Sets the password for the current account

localProfile.setNumTimesLoggedIn [number] - Sets the number of times the player has logged in with the current account

localProfile.setTotalPlayedTime [seconds] - Sets the time the game has been played using the current account

localProfile.save -

localProfile.addDemoBookmark [ ] -

Globalsettings Commands

globalSettings.setDefaultUser [number] - Sets the profile to use, the first one being 0001, then 0002 etc.

Sv Commands

These commands are used to adjust server settings, particularly in the Serversettings.con file under your \Documents and Settings\[username]\My Documents\Battlefield 2 Demo\Profiles\[profile]\ directory.

sv.allowNATNegotiation [0,1] -

sv.interface -

sv.timeBeforeRestarting [0,1] -

sv.autoBalanceTeam [0,1] -

sv.teamRatioPercent [0,1] -

sv.autoRecord [0,1] -

sv.demoIndexURL [address] -

sv.demoDownloadURL [address] -

sv.autoDemoHook -

sv.demoQuality -

sv.adminScript -

sv.sponsorText -

sv.sponsorLogoURL [address] -

sv.communityLogoURL [address] -

sv.radioSpamInterval -

sv.radioMaxSpamFlagCount -

sv.radioBlockedDurationTime [seconds] -

sv.useGlobalRank [0,1] -

sv.useGlobalUnlocks [0,1] -

Gamelogic Commands

gameLogic.togglePause - Toggles pausing the game.

Settingsmanager Commands

These commands set a range of variables. E.g. SettingsManager.boolSet GSUseObjectCache 1. The command used must match the type of variable (e.g. .boolset for Boolean variables, .IntSet for variables requiring integer input, etc.)

SettingsManager.stringSet -

SettingsManager.boolSet -

SettingsManager.IntSet -

SettingsManager.floatSet -

SettingsManager.u32Set -

SettingsManager.stringGet -

SettingsManager.boolGet -

SettingsManager.intGet -

SettingsManager.foatGet -

SettingsManager.U32Get -

Inputdevices Commands

InputDevices.setInvertAxis -

InputDevices.setAxisScale -

Controlmap Commands

These settings should be used in the Controls.con file under your \Documents and Settings\[username]\My Documents\Battlefield 2 Demo\Profiles\[profile]\ directory.

controlMap.deleteControlMap -

controlMap.dump -

controlMap.setButtonRiseTime -

controlMap.SetButtonFallTime -

controlMap.SetDoubleTapTime -

controlMap.addAxisToAxisMapping [string] -

controlMap.addButtonsToAxisMapping [string] -

controlMap.addKeyAndButtonToAxisMapping [string] -

controlMap.addKeysToAxisMapping [string] -

controlMap.addButtonToTriggerMapping [string] -

controlMap.AddKeyToTriggerMapping [string] -

controlMap.setAxisScale -

controlMap.setYawFactor -

controlMap.setPitchFactor -

controlMap.addAxisToTriggerMapping -

controlMap.InvertMouse [0,1] - Set to 1 for inverted mouse, 0 for default mouse

controlMap.mouseSensitivity [number] - Determines the sensitivity of the mouse

controlMap.keyboardSensitivity [number] - Deterimes the sensitivity of the keyboard

Maplist Commands

These commands are used to manage lists of maps by server administrators.

mapList.list - Lists map ID numbers, map name, game mode and the number of players if specified.

mapList.configFile [new location for file] - Used to specify the location of the _mapList.con file. Default is \My Documents\Battlefield 2 Demo\ServerConfigs\

mapList.load - Makes the server reload _mapList.con

mapList.save - Saves the current map list on the server to the file _mapList.con

mapList.mapCount - Shows the total number of maps in the current map list

mapList.currentMap - Shows the map list ID number of the current map being played

mapList.clear - Clears the current map list

mapList.remove [map ID number] - Removes the specified map from the map list

mapList.append [map name] [game mode] [number of players] - Add a new map to the end of the map list. You must specify the map name and game mode.

mapList.insert [map ID number] [map name] [game mode] [number of players] - Same as mapList.append command, but with this command you can specify at what map ID number to insert the new map into the list.

Admin Commands

These commands are used by server administrators.

admin.listPlayers - Lists the players connected to the server, showing their name, ID number and IP number.

admin.runNextLevel - Forces the server to end the round and start the next map in the map list.

admin.currentLevel - Shows the map list ID number for the current map being played.

admin.nextLevel - Shows the map list ID number for the next map to be played.

admin.restartMap - Restarts the current map.

admin.banPlayer [player ID number] [timeout] - Enter the player ID number you want to ban. Bans the player from the server by using their IP address. The timeout value controls the length of the ban e.g. perm for permanent ban, round to ban them for the rest of the round, and 180 is 180 seconds (3 minutes).

admin.banPlayerKey [player ID number] [timeout] - Enter the player ID you want to ban. Bans the player from the server by using their CD key hash.

admin.addAddressToBanList [IP address] [timeout] - Enter the IP number you want to ban.

admin.addKeyToBanList [CD key hash] [timeout] - Enter the CD key hash you want to ban.

admin.removeAddressFromBanList [IP address] - Enter the IP address to remove from the ban list.

admin.removeKeyFromBanList [CD key hash] - Enter the CD key hash you want to remove from the ban list.

admin.clearBanList - Clears all ban lists.

admin.listBannedAddresses - Displays a list of the currently banned IP addresses.

admin.listBannedKeys - Displays a list of the currently banned CD keys.

admin.kickPlayer [player ID number] - Enter the ID number of the player you want to kick.

Remote Console

These commands are used by server administrators.

To setup remote console access to the server, onthe server create a new plain text document in \admin\ called default.cfg and enter the following text into the new file:

port=4711

password=YourPassword

Save the file, and start the server. Now you can access the server remotely by using the following commands from a client:

rcon login [YourPassword] - Use this command to login to the server.

rcon users - This command lists all the users connected to the server. Very similar to admin.listPlayers

rcon exec [command name] - Replace with a console command you would like to execute on the server. For example: rcon exec admin.kickPlayer 3

Exit - Quits the game to desktop.




Please submit any other fixe/tweak that have helped you or you just came across. BF2 is an addicting and fun game, but it runs like serious shit. Beta testing just isn't what it used to be.

If you feel you deserve credit for any tip/tweak/fix posted here, please PM meor post here and I will add you, I'm way too lazy to dig through Nforce to spot the original poster of all of these.


The IGN Tweaking Guide, As posted by SoulSurfer2k5
http://gear.ign.com/articles/626/626714p1.html
Back to top
Page 1 of 1 All times are GMT + 1 Hour
NFOHump.com Forum Index - PC Games - Technical
Signature/Avatar nuking: none (can be changed in your profile)  


Display posts from previous:   

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2.0.8 © 2001, 2002 phpBB Group