F.E.A.R.

F.E.A.R.

 This topic has been pinned, so it's probably important
Methanhydrat 30 Aug, 2016 @ 9:13pm
30
13
34
8
2
4
2
4
4
2
3
35
Fix for Logitech/HID FPS problem without disabling devices
[EDIT] Now also available as a Steam-Guide.

It as a well-known problem that there is a bug in FEAR and its expansions where the FPS will drop to around 20-30 after a few minutes of play. This is especially common with people using Logitech devices. Although this can be fixed by disabling most/all HID-Devices in the device manager, it bothered me a lot that his has to be done, even when using the script someone came up with.

I took some time to investigate this problem and came up with a possible fix that removes the problem without having to disable any HID-Device.

I only tested this on Steam but it should in theory work with every version including the retail one.

Instructions

[EDIT] I've updated the fix so it should no longer require to install the Visual C++ Redistributable package. It would be nice if someone who hasn't installed the package yet could confirm that this version works. If it doesn't, just use the old version.

[EDIT] I replaced the old version with the new one since it has confirmed to be working by several people.

  1. Download the following zip-file[community.pcgamingwiki.com] from PCGamingWiki.
  2. Extract the file 'dinput8.dll' to your FEAR main game folder. For steam this in most cases is 'Steam\steamapps\common'. For example: 'D:\Games\Steam\steamapps\common\FEAR Ultimate Shooter Edition'.
  3. Start the game like you would normally, for example through Steam or GOG-Galaxy.

What you should know

I say possible fix because up to this point I only tested this myself. Since I didn't do a longer play session (> few hours) I can't say for certain if this will work in all cases and if there are some unanticipated problems with different hardware configurations. However, even if it turns out that it does not work for all people right now, the problem should definitely be fixable using the approach I used here. Feedback would be highly appreciated.

[EDIT] Fix has been confirmed to be working by several people.

Also since this is an executable DLL-File I could have put any harmful shenanigans in there. You just have to trust me that the file is clean. Be aware however, that the file could trigger anti-virus software, although I didn't have any problems on my end.

[EDIT] If you don't trust me -- and why should you -- feel free to use a meta online virus scanner like VirusTotal to verify the file. Be aware however, that the file could trigger anti-virus software without being harmful. Although nobody reported any problems up to this point.

How this works

The fix is implemented using a common technique known as 'DLL hooking'.

User input in FEAR is realized via DirectInput, an API by Microsoft for interacting with HID-Devices. The library is ancient and not really relevant today, because there are other ways to get mouse and keyboard input, especially for games.

The fps drops happen because the thread that runs DirectInput massively slows down after a while (as can be seen in tools like 'ProcessExplorer').

If an application uses a library like DirectInput, it needs a so called DLL (dynamic-link library) where the functionality of the library is stored. In many cases, especially for libraries provided by Microsoft, these DLLs usually reside in the Windows folder.

However, there is an order of how an application searches for the DLLs it needs. Since the DLL of the fix gets copied into the main folder of the application and has the same name of a DLL needed by the game (the one of DirectInput), it gets loaded instead of the one in the windows folder.

This means that all calls to DirectInput go through the Hook-DLL and can either be directed to the original DLL in the Windows folder or changed as necessary. This also allows some insight in how exactly the library is used by the game.

As it turned out the game not only unnecessarily registers all HID-devices it also calls several functions every frame that usually only should be called once during initialization. The latter seems to apply only to devices that are not keyboards or mice. This eventually leads to circumstances where a lot of time is spent opening and closing device connections.

The fix changes the DirectInput initialization in such a way that only keyboard and pointer devices get registered.
Last edited by Methanhydrat; 12 Dec, 2018 @ 2:38pm
< >
Showing 1-15 of 578 comments
Dude! I am not sure why you are not getting any replies.

I was trying very hard to fix the "Logitech HID" issue on FEAR. Despite disabling all HID devices, the game still slows down after some time - it seems like this fix does not work anymore on WIndows 10.

I finally found your fresh fix, and so far, so good! Playing for the past hour and thing seem to work perfectly.

Whatever the case, thank you for your effort. If I will get confirmation that your fix indeed works and fixes the damn problem, I will update the PC Gaming Wiki.
Methanhydrat 6 Sep, 2016 @ 8:25am 
Thanks for your reply. You seem to be the only one who has tested this fix yet. I'm glad to hear that it has worked for you up to this point and I'm looking forward to hear whether it continues to do so after further play.

It would be nice if you would update PC Gaming Wiki. That is an awesome site. I would have done it myself but I didn't want to do it before someone else actually tested the fix.

DTM 6 Sep, 2016 @ 9:35am 
Thanks for the fix, it worked great! just had to dl the .zip file and extract.
After a little over an hour it was still working just fine
b2007929 6 Sep, 2016 @ 9:53am 
Post to guides instead.
Maik 6 Sep, 2016 @ 12:01pm 
AWESOME
VGA 6 Sep, 2016 @ 12:30pm 
I tested it on my Condemned installation, this game is based on the FEAR engine and has the same problem.

First I ran it without your dll and with FRAPS to show me the fps and after about 10 minutes of play, after a checkpoint save, the framerate dropped from 60 to 40. Then I tried with your dll and finished the rest of the game (about 2 hours) without performance degradation.

So unless it was some fluke, I think this dll fixes this problem for Condemned: Criminal Origins, too. Thanks! :D
Fix worked for me! Rig: i7, R9 290, 16 GB RAM, Win 10. Steam controller used as well. Was getting 10-15 frames/sec. Looked terrible. No logitech products in sight.

Fix was instant. Got a great framerate immediately - thank you!!!

This thread should be stickied.
Vermillion 6 Sep, 2016 @ 2:35pm 
With Condemned, I had to set the game to Windows 7 mode in order for it to launch. I'll report back and see if that is the case with my GOG copy for F.E.A.R.

EDIT: Yeah I had to do the same with F.E.A.R as well. But IT WORKS!!!
Last edited by Vermillion; 6 Sep, 2016 @ 7:54pm
ReasonableSheev 6 Sep, 2016 @ 7:03pm 
Originally posted by b2007929:
Post to guides instead.

Yes, definitely. If the author doesn't post this as a guide, I will.
Methanhydrat 6 Sep, 2016 @ 8:55pm 
Originally posted by Reasonableman:
Originally posted by b2007929:
Post to guides instead.

Yes, definitely. If the author doesn't post this as a guide, I will.

Don't worry, I just created one.
Methanhydrat 7 Sep, 2016 @ 5:22am 
Originally posted by ...:
> You just have to trust me that the file is clean.

Or you can post the source code for the dll and people can compile it themselves?

That is currently not possible because I'm using a proprietary header-only library for some convenience functionality. Although those parts are minor and not essential to the fix, I don't have the time right now to rip them out and rewrite them to make it open-source.

If you are really suspicious, feel free to use a meta online virus scanner like VirusTotal to check the file.
Last edited by Methanhydrat; 7 Sep, 2016 @ 5:23am
VGA 7 Sep, 2016 @ 5:30am 
If you are really suspicious, don't use the file, end of story.
Working like a charm, you legend!
Thank ♥♥♥♥ I can finally play this game.
St4hl 12 Sep, 2016 @ 2:49pm 
doesnt work for me, this error message comes up https://s11.postimg.org/q0tyny0tf/error.jpg
plz help
< >
Showing 1-15 of 578 comments
Per page: 1530 50