Welcome to ...

tomorrowlands.org

This page describes how to easily hack a Macintosh port of the classic game "Rogue" to stop it from deleting your save files.

I'm certain it will come in handy for the four people who actually play it.

  Home
  Draconity
  Edinburgh
  Stories
  Artwork
  Humor
@ Miscellaneous
  Personal

  Site Map
  Ley Lines
  Forum
 
Skip to Needed files | Instructions | Is it cheating?

Introduction

Ah, Rogue. Thousands of adventure games in which you explore a randomly generated dungeon, picking up magic items and killing monsters, have been written for computers; rogue is the granddaddy of them all. Its simple ASCII-based graphics, arcane controls, and repetitive gameplay have been no deterrent to generations of gamers; even today the genre of "rogue-like games" attracts a dedicated subculture. Perhaps part of its appeal is the sheer difficulty of the genre -- "winning" requires traversing dozens of difficult dungeon levels, discovering which magic items are helpful through (often deadly) trial and error, and overcoming monsters with special abilities that can eviscerate even the most powerful character.

Not to mention that one misstep forces you to start over from the beginning.

"Rogue," like many of its descendants, allows you to save the game only grudgingly -- it allows you to save only so that you don't have to play through at one sitting; forces you to quit whenever you save; and immediately deletes your save-file the next time that you reload. The net result is that you only get one chance at life in a game where basically everything is deadly. It's like the "hardcore" mode of Diablo II, except there's no "normal" mode, and everything's five times as hard.

This handy little hack addresses that, giving you the ability to at least permanently save the game.

 

Why Is This Necessary?

"Okay, so it deletes my save files. Can't I just make a copy of them and reload them later?" you ask.

Actually, no. Rogue is awfully strict about saved games. It stores (among other information) the name of the save file, the date it was created, and the time it was last modified within the file itself. If any of those (or other information) differ from that of the file itself, the save file will fail to work. This means that any copy of the file will automatically fail (different creation time; different name). Any hacked saved file will fail (different modification time, unless you've taken the precaution of hacking that too).

Stopping Rogue from deleting the save file is the easiest way to bypass these barriers; the save file itself won't actually change, so all of the checks will remain valid.

 

You Will Need:

  • A Macintosh. Some free time.
  • A copy of ResEdit, Apple's time-honored "dig-around-in-files-and-poke-at-the-bits" tool. You can download it from C|Net (~500K) or from Apple (3.3M, heaven knows why) if you don't already have a copy.
  • A copy of the strict port for the Mac of "Rogue". There are several different translations; you want the one that can be found in the Info-Mac Archives' Adventure Game directory as "Rogue". Download it here (96K).
    (You do NOT want mac-rogue-30, the graphical version. You do NOT want rogue clone ii. If you try this hack on either of them, you'll most likely destroy the application.)

 

To Work!

Are we ready? Good. Let's start by following the precautions ResEdit gives us: Make a copy of the "Rogue" application that we're going to edit. Never edit originals. If you edit an original and screw something up, you have to scrap it and re-download the file -- because once you save, there's no undo feature.

[We'll just copy this ...]

Let's rename it to something a little more dignified:

[File fiddling]

... That's better. Alright, now we're going to open up ResEdit, and open that copy we've just made:

[... and on to ResEdit]

Double-click on the "CODE" resource. Double-click on the file with ID 1, the one labeled "Source."

[Opening the source code]

ResEdit will open up the hex editing screen:

[The joys of Hex]

"Hex editing" refers to the process of handling the raw data stored on the computer, by the way. "Hex" is short for hexadecimal, or base 16 -- the way the code is displayed in the central column. Here's where you have to be careful, because you're messing around with the instructions the game sends your computer. Stay with me, though, and you'll be fine.

Choose "Find Offset" from the menu --

[and do the Hokey Pokey]

-- and type 004B7A (those 0's are zeroes):

[It gets arcane]

ResEdit will scroll down and highlight the letters "4E". Use the mouse to select not only that, but also the following six letters, so 4E56 FFDE is highlighted:

[The ex-values ...]

... and type 7001 4E75 to replace them. (Those 0's are also zeroes.) The window should look like this:

[... and their replacements]

That's it! Save the file and quit out of ResEdit! You've hacked Rogue!

"Uh, wow! What did I just do?"

You told the game to return from subroutine (4E75) after putting the value 1 (01) into the return register (70). This aborts the process that usually deletes the save file, and fakes the program into thinking the file was deleted successfully. (The code you replaced was the beginning of the process that does the work. The rest of the subroutine is still there, but will never get called.)

 

How To Use This New Toy

  • Start playing Rogue. Save the game. Rogue will quit.
  • Restart Rogue by dragging your save-game file onto the (hacked) application. It will reload the game, attempt to destroy your save file, and conveniently forget to do so. (Don't forget to use the hacked version. Drag the original somewhere out of the way.)
  • If you save your game and quit, Rogue won't record your score (the game isn't over). So if you want to mess around repeatedly with your saved game (for instance, by identifying all of your items one by one with the same identify scroll), make certain to save to a dummy file when quitting and reloading. (Delete the dummy file when you're done.) This will keep you from spamming Rogue's high-score list with half a dozen identical records of where you were when you experimented -- which would cause your friends to point and laugh at you.
  • This hack doesn't stop Rogue from verifying the save file. So don't try to edit the file to give yourself super powers; Rogue won't load it. (I'm trying to help you even the odds here, not destroy the challenge of it.)

 

But Isn't This Cheating?

Possibly.

If it is, it's not a very good cheat, though, is it? It doesn't double your strength, give you Genocide Scrolls, raise your level, restore your HP, identify your magic items (well, OK, it can do that), or start you off at level 26 right next to the Amulet of Yendor. I prefer to think of it as "evening the odds."

Considering that there are people who have played for decades without ever once winning, I don't think a little odds-tweaking is such a sin.

Alternately, here's something to think about: What is the purpose of restricting saved games in the first place? It seems apparent that the function of that is to enhance realism -- to more accurately simulate the way life seems to work by enforcing a "you only live once" paradigm. After all, when real-life spies get shot by real-life counteragents, they don't rewind the clock half an hour, replay those events, and duck to the left instead of the right, thus surviving the previously fatal bullet.

However, putting this paradigm in a game is an enterprise doomed to failure.

The only way to actually enforce this is to make a game that only allows its user to play it once. But that realistically can't be done: A game that uninstalls itself after play can be re-downloaded; a secret file placed on your hard drive can be discovered, or wiped out by a system reinstall; nearly any scheme can be defeated by having someone install the game on multiple computers (buying additional copies if necessary); and even some sort of hypothetical system where every person alive could only buy one copy of the software, and every copy is tracked by (i.e.) social security number, can be defeated by buying someone else's unused copy on the black market, and having them set it up for you.

Even Rogue acknowledges this: The game doesn't end when you die. It just resets you to the start conditions and lets you keep right on playing. If you die on Level 2 of the dungeon, the only effect of not being able to save is to cost the player about 5 minutes. Even a high-level death has no greater incidental cost than the time it takes to get back to where you were: unlike a game of, say, Solitaire, every game of Rogue is theoretically winnable, since it's all generated on the fly, and it's impossible to rule out the possibility that every subsequent random decision will be in the player's favor.

In other words, you will always (eventually, if you simply keep playing) reach a game where luck favors you. You will always, given sufficient time, be able to get back to where you were. Sure, you might reach Level 22 with a +3/+3 Vorpal Longsword instead of a Wand of Lightning, but when it comes right down to it, every Level 22 character looks a lot like every other Level 22 character. The only practical difference that restarting from a saved game instead of from scratch makes is that you save a heck of a lot of time.

Saving time has no game effect; you don't get bonus points for clearing three levels in ten minutes. So what makes reloading a Level 22 character any different from using a program like Rog-O-Matic to automatically play through until it reaches Level 22, then hand control over to you? What makes that any different from hiring 1,000 people to play repeatedly until they can give you a Level 22 character? What makes that any different from sitting down yourself for several months and getting 50 characters to Level 22 before saving the game for later use? Only the time you spend.

I may not be able to claim the moral high ground for hacking Rogue to save me time, but personally, I'd rather have the time than the moral high ground.

Your mileage may vary.

Questions?

Drop me a line!


Up to misc index

TOMORROWLANDS.ORG Home * Contact * Copyright Notice * About Us
Please report errors or broken links to us via the Contact page.
 
Page created Feb 15, 2002. Design (c) 2000 Tad "Baxil" Ramspott.