ccomrade / c1-launcher

Open-source Crysis executables.
287 stars 25 forks source link

Possible for c1-launcher to fix Crysis Warhead DX9 being stuck at 60Hz #45

Open georgeli94 opened 3 months ago

georgeli94 commented 3 months ago

I don't know if it was a recent Windows update, Nvidia driver, or what, but I haven't played Crysis Warhead in a while and recently when I boot into Crysis Warhead in DX9 mode, the game is stuck at 60Hz in fullscreen. It's unlocked in Windowed mode, but then that requires using Borderless Windowed and Crysis tends to drop back to just Windowed mode during loading, so it's not a perfect solution.

I also notice the game being quite stuttery when loading into a game in DX9 mode as well. DX10 mode runs buttery smooth, but the reason I usually play DX9 mode before is because there's a shader bug with a particular tree model that only occurs in DX9 mode. It's a minor thing, but it'd be nice for DX9 to run as smoothly as DX10. Or if possible, could the shader bug on the tree be fixed in DX10 mode? I know it has something to do with shaders since the problem disappears if you drop Shaders to Medium (Mainstream) settings, but obviously the game looks noticeably worse without it. Included some pics of the shader bug on that particular tree model between DX9 and DX10.

Again, it's a very minor issue and if there's no fix at all, I'll just play on DX10 mode which, with this launcher, is buttery smooth in DX10. It would just be nice if this shader bug could either be fixed or DX9 run as smoothly. Crysis Warhead DX9 Crysis Warhead DX10

ccomrade commented 3 months ago

Strange. DX9 usually works well, but it wouldn't be the first time nVidia broke something with their drivers. What about other DX9 games? Do they have the same problem? This should be fixable here.

About the shader issue, well, it's even more strange. It could be a bug in shader scripts inside game assets. I rarely use DX10, but it happens on my system (Linux, DXVK, AMD GPU) too:

image

georgeli94 commented 3 months ago

I tried Call of Juarez in DX9 mode and it loaded just fine. Usually the stuttering in Warhead in DX9 mode only happens when I'm initially loading into a save or initially zooming into a new area. Happens both in borderless windowed and in fullscreen. Call of Juarez also wasn't locked to any low refresh rate, so it was at 100FPS (an in-engine lock) the whole time I was playing. So seems like it's a Crysis Warhead specific thing, just like how DX10 always went low refresh rate before.

As for the shader issue in DX10, it's definitely a general shader issue bug. But it only happens in DX10 mode, not in DX9, so I'm wondering what DX10 specific shader could cause this. The shader files are available, but I haven't been able to find anything in my digging around.

Again, also a minor issue, and as of right now, your launcher fixed DX10 mode and that runs buttery smooth, so if you can't do anything, I'll just play in DX10 mode from now on. Still, given that you yourself usually play in DX9, fixing the DX9 refresh rate and stuttering would be nice. If not possible, then DX10 with the fixed shaders would be ideal, but otherwise just play the game with DX10 mode with your launcher.

ccomrade commented 3 months ago

jedi95 confirmed that this 60Hz lock in DX9 is a Warhead-specific issue. While porting memory patches to Crysis Warhead, i noticed that renderer is a bit different there compared to Crysis and Crysis Wars. It seems they messed up something. I'll try to prepare a fix for this.

Also, i've asked around in CRYMOD.NET community about the shader issue. The problem is actually a broken material of that tree and flow already fixed it in his Back to Hell mod, so big thanks to him.

The fixed material is the following file inside Outpost_Objects.pak:

Objects/natural/trees/Jungle_Tree_Large/jungle_tree_large_swampy.mtl

The easiest way to get the fix into Warhead is to make a copy of Outpost_Objects.pak from the mod, open it, remove everything except the material file above, then copy the resulting tiny pak to Warhead's Game folder and rename it to ZZ_FixSwampTreeDX10.pak. You can choose any name you want, but it's important that it starts with Z, so the pak is loaded after Warhead's original paks.

georgeli94 commented 3 months ago

Holy shit, that worked! The tree is fixed even in DX10 mode. At this point, I'll just play in DX10 then, though for people who play DX9, that 60Hz bug can still be fixed.

In the meantime, I've uploaded the actual file so anyone else who sees this can download it, unzip it, and drop it in. ZZ_FixSwampTreeDX10.zip