Saturday, January 26, 2013

Sudden FPS drop in F.E.A.R (Logitech hardware)

Some users have noticed that they cannot play the game F.E.A.R. (or Condemned: Criminal Origins) with a high framerate, even though their machine is powerful enough for running 5 instances of the game simultaneously. Even weirder is the fact that the game will usually start with the correct framerate but will suddenly drop to 10-20 FPS, after some seconds or minutes. With such a low framerate, it gets difficult to play with pleasure.

You won't let Alma run away from you at 15 frames per second, will you?

If the user has Logitech hardware peripherals, then the source of the problem is already known among the community of players. However, the workarounds presented in every place I visited are far from being confortable to the user.

In this post I present you a simple workaround for the problem that almost feels like a fix.

According to this link, the problem lies in the fact that the game engine overpolls the USB I/O in Windows 7 when Logitech Human Interface Devices (HIDs) are connected to the computer. Some users have reported that disabling the Human Interface Device Access service is enough to fix this issue, but I could not reproduce it.

The usual workaround is to disable all HIDs that belong to Logitech devices from the Windows Device Manager. When they are disabled, special controls like keyboards' volume up/down keys will not work anymore. So, if users make use of these controls they will need to keep enabling the HIDs after playing F.E.A.R.

The transparent workaround

I have created a simple batch script that automatically disables the HIDs and runs the game. Then, when the game quits, the script automatically enables the HIDs.

There is only one requirement besides the actual script: the devcon command-line utility, though it can also be downloaded from this page.

Make it work

Download the following files:
  1. devcon (32-bit) or devcon (64-bit);
  2. the script;
Follow the steps:
  1. Extract the devcon executable to the game directory (where the game executable is);
  2. Copy the script also to the game directory;
  3. The script is only ready for the multiplayer version of F.E.A.R., or F.E.A.R. Combat. Edit the script with a text editor and change FEARMP.EXE to the desired game executable;
  4. Create a shortcut to the desktop and change its icon if you want... you will be playing the game using the script from now on;
  5. Make sure you run it as an administrador and let UAC (User Account Control) proceed. Right-click the script, select Compatibility and check "Run this program as an administrator";
Troubleshooting:
  1. You can mess with the script until it fits your system properly, in case your hardware isn't compatible with the script, though I am using the vendor ID 0x046D, which is Logitech's;
  2. You can lose all keyboard and mouse input to your computer in case the script doesn't fit your hardware properly. If that happens, grab another mouse or keyboard, go to the Device Manager and enable all Human Interface Devices;
  3. The mouse may stop working for one or two seconds when the script is being executed, but that's normal.
References

  1. F.E.A.R. - Logitech/FPS fix
  2. F.E.A.R - Low FPS + random freezes
  3. F.E.A.R. - FPS / Logitech fix
  4. FEAR Horrible FPS Issue
  5. G5/G7/G15 + FEAR ! Solved ! (F.E.A.R.)