PDA

View Full Version : Call of Duty 2 DX9 performance fixes


Pages : [1] 2 3 4 5 6

myshkinbob
11-01-05, 07:11 AM
I haven't put this in the COD2 feedback thread as i've a feeling it's going to get linked to from other forums, and it might get lost in the main feedback thread.

I played through cod2 the other day, at 1024x768, and it was fun, but really laggy. I'm using a 6800GT via nvstrap, and performance was less than i expected using the DX9 path. So last night i loaded up cod2 and went through the r_ console commands, looking for tweaks.

Basically this game can run a lot better on nv40 hardware than it does by default. I expect the same is true for g70 cards too. I heard someone with a GF3 even got +10fps from the first tweak.

There's two main tweaks^^^bugs that boost fps massively (+20/40%), without affecting IQ at all.

First up, r_multigpu, this defaults to 0. However another cvar, r_gpusync, defaults to 3, adaptive mode. This is a bug. Currently r_gpusync defaults to a setting that to some extent depends upon r_multigpu being true. Anyone using a single graphics card can gain 5-20% better minimum framerate by setting r_multigpu to 1, or r_gpusync to 0 (off). r_multigpu 1 is the same as setting "optimise for SLI" to Yes in the options menu.

I can't believe that bug got into the final release, limiting performance on all single card systems. Fair to say this game was developed on SLI rigs, but it's still a sloppy bug to leave in a gold release. Proper beta testing anyone? heh.

The second big performance tweak i don't even understand why it works, it's another error/bug i think. You can set texture detail now in the menus, and you can also change it using r_picmip_xxxx in the console. I came across a console command called r_applypicmips that applies new picmip settings without having to do a vid_restart. Providing one of the picmip values has been changed, this command applies the new setting in about one second. I started off using it to test texture/bump/specular sizes affect on performance (incidentally, at 1280x960 2xAA, Extra performs just as well as Normal settings). Funny thing is, after i used the command, i got an fps boost. Quite a considerable one. First thing i thought was it must break something to get the boost, but there are no visible errors, missing textures or shaders. I think something in the renderer initialisation that comes after this command normally, has a detrimental effect on performance, and running this command again afterwards fixes it. Running r_applypicmips once after every map load will give you another 5-20% framerate boost. In order for it to run, you need to change a picmip value first though.

Here's a few screens to show the difference in fps, running at 720p (1280x720) 2xAA, 4xAF, all ingame options maxed, on a 6800GT @ 375/1100. Second image of each set is with tweaks applied, fps top right.

http://www.vapulus.com/cod2sp1.jpg
http://www.vapulus.com/cod2sp1t.jpg
http://www.vapulus.com/cod2sp2.jpg
http://www.vapulus.com/cod2sp2t.jpg
http://www.vapulus.com/cod2sp3.jpg
http://www.vapulus.com/cod2sp3t.jpg

Quite a big jump in fps really. I picked areas of the first level that were lowest for framerate, to show the effect on the minimum fps. Average fps is up a lot. Where previously the game barely reached 30fps, it's in the 40s now. The game is so much more playable, framerates are much more steady in firefights too. Install the cfgs attached and you'll see what i mean. :)

As i said, the second tweak needs to be applied after every map loads. It's a real pain typing in;
"r_picmip 2"
"r_applypicmips"
"r_picmips 0"
"r_applypicmips"
everytime you change map.

So, i made an autoexec and a tweak.cfg. They're attached to this post, put them in your C:\path\to\Activision\Call of Duty 2\main\ folder, load cod2, set your video options, then in the console type "exec autoexec.cfg" to enable the first tweak and misc other minor tweaks, which will add them to config.cfg. you may need to repeat this should you ever change video options. To enable the second picmip tweak you only need to press "." (period) after each map load.

I suggest you read autoexec.cfg and tweak.cfg as they contain comments and other useful parameters to gain fps, that need setting to your own preference. Here's the brief rundown:

autoexec.cfg;
com_hunkmegs "512" - apparently smooths out resource loading stutters.
r_autopriority "1" - no idea, but has no negative effects.
r_anisotropy "4" - gains you ~5-10% framerate over the default "8" depending on poly count, for negligable IQ loss.
r_aaAlpha "1" - texture alpha channel aa method?
r_multigpu "1" - see above. 5-20% fps gain.

tweak.cfg;
r_applypicmip - see above. 5-20% fps gain.
r_zfeather - softens smoke edges, gain 5-20% fps in smokey areas by disabling, noticable IQ loss on smoke/ground overlaps when disabled.

hope this proves useful to people, it's made the game a lot more playable for me. Note the screens above don't show framerate increase for disabling zfeather, as i like the soft smoke edges, so i leave it on. :)

Edit:

To test whether you have the two cfg files in the correct folder, press "," ingame to enable the fps meter, and "/" to disable it. If the meter appears, everything is set up.

Anyone wishing to verify the effects, note; once the game is run with the autoexec in place, all of the r_ commands contained in the autoexec will be saved to your config.cfg. That includes the AF and multigpu settings, which account for 20-30% of the performance boost. So if you wish to take before and after fps readings, take the before readings before you install the cfgs. :)

Edit2:
refixed the cfg path and instructions so autoexec is run at least once manually.

PaiN
11-01-05, 07:40 AM
No thanks is enough for someone like you ;)
Huge appriciation for your hard work ...

Scunner
11-01-05, 08:00 AM
Nice writeup. A post like this makes a welcome change from the "WTF?! lolz!!!1" garbage that pervades the net.

Thanks for your efforts. Looking forward to trying these tweaks tonight.

karkrash81
11-01-05, 08:05 AM
Excellent work sir!! Many humble thanks...

Amoor
11-01-05, 10:55 AM
I have not been able to get autoexec.cfg commands to be executed automatically, I placed the files in \Call of Duty 2\main folder..is there anything else i need to do ?

zoomy942
11-01-05, 10:56 AM
i love you:)

Raiasokura
11-01-05, 11:19 AM
I have not been able to get autoexec.cfg commands to be executed automatically, I placed the files in \Call of Duty 2\main folder..is there anything else i need to do ?

yeah same here, am i missing something?

toxikneedle
11-01-05, 11:24 AM
I got 7800s in SLi, what should the CVAR r_gpusync be set to, to get the most fps? I already got multigpu set to 1 everytime I load the game. I just don't understand exactly what gpusync is?

MindBlank
11-01-05, 11:52 AM
Yes, it works. Performance gains are huge sometimes. I get double the framerate in some spots. 1280x1024 with 2xAA everything maxed and i get 40 FPS avg. I've also noticed that after you apply the tweaks, if you restart the level you get an additional performance boost.

Thanks for the tweak, it's great.

EDIT : I couldn't get the autoexec and tweak to work so i typed them manually. Is there something wrong i'm doing? I copyed them in the root CoD2 folder, the main folder and my profile folder and it still doesn't work.

EDIT 2 : I couldn't manage to replicate the "restart level" thing. Without the tweaks i get 17FPS in the wagon at the beginning. With the tweaks, it jumps to 22 at this spot. However, by restarting the level i manged the first time to further improve the performance, to the point which i got 34 FPS in the first scene and never went below 40 in the resot of training. I can't get it to work anymore however... If i restart the level, i get 34 FPS for a few seconds than it drops to 22 as the game is saved.

Someone with more knowledge can investigate this.

BTW, i created a new profile if that helps...

SlamDunk
11-01-05, 11:55 AM
I first put the files in \main folder... didn't work. Then I moved them into Call Of Duty 2\ root folder but that didn't work either. So what's up?

myshkinbob
11-01-05, 12:20 PM
Hey thanks for the thanks, everyone. np at all :)

It seems i got the directory wrong, but i just tested it, and i haven't, it is the 'main' folder the cfgs need to be in. The problem is COD2 ignores any autoexec.cfg. According to:

http://www.tweakguides.com/COD2_2.html

It says you should put .cfg files in your main/players/<profilename>/ directory. But i found that doesn't work. I tried that first and it ignored the autoexec like the article states, and any other .cfg files you put in your player profile folder. So i copied both cfg files to the main directory, and thought that got it running. It did, but i'd forgotten i also ran "exec autoxec.cfg" manually in the console after copying them too. My bad.

So, to get this working, you do have to put the .cfg files in the \main\ folder. Then you must enable the console, and after setting your video options in the menu, type "exec autoexec.cfg". You don't need to do that everytime you run the game, only after changing any graphics options. exec autoexec.cfg will add it's contents to your config.cfg after your new options are written to config.cfg.

Then the , . / keyboard binds will work, and so the picmip tweak bound to "." will work too. You'll know if tweak.cfg runs because your fps will boost, and the screen will pause for ~1sec each time you press the key.

Toxikneedle:

r_gpusync takes values 0 to 3, enable the console and type r_gpusync and hit Tab, it'll show the option names. I remember 0 is off, 3 is adaptive... 1 is beginning, 2 is beforePresent. I think it's referring to the stage in rendering that the gpu cores are synched maybe? I'd suggest you load up the first USA mission, climb the rope to the top of the cliff, and hit pause when you're looking over the trenches, it's a very busy scene in the game. Then pull down the console, and type r_gpusync 1, then 2, then 3. It updates instantly when you change the option, try 0 to see your fps dive with sli. I expect value 3, adaptive, works best for sli, choosing the most suitable option 1 or 2 depending on the scene.

MindBlank
11-01-05, 12:29 PM
Ok, after further testing, restarting doesn't actually do anything. Running in "Optimize for SLI" (r_multigpu) gives a nice boost. r_gpusync further improves performance, but i can get it to work sometimes.

I'll do some more tests and see what i come up with.


BTW : i get double the framerate on my card in some spots, so yeah, performance is greatly improved. I can't believe the devs didn't look into these things before release. This is unacceptable IMO.

KickAssCop
11-01-05, 12:40 PM
Err.. how do you enable the console.

myshkinbob
11-01-05, 12:51 PM
Err.. how do you enable the console.

Options - Game Options - Enable Console.

hehe. :)

JaylumX
11-01-05, 12:54 PM
EDIT: Bugger. Beat me to it :)

Arto*
11-01-05, 04:46 PM
wow, doesnt help 1 bit. thx anyway

SH64
11-01-05, 04:52 PM
Interesting info .. thanks!
i think i'm going to try the second tweak & see what happens.

SH64
11-01-05, 07:40 PM
Hmm an even interesting note is that forcing 8xAF on CoD2 results in less performance than game's own 8xAF.
for ex. in one place my framerate jumped from 41fps to 47fps just by running 8xAF from the game itself!! (no IQ loss)

pliflier
11-01-05, 10:00 PM
wow MAN ~~~it WORKs!!!

great THX to ya!!!:)

Mr. Hunt
11-01-05, 10:06 PM
Thanks, will try this out tomorrow after work (gots no time right now).

Grechie
11-02-05, 07:59 AM
damn i wonder if it would improve a 5900's performance :(

Burnt_Ram
11-02-05, 09:14 AM
alll i've done sofar is enable multi GPU, and it smoothed out my performance bigtime ! thank you :)

johnkeel105
11-02-05, 10:26 AM
This definately caught my attention since I lead a Call of Duty 2 Clan. I was wondering if these tweaks apply for directx 7 mode as well. The majority of my guys are stuck with geforce fx 5200 and 5500's. If you could fill me in I would appriciate it. Thanks!

Burnt_Ram
11-02-05, 02:42 PM
This definately caught my attention since I lead a Call of Duty 2 Clan. I was wondering if these tweaks apply for directx 7 mode as well. The majority of my guys are stuck with geforce fx 5200 and 5500's. If you could fill me in I would appriciate it. Thanks!it couldn't hurt ;) how well does a low end FX card run it in DX7 without tweeks ? i would think fairly well .. shame people have to run in DX7 ! even MOHAA/SH looks better than COD2 in DX7.

rudedog
11-02-05, 03:14 PM
This definately caught my attention since I lead a Call of Duty 2 Clan. I was wondering if these tweaks apply for directx 7 mode as well. The majority of my guys are stuck with geforce fx 5200 and 5500's. If you could fill me in I would appriciate it. Thanks!

One of my forum members tried and here is what he said:

Yes, it does work. I got approximately a 20% boost to DX9. Still not quite smooth enough for MP action for me (28-38fps), so I decided to check if it helped my DX7 performance also and WOW! it did. I'm running an AMD64 3200 Newcastle OC' to 2400Mhz with 1 Gig Geil DDR 500 and Leadtek 6600GT. AT 1024x768 res in DX7 mode I went from 70-100 fps before the fix to 125-350fps after the fix