Wednesday, May 9, 2012

Modifying a Borderlands save (to reset the critical kill achievement)

For the Headshots from the Heart Marathon, one of the technical hurdles that we needed to overcome was "What happens if someone hits 2500 kills?"


See, we're taking pledges determined by the number of critical kills we make. Borderlands keeps track of this for us because there's an achievement to reach 2,500 crit-kills. This presents a few problems:

  1. At 2,500 kills, it no longer displays the current count.
  2. Does it keep counting in the background?
    I had a save with well beyond this number, but that was lost last year when a flood blew up my old computer.
  3. Even if it keeps counting and there was a way to access that from the save file, does it max out at some point?
In the following, I'll cover how we plan to deal with this...

So the other night, Jim and I were sifting through various forums and threads looking for ways of accessing the save file data for our Borderlands characters. There were plenty of solutions if you wanted to change your inventory space or make yourself some uber guns, even apps that would do it all for you... but nothing to really handle achievements. Finally, we came upon this thread and the research of user "mouseypounds."

6c0601 Kills using Shock
6d0601 Kills using Explosives
6e0601 Kills from Critical Hits
b20601 Longest Killing Spree
6f0601 ??UNKNOWN??

Well-well-well... There's the crit-kills we're looking for, but what's that strange code to the left of it? That's called hex. Y'see, there are many different ways to count... 1, 2, 3, IV, V, VI, 111, 1000, 9, A, B, C, and so on... Borderlands stores its data in a Hex format, which is fine and dandy if you've got the rosetta stone to figure out what modification you need to make. So "thank you" to mouseypounds' work on finding the address we were looking for.


The method we're going with, and tested, is to reset the crit-kill counter when we near the max. We'll already be checking this number throughout the marathon to let people know where we're at, so keeping an eye on it isn't a problem. Once we hit, or near the 2,500 max count, that player will hop out of game and modify their safe file, resetting their crit-kill count to 0.

What you'll need:

  • A hex editor like HxD (free) or Hex Workshop. (paid)
  • A decimal to hex calculator, which is built in to newer versions of Windows, or can be found online, like at MathIsFun.
Once you've installed your hex editor (HxD shown below) you'll need to open your saved game... I highly recommend making a backup of the file so you don't lose your character. Your Borderlands saved games are located in "My Documents \ My Games \ Borderlands \ SaveData"

So, above is your saved file...
And below, is your saved file on drugs...

not quite like this...
Don't worry about trying to make sense of all that... you don't need to. Basically, "Offset (h)" is the row number, "00 - 0F" are the data columns storing hex characters in 2's, and on the right side, you can see everything translated from hex to string.

Because data can be inserted in various locations, the crit-kill data won't always be at the same offset. (row) Instead, do a search for "6e0601", making sure to change the datatype to "Hex-values".

So here we are - "6E 06 01" which is basically the Borderlands hex designation for "Kills with Critical Hits".
The four data cells after it are what we're looking at. In the above photo, that's "36 00".

All we're trying to do here is reset the Critical Kill count, so I'm not diving too heavily in to how to reprogram your Borderlands character...

Starting after the 6E0601 block, enter four 0's to reset the counter to 0, then save your work.

That's it, now you're done!

Making Sense of Hex Code

Here's a quick overview to understand Hex a little more, that value of "36" isn't the number of kills... remember, it's hex. To make sense of it, open up your hex converter. (Windows Calculator or MathIsFun)

Change the Calculator View to "Programmer" and make sure you're entering "Hex" values.

Now we enter 36 in to the calculator, then change the left option button back to "Dec". (Decimal)

Notice you can also enter the letters A-F in Hex mode...

In other words, that saved file has 54 Critical Kills.

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1A, 1B, 1C, 1D, 1E, 1F, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 2A, 2B, 2C.... get the picture?


As mentioned above, this information won't always be at the same offset!

Below is a screenshot of two of my saved games... see how the offsets are very different? That's because as you progress through the game and collect more items, they're being inserted in the save file ABOVE where it's keeping track of achievements. That's why you HAVE to search for the 6e0601 designator, rather than just hop to the offset and start changing data all willy-nilly.

Also, if you change the wrong things in here, it's VERY easy to corrupt your save file.

No comments:

Post a Comment