Solving adventures – Save game manipulation

I haven’t worked on the book since the last chapter, so let’s jump ahead a little to the next section that is already finished (section 3.1 according to the current numbering). This is the first section I finished after a brief version of the introduction, and it’s a little more complicated than the ones I previously published here (though it really only scratches the very surface of number crunching). There are two references to the next section of the book (called “section x” here), which is almost finished and will be the next section I publish on these pages.

Save game manipulation

Abstractly speaking, everything in a game is numbers, as numbers make up every computer program. When your character moves around or handles objects, those numbers change. And when you save the game, a part of the numbers is written out. If there is any way you can identify those numbers, you will be able to manipulate them in the save-game file. For example, if there are literal numbers that appear in the game, it’s easy to look for them in the save-game file. This is not as rare a case as it sounds at first: role-playing game character stats might be represented as numerical values, as might be quantities of water, amounts of money, numbers of pebbles or men in an army – and, of course, your score.

Let’s do this, then. Save your game at a certain point, then do something that will make one of the numbers change: for instance, paying an amount of money. Save the game again. Now open the save-game file in a hex editor, and look for your number. Keep in mind that it is a hexadecimal number, while in the game it will most probably be a decimal number; so if you are looking for 111 gold coins, you will have to search for the hexadecimal number 6F (see section x below for a brief introduction to computer numbers if the last sentence made little sense to you). Keep searching until you have found all occurrences of the desired number, and note their respective positions in the file. Go back to your first saved game, open it in your hex editor, and look for the original value of the number (again, in hexadecimal). When you find a place where the position of the original number corresponds to the position of the number in the second saved game, then you have almost certainly found the position where your current amount of money is saved. Now change that number, and load the manipulated game file into your game. Has the amount changed as predicted? Isn’t that great?

You can do that with more abstract numbers as well: try to change only one aspect of the game, e.g. by leaving your current room. Compare the two game files and see how many numbers have changed.

When you look at save-game files in your hex editor, always try to get a broader picture of things: do you notice groups of numbers, sets of repeated numbers, plain-text sections? Sometimes the character’s inventory will be saved in a kind of database where you can actually find the names of the items you’re looking for! Also, many save-game files will have a header that remains unchanged throughout the game, so you can ignore that part – or even use it to change some fundamental truths about the game.

Of course, it doesn’t always work like this. Try it with Infocom’s Beyond Zork for one of the lesser-known game responses. (Here, the trick is that you have to change two sets of numbers for every character stat you want to manipulate. But more on these kinds of things in a moment.)

The key, as always, is to experiment. Many save-game files will be protected against meddling in some way or other, but if you are persistent, you can decode every trick of the trade. Use your initial set of save-game files to find out what exactly has changed in your one move, and then think about what can possibly have changed in addition to the desired number. Does the game remember the number of passed turns or the time? Are there counters for your health, your weariness, your hunger? Maybe other characters move around, and the game keeps track of their whereabouts. Most times, the numbers associated with those actions will mean nothing to you, as they represent some arcane counting system – but that doesn’t mean they are not useful! If you are really desperate, you can write down all differences between the initial save-game file and the second one and study them.

The more you know about number systems and coding methods, the more sense you will be able to make of the data. Some changes might be saved in the form of bitmaps (so that a change of several values from “not set” to “set” will lead to only one changed eight-bit number in the save-game file); the data may be validated by a checksum; the data may be compressed; or it may actually be saved as a text string (so that the above number 111 will be represented as “313131”, namely the hexadecimal values of the ASCII equivalents of the digits “1”, “1”, “1”). Again, if all or part of this sounds like utter gibberish to you, you can find some brief information about computer numbers in section x, “Number and coding systems”.

As was said above, everything else in addition to plain numbers is internally stored as numbers as well. Very useful values to look for (generally by the same method as above) are the current location number, the number of turns or the time that has passed, and the score. If you can manipulate these, you can teleport your character, set back any time limits, or raise your score, respectively. The latter may not sound very helpful at first, but in many adventures, the score is actually used to track how the player is progressing, so that a higher score may open new passages or change the behaviour of other characters. If you are in a very experimental mood, just change any number in your save-game file and see what happens (but don’t be too disappointed if the answer is: nothing obvious, or: it breaks the game). That way, if you persist, you will eventually be able to pinpoint all the values.

Now it’s up to you to try it.

The featured image uses a photo by s j.

Share