Removing Heartbeats from Sniper Elite v2

I finally got around to playing Sniper Elite v2 after buying it a while back and then finding out it required Windows 7.  Serpent 4 fixed that, of course.  And it’s pretty damn fun.  The multiplayer takes me back to the days of Delta Force sniper wars circa 2000.

Sniper Elite v2

Sniper Elite v2

The main problem I had with the game was the annoying—perhaps even disturbing—heartbeat sounds that play whenever you’re looking through the scope.  It really serves no gameplay purpose considering the sound just plays constantly.  And there’s naturally no way to turn the sound off through options or config tweaking.  So one must turn to modding, and that’s what I did.

A quick perusal of the installation directory for the game reveals a “Sounds” directory with three files in it, clearly archives given their size.  StreamingSounds.asr is probably music and GmSnd.en is probably speech, so that just leaves GmSnd.asr as the likely archive for the heartbeat sounds.  Opening the file in a hex editor shows no readable strings whatsoever except for the header of “AsuraZlb”.  The “Zlb” part is curious enough and could mean that the file is actually compressed using Zlib.  In fact that’s exactly what it means.

In order to do anything with this file, it first needs to be decompressed.  Googling around, I quickly found a nifty tool called offzip that can do exactly this.  It’s a command-line program, so extracting it into the Sniper Elite “Sounds” directory is the best way to work with it.  This tool has several operations but the one we’re interested in uses the -a switch to decompress any found data.  To do this, fire up a command prompt or batch file and run the following.

offzip -a GmSnd.asr . 0

This gives us a new file of larger size in the same directory.  Taking this new file back into a hex editor shows a lot of readable strings and many matches for “heartbeat”.  One match in particular is very interesting.  It has the path of a wav file heartbeat01.wav followed by a RIFF header.  Somewhere in this vicinity of the file is the start of the heartbeat sound’s waveform data.

If you decode the bytes out as I did in the screenshot below, you eventually get to a string of text that reads simply “data” and is followed by a 4-byte (32-bit) integer that is the size of the waveform data—in this case, 45920.  Immediately following that, you just pace out the 45920 bytes of data, which should end just before a “smpl” header, and you have the entirety of the sound data selected.

Modded Heartbeat Sound in GmSnd.asr

Modded Heartbeat Sound in GmSnd.asr

The thing about WAV files is that they’re uncompressed (or lightly compressed in the case of ADPCM).  So two bytes (16-bits) of zeros in the waveform data means silence for one sample in the 44100 samples per second of audio.  Using this knowledge, we can just change all the samples to zero to make the whole sound file only silence.  To do this, you’ll need to be using a hex editor that has a fill with zeros feature.

With that part done, we can now save and test our modded archive file.  Don’t forget to rename this modded file to the original filename of GmSnd.asr and backup the original file itself.  You may also be wondering why we haven’t tried to recompress the modded file with zlib; and this would be an astute observation.  Basically we’re hoping the game is smart enough to load both compressed and decompressed data.

Now with Sniper Elite loaded up, we can start a new game and then look through the scope of a rifle to test our mod.  You’ll notice that the heartbeat sound still plays but it pauses every four beats.  Apparently there is more than one sound file that makes up the heartbeat sound effect, but we’re on the right track since one of them is now silent.  We just have to go back into the hex editor and change the four more sounds that follow the one we’ve already done.

And that’s it.  No more listening to that droning heartbeat sound while you’re sniping.  Luckily, this mod doesn’t lock us out of multiplayer either.  Happy sniping!

UPDATE 9/9/13

It’s been said around the webs that merely changing the name of the sound files is enough to disable them.  This would make zeroing out the sound data unnecessary.  However, I have not tested this method.  And one still needs to decompress the archive as detailed above.

Posted in Gaming, Modding | Tagged , | 6 Comments

New Cursor Lock Live

Cursor Lock 2.6 went live yesterday.  Funny enough, I didn’t actually need to change anything but the version number in the lock program itself; that code is proving to be very solid.  But the setup program seems to need constant fiddling since it actually has a GUI.  I’m always trying to make it easier to understand and use.

The biggest change in this version is native support for Windows 7.  I achieved this mostly just by switching to Visual Studio 2008 and compiling for .Net 3.5, but it also needed a small amount of UAC tweaks.  Another major change is to the context-based help system, which used to be in a big, ugly textbox on the side of the window.  Not only was it ugly, but it gave me a limited amount of characters to work with.  In the new version, I’ve switched to a tooltip system that is activated by right-clicking on the feature in question.

And the last big change is something I’ve never done in a program before but became increasingly aware of its need after seeing all the hits and comments on Cursor Lock I get from around the world.  That’s right, it’s localization, or in layman’s terms translations.  I’ve already added a bunch of languages to the installer but have also added support for translations in the setup program.  I’m hoping some native speakers will contribute their translations, but I may do some computer-generated ones if not.  Full changelog below.

  • support for Windows Vista/7 and UAC
  • cleaned up help text
  • added support for translations
  • icons and other UI improvements
  • moved context-based help to tooltips
  • converted project to .Net 3.5
  • logging is now disabled by default
  • updated links
Posted in Programming | Tagged , , | Leave a comment

Cursor Lock 2.6 in the Works

I’ve wanted to do a massive update to Cursor Lock for a while now, but figured I’d scale that back and just fix some lingering bugs for now.  As you can see from the screenshot, I’m also working on better support for Windows 7.  Probably done in a couple weeks.

Cursor Lock 2.6 WIP

Cursor Lock 2.6 WIP

Posted in Programming | Tagged | Leave a comment

Serpent 4

Serpent 4

Serpent 4

About a month ago, I decided that I would upgrade my desktop computer’s core components (CPU, motherboard, and RAM) because Serpent 3 was getting increasingly unstable, and Memtest wasn’t coming to the rescue this time.  At the same time, I figured I should probably “upgrade” my OS to Windows 7 since everything seems to be switching over to it now.  Watch the video below to see the build in action.

So the hardware of Serpent 4 is working out flawless so far, but the operating system is constantly disappointing.  The main trouble early on was that I kept getting the dreaded “display driver stopped responding” system freezes but only when using Firefox.  Googling this gives you infinite solutions, but the one that worked for me was just downgrading the nVidia drivers from 320.18 to 310.70.

In general, there’s too much that’s really annoying about Windows 7 and not enough to actually like.  A few things I do like, though:

  • Libraries are kinda cool, I guess
  • Not being limited to 3.25 GB of memory is very cool
  • Task Manager on steroids–even saves your sorting
  • Pin to Taskbar can be useful
  • WebDAV remote folders work seamlessly
  • Resizing thumbnails in explorer is occasionally helpful

And that’s pretty much it.  As far as things I don’t like in Windows 7, most of them fall into the category of needlessly changing things (e.g. making it more “user-friendly”) such as the entire network connections control panel, not displaying drive free space in the explorer status bar, the lameass search box in explorer, etc.  And the UAC… I really wanted to believe you might be helpful sometime, but after a month of dealing with your bullshit, I couldn’t take it anymore.

But at least I’m getting to play Company of Heroes 2 now, so I guess it’s all worth it.

Posted in Hardware, Software | Tagged , , | Leave a comment

Fixing a Gamepad Cable

Within a couple weeks, I had the misfortune of having two gamepads that I’d had for years both die on me.  One, a Logitech Dual Strike, clearly had its cable split open and one of the wires severed.  The other, a Microsoft Sidewinder Plug & Play, just started crapping out randomly then suddenly died for no apparent reason, but it was well over a decade old.

The cable on the Dual Action split right at where it went into the gamepad itself, so there was no room to strip and then splice the wires together.  And the Sidewinder I had no hope of fixing without a multimeter and some luck.  So given that I knew what was wrong with the Dual Action, I decided to sacrifice the Sidewinder (which I unfortunately liked better) to save the Dual Action by replacing its cable with the one from the Sidewinder.  Plus the Sidewinder’s cable had reinforcement at the base of the cable to keep it from splitting there—would have been nice if Logitech had thought of that.

After I opened up the gamepads, I noticed two things different about their USB cables.  The Sidewinder’s cable connected to the PCB using a crimped wire terminal (you know, the plastic ones with the reconfigurable pinout) whereas the Dual Action’s cable was just soldered to the board.  Also, the wires were in a different order according to their colors.  I decided to take advantage of the terminal on the Sidewinder so I could easily rearrange the wires if I got the pinout wrong.

Sidewinder PCB

Sidewinder PCB

Removing the terminal took forever since I didn’t have a solder sucker.  I found out that copper has the ability to absorb solder, though.  So, I cut open an old AC cable, striped a wire, and used that.  It actually worked pretty well once I got a technique figured out.  Once the solder liquified, I jabbed the tips of the copper cable in there and rubbed it around, making sure to remove the copper before removing the iron (or the copper gets soldered to the PCB, naturally).  Also, I had to hold the copper with pliers as it’s a great conductor of heat.

Removed terminal and copper wick

Removed terminal and copper wick

The rest of the soldering went a lot smoother.  I removed the split cable from the Dual Action, then put the terminal in its place.  I just used the solder that held the wires in place to hold the terminal as well.  Finally, I changed the order of the wires on the USB cable so they’d match up to the order that the Dual Action wires had.  Assuming the USB cable wire colors are standard, it should work (again, I didn’t have a multimeter, so I couldn’t check).

And as the video below shows, it did work.  However, getting the covers back on was a little tricky.  The plug that holds the cable in place as it enters the cover was a little large on the new cable.  But trimming the plug a little with scissors and expanding the opening with an x-acto knife was all it took.  The repaired gamepad made it through two hours of Zelda on Snes9x with no problem.

Posted in Hardware | Tagged , | Leave a comment

10 Years in Video Cards

I was cleaning out my spare computer parts yesterday and realized that I had saved every video card I’d ever owned.  So I thought I’d take some pictures before I chucked them and present a history of video cards.

Pile o’ Video Cards

Diamond Viper II (2000 – 2001)

My first video card ever, I bought this primarily for playing Team Fortress Classic (a Half-Life multiplayer mod) and Unreal Tournament.  And at those two games, it did quite well.  According to Wikipedia, the Viper II had a mere 12 million transistors and a core clock of 125Mhz.  I was surprised to see that it came with composite and S-Video connectors for outputting to TV.  You’ll also notice its lack of a fan.

Geforce 2 Ultra (2001 – 2004)

The Geforce 2 Ultra was twice as powerful as the Viper II at a transistor count of 25 million and a core clock of 250Mhz.  This card helped me battle my way through classic games of the time such as Jedi Knight 2, Dungeon Siege, Deus Ex, Grand Theft Auto 3, and Rise of Nations.  This was the only time I bought a high-end version of a video card.

Later in this card’s life, I put it into a rig I built for my sister, and she of course mistreated it.  Hence the fan on the video card seized up and fell off.

Radeon 9600XT (2004 – 2009)

Weighing in at 76 million transistors and a core clock of 500Mhz, the Radeon 9600XT was an excellent video card that held its own right up until 2008 when Shader Model 3 games started coming out.  During its reign, I was enjoying games such as Half-Life 2, UT 2004, Company of Heroes, TES4: Oblivion, Counter-Strike: Source, and Dungeon Siege 2.  Starting with this video card, I also began using dual-monitors and haven’t looked back since.  I modded my card to add copper heatsinks on the RAM chips and later on replaced the HSF with an all-copper one.

Geforce 7300GT (2009)

This video card was really only a stopgap until I could build a whole new system.  At 177 million transistors and 350Mhz, the 7300GT was one of the last video cards to still support AGP.

Posted in Hardware | Tagged , , , , | Leave a comment