Far Cry 2

Far Cry 2

Not enough ratings
Creeping with keyboard & mouse
By Hara and 1 collaborators
Gives you control over your movement speed, by implementing a system just like seen in Splinter Cell: Chaos Theory. This matters a lot for the stealth mechanics in Far Cry 2. WARNING: This is a big workaround for a poor PC port.
   
Award
Favorite
Favorited
Unfavorite
What, and why
Why?
So the game has a pretty delicate stealth system. The faster your character moves, the further away enemies will hear and see you. So if you move really slow, you'll be able to get a lot closer.
This function is lost when played with keyboard and mouse, because when you press W for forward, you'll immediately move at 100% speed. It's a different kind of poor PC porting.

What does it do? (in practice)
Your scroll wheel now works as a speed adjuster. A few scrolls down will incrementally slow down your movement (down to a minimum, never putting you at a full stop), and a few scrolls up again will put you back up to full speed. Hitting the sprint key (leftshift) resets the modifier to full speed.
People familiar with how Splinter Cell: Chaos Theory played on PC will be instantly familiar and comfortable with it.
Note that it has a sideeffect of also controlling how much you turn the wheel in vehicles. A bonus really if you ask me, as you can do less jerky control. Scroll up or hit left shift and it'll act like normal.

Tools & explanation
I'll try to make installation as simple as possible, but here's what's being used to enable this workaround:
  • vJoy - a virtual joystick, that can be controlled by other programs.
  • FreePIE - the program we'll be using to control vJoy, through script.
  • x360ce - Xbox360 Controller Emulator. Masks any joystick to appear as a Xbox360 gamepad. In this case the vJoy joystick.
  • Gibbed mod tools for Dunia Engine - For editing patch.dat/.fat

    So we're gonna make Far Cry 2 think we're using an Xbox360 gamepad. To do this we disguise a virtual joystick as one. We control the virtual joystick with the keyboard. And with some scripting, can suddenly control how fast or slow we want to move, simply by scrolling up or down. This matters a lot for the stealth in the game.
    Finally we need to remove some hardcoded bindings in the game that would otherwise interfere with the function of this script. This is done through the patch.dat/.fat files.
- QUICK INSTALLATION -
  • Install --> vJoy[sourceforge.net] - Version 2.1.8.38-190417 at the time of writing.
  • Install -->FreePIE[github.com] - Version 1.10.666 at the time of writing.
  • Download -->These files I've packed[1drv.ms] -containing: modified vanilla* patch.dat/.fat, and x360ce files.

    Create backups of patch.dat/.fat located in the Data_Win32 folder.
    Unpack the zip file to the Far Cry 2 root folder**.

    Open FreePIE, open the script now located in the Far Cry 2 root folder, run the script with F5, and launch Far Cry 2 through Steam.

    In the in-game options, unbind/rebind controls for:
    On foot:
    Forwards, Backwards, Strafe left, Strafe right


    *I took the liberty to remove the mouse speed clamp[pcgamingwiki.com], as most today will want that.
    ** ..\steamapps\common\Far Cry 2\
-- Advanced installation below --
For people who want to know exactly what's being done.
1. Install vJoy (virtual Joystick)
Install --> vJoy[sourceforge.net] - Version 2.1.8.38-190417 at the time of writing.
2. x360 Controller Emulator
You'll need x360ce*, they've switched to a GUI version that generates a .dll and .ini file, rather than in the old days where they just gave you the .dll wrapper, and .ini file to mess with.
I'm not going to write a guide on how to set up the GUI version as there's a lot to cover to make sure it goes right, compared to just copying my .ini setup for it:

[Options] UseInitBeep=1 Log=0 Console=0 DebugMode=0 InternetDatabaseUrl=http://www.x360ce.com/webservices/x360ce.asmx InternetFeatures=1 InternetAutoload=1 AllowOnlyOneCopy=1 ProgramScanLocations=C:\Program Files,C:\Program Files (x86) Version=2 CombineEnabled=0 Supplemental=0 [InputHook] HookMode=1 [Mappings] PAD1=IG_5772f84064ff11e78002444553540000 PAD2= PAD3= PAD4= [PAD1] [PAD2] [PAD3] [PAD4] [IG_5772f84064ff11e78002444553540000] Left Analog X=1 ProductName=vJoy Device ProductGuid=bead1234-0000-0000-0000-504944564944 InstanceGuid=5772f840-64ff-11e7-8002-444553540000 AxisToDPadDeadZone=256 AxisToDPad=0 AxisToDPadOffset=0 A= B= GuideButton= Back= Start= X= Y= D-pad POV= D-pad Down= D-pad Left= D-pad Right= D-pad Up= UseForceFeedback=0 ForcePercent=100 SwapMotor=0 FFBType=0 ControllerType=1 LeftMotorPeriod=120 LeftMotorStrength=0 LeftMotorDirection=0 Left Shoulder= Left Analog X AntiDeadZone=0 Left Analog Y AntiDeadZone=0 Left Analog X Linear=0 Left Analog Y Linear=0 Left Analog Y=-2 Left Thumb=0 Left Analog X DeadZone=0 Left Analog Y DeadZone=0 Left Analog Y- Button=0 Left Analog X- Button=0 Left Analog X+ Button=0 Left Analog Y+ Button=0 Left Trigger= Left Trigger DeadZone=0 PassThrough=0 RightMotorPeriod=60 RightMotorStrength=0 RightMotorDirection=0 Right Shoulder= Right Analog X AntiDeadZone=0 Right Analog Y AntiDeadZone=0 Right Analog X Linear=0 Right Analog Y Linear=0 Right Analog X= Right Analog Y= Right Thumb=0 Right Analog X DeadZone=0 Right Analog Y DeadZone=0 Right Analog Y- Button=0 Right Analog X- Button=0 Right Analog X+ Button=0 Right Analog Y+ Button=0 Right Trigger= Right Trigger DeadZone=0 A DeadZone=0 B DeadZone=0 Back DeadZone=0 Start DeadZone=0 X DeadZone=0 Y DeadZone=0 Left Thumb DeadZone=0 Right Thumb DeadZone=0 Left Shoulder DeadZone=0 Right Shoulder DeadZone=0 AxisToDPadDownDeadZone=0 AxisToDPadLeftDeadZone=0 AxisToDPadRightDeadZone=0 AxisToDPadUpDeadZone=0 ForcesPassThrough=0 PassThroughIndex=0 Combined=0 CombinedIndex=0
save as x360ce.ini
Place together with xinput1_3.dll in the bin folder of Far Cry 2, this will trick the game to thinking your vJoy is an xbox360 gamepad**. And assign the vJoy axis to the right x360 axis.

*x360ce[github.com]
**as long as vJoy is the only joystick connected
3. FreePIE and script
Install --> FreePIE[github.com] - Version 1.10.666 at the time of writing.

Open FreePIE, copy paste in the empty text window:

#v0.1 if starting: multiplier = 1 increment = 0.1 footMode = True waitForKeyUp = False if mouse.wheel > 0 and multiplier <= 1: multiplier += increment if mouse.wheel < 0 and multiplier > 0.6: multiplier -= increment if mouse.middleButton == True and waitForKeyUp == False: footMode = not footMode waitForKeyUp = True if mouse.middleButton == False: waitForKeyUp = False if keyboard.getKeyDown(Key.LeftShift): multiplier = 1 if footMode: vJoy[0].z = 0 if keyboard.getKeyDown(Key.W): vJoy[0].y = -vJoy[0].axisMax*multiplier elif keyboard.getKeyDown(Key.S): vJoy[0].y = vJoy[0].axisMax*multiplier else: vJoy[0].y = 0 if keyboard.getKeyDown(Key.A): vJoy[0].x = -vJoy[0].axisMax*multiplier elif keyboard.getKeyDown(Key.D): vJoy[0].x = vJoy[0].axisMax*multiplier else: vJoy[0].x = 0
Remember to save the script.
4. Removing hardcoded action bindings
Get the Far Cry 2 mod tools WobFC2Dunia

Unpack the WobFC2Dunia folder into .\Far Cry 2\

Run bootstrap.bat in .\Far Cry 2\WobFC2Dunia to unpack and decrypt a bunch of the game's files.

Go to .\Far Cry 2\WobFC2Dunia\original\patch\config\" and open inputactionmapcommon.xml. At line 116 you'll see the hardcoded binding for cycling between weapons using the mouse scroll wheel.

Comment them out so it goes from this
<Binding input="mouse:wheel" action="update" signal="cycleweapon"/>
to
<!-- Binding input="mouse:wheel" action="update" signal="cycleweapon"/ -->

go back to .\Far Cry 2\WobFC2Dunia\", and run build_patch.bat to generate a new patch.dat and patch.fat alongside the bat files.
Backup the original patch.dat and patch.fat in .\Far Cry 2\Data_Win32\ and move the generated files there. Bindings are now removed.

EXTRA
I've recently figured out how to rebind the vehicle accelerate and reverse controls from the xbox triggers, to the left thumb Y axis. This isn't going to be too useful with the script in it's current form, as you're creating an undynamic relationship between the speed and steering. But I'm putting this info out there.

In the same xml, inputactionmapcommon, change this section:
<!--Gamepad--> <CompoundInput name="accelerator" device="pad"> <Input input="right_trigger" axis="0" invert="0"/> </CompoundInput> <CompoundInput name="reverse" device="pad"> <Input input="left_trigger" axis="0" invert="1"/> </CompoundInput>
to
<!--Gamepad--> <CompoundInput name="accelerator" device="pad"> <Input input="left_thumb_updown" axis="0" invert="0"/> </CompoundInput> <CompoundInput name="reverse" device="pad"> <Input input="left_thumb_updown" axis="1" invert="0"/> </CompoundInput>
5. Unbinding/Rebinding in-game binds
The last thing to do is to unbind the following controls in the in-game options:

On foot:
Forwards, Backwards, Strafe left, Strafe right
In vehicle
Turn left, Turn right

You should now be set to start experiencing Far Cry 2's true stealth system.
20 Comments
Hara  [author] Apr 13, 2022 @ 9:45am 
It's been a year since I've messed with FC2 modding. Maybe the tools have changed. But all you need to do is create a new patch.fat/dat where you've modified the actionmaps inside it.
Mackintoke Apr 12, 2022 @ 8:09pm 
PLEASE HELP ME HARA! I'VE RUN OUT OF IDEAS! There's no original\patch\config\ folders to be had inside \Far Cry 2\WobFC2Dunia.
Mackintoke Apr 9, 2022 @ 2:56pm 
OK so I unpacked all the WOB files and folders into Far Cry 2 directory and then run bootstrap and it seems to function properly. But there's no original\patch\config\ folders to be had inside \Far Cry 2\WobFC2Dunia. They're not being generated.
Hara  [author] Apr 6, 2022 @ 1:57am 
No, I'm pretty sure Redux also uses patch.dat/fat . But if you install redux, and then manually do step 4 of the advanced installation, it'll work.
Mackintoke Apr 5, 2022 @ 4:46pm 
Is this compatible with the Redux mod?
Mackintoke Apr 5, 2022 @ 4:15pm 
Got em, thanks. It was my profile on OneDrive. It was frozen.
Hara  [author] Apr 3, 2022 @ 3:22pm 
@Makintoke They're still up. Unless the permissions expired somehow.
Mackintoke Apr 3, 2022 @ 1:54pm 
@Hara Are your files on OneDrive still available?
Hara  [author] Aug 3, 2021 @ 12:42am 
@latbat58 I'm convinced it isn't. The slower you can move, the slower their invisible detection meters fill up. But it's an aid to stealth, not a prerequisite.
latbat58 Aug 1, 2021 @ 10:55am 
do you really need this? isnt crouching the most stealthy way to move?