The idea behind the batch file is that whenever you reach a point where you would like to preserve your existing character, you can save, exit the game, and the batch file will backup the Save directory to a new directory that the game will not modify. If you later get killed, then the batch file can copy this backup directory over to the Save directory, and you can resume from that point.
Hardcore crawlers refer to this practice as "save scumming," and prudes disapprove, which is weird, considering it's just a game. I find the angry reactions aroused by the idea of so-called "cheating" to be peculiar and amusing. All around the Internet and even in comments on my own blog, one can find Dungeon Crawlers scolding other players about this. It is like some kind of religious injunction. I pay it as much mind as I do other religious injunctions.
Here's my handy-dandy script (batch) file for cheating at Dungeon Crawl. At a minimum, it is compatible with either Linux or Windows, both of which I use.
Although I developed the Windows batch for Windows XP, it now supports Windows 10, which is what I use. I can no longer certify Windows XP or 7 support, since I no longer use XP or 7, and you should not use these outdated systems, either. Time to move on, chilluns. If you do not like Windows 10, that is certainly O.K., move over to the wonderful world of Linux, but do not stay with an antiquated security hole of an operating system. However, I suspect that the few remaining stubborn holdouts still risking their sanity with Windows XP or 7 could get the batch working without too much difficulty. I used to play Crawl on Windows XP, back when I had an XP system. I know for sure that the batch file then ran perfectly on XP back then. But you know, I have made changes since.
I've tried to distill as much intelligence as I can into the batch. I do not use the Installer, but the batch will adjust its pathnames automatically upon successful detection of an Installer-created Dungeon Crawl Stone Soup installation. If you encounter any problems, it will more than likely have to do with the pathnames used by your version of Windows or else unsupported batch commands. There is help widely available on the Internet for programming in batch, but I will attempt to help anyone that has a problem that is likely to be shared among many users. I enjoy programming in batch language, because it does not require a cumbersome and slow compiler, but concede that the language is quite limited both in capability and debugging options. I have my own ways of debugging that work for me although they are quite challenging, but the challenge is part of the fun for me. Even with good technique, often it takes guesswork and plenty of knowledge to deduce what is going on. So if you get into batch programming, first of all don't get into batch programming--but if you do, then prepare to search Google on a regular basis for tips, tricks and syntax, because Microsoft Help is not always quite as helpful as it could be. I have been banned by Google from searching in the past due to the frequency of my requests. Google interpreted my behavior as being similar to that of a bot. But that is how I learned how to program in Linux script and Windows batch.
I have been using some variation of this batch file for years to play Dungeon Crawl. Happy Crawling!
- This batch file, and any page on Igor's blog, is not static but is subject to change--improvement--at any time. You may link to this page on other web sites and be assured of referencing the very latest version of regen.bat for Windows and regen.sh for Linux at all times now and in the future.
- To use this strategy effectively, you should save your game and quit at a point where you may wish to recover your character later upon any unexpected demise.
- I play the latest version of Crawl, either the trunk (beta) or the last stable release. You have a better chance of the script/batch file working correctly if this is also your scenario. Through the years, the Stone Soup developers have altered the path and file names of the saves directory. However, the script/batch is designed in such a way that modifications are elementary, consisting of one or two edits of constants at the most.
- On my Linux computer, I have created a new directory in Home called games and placed the linux shell script (regen.sh) and its icon in there. I believe it is important for the name of the directory to have no spaces. One must either chmod the two relevant crawl directories in order to permit file copies and deletions or else grant root permissions for this script, because otherwise Linux denies permission to the many file copies. I'm not well-versed on this sort of thing. I used to give my launcher root permissions via "sudo ~/regen.sh", but my current method is to chmod the two crawl directories, because that eliminates the need to enter the root password every time one plays.
- On a Windows computer, regen.bat attempts to self-adjust its assumptions regarding paths--it has some primitive intelligence, not much--but if that doesn't work, regen.bat will tell you so, and at that point you will have to edit the variables relating to pathnames. By design, few pathnames are hardcoded, meaning the batch should be relatively easy to modify.
- Linux has a built-in capability of accepting a single keypress for input and overall a far more robust scripting language than Windows. Batch programming in Windows, however, remains in the Stone Age. It is a wonder I ever programmed the Windows batch at all. For Windows users, as of 05/19/2019, I have finally found the syntax to accept single keypress and no longer use a third-party utility to achieve the same effect. Thus, this cheat is transparent with plain text source code, and no one should feel as though there is anything deceptive about it, although there is no doubt as to its being elaborate. Perhaps more than five minutes would be required to understand how the batch works, but not more than thirty minutes, for an experienced batch programmer.
- 05/19/2019 Update:
Change to regen.bat only: modification to work with my Windows 10 system and allow single-keypress responses, i.e. not having to press the Enter key. Users are expected to modify one line in the batch specifying where the game is installed.
- 06/15/2014 Update:
Change to regen.sh: fix for multi-desktop users like myself. No longer will crawl span both desktops.
- 11/28/2013 Update:
Change to regen.sh: sleep a second after wmctrl, because the computer takes a random number of milliseconds to adjust the display. Clarify a display message.
- 11/27/2013 Update:
Change to regen.sh: fix a few bugs. Maximize window if wmctrl is available.
- 10/18/2013 Update:
Change to regen.sh: corrections to the menu display and new optional mods to automate setting tiles to full screen and other preferences of mine. The script now reflects a change in version 13 of the location of the macro file.
- 9/16/2013 Update:
Change to regen.sh: Recognize the existence of Sprint and Zotdef saves and tidy up the code a little bit.
- 1/31/2013 Update:
Change to regen.sh: Handle the case where Crawl has not yet been installed or executed.
- 1/29/2013 Update:
Just a few minor refinements to text messages in regen.sh and the addition of a loop to handle permission-granting, in case the user types an incorrect password.
- 1/21/2013 Update:
Once again, Linux refinements only. regen.sh was not handling chmod quite right; chmod -R is more to the point as it liberalizes permissions for all the files and folders within the two relevant Crawl directories. I made a few other changes of no special importance. It is my intention that regen.sh should handle DCSS upgrades seamlessly, asking for permission to chmod when necessary.
- 1/19/2013 Update:
Further refinements to the Linux script, which is now coming into its own, looking better and acting smarter. Rather than have sudo ask me for my password everytime I play (ach!), I prefer to chmod 777 the permissions of two crawl directories, which is Linuxese for "allowing read/write access to everyone".
- 1/16/2013 Update:
Added a few minor refinements to the Linux script that occurred to me this evening, including a suggestion for avoiding the annoyance of sudo.
- 1/16/2013 Update:
Many improvements made and features added to the Linux script. It is somewhat more intelligent now and will attempt to detect and report certain problems before they occur.
- 1/14/2013 Update:
I have successfully ported regen.bat to Linux! Many improvements made between Jan. 13 & Jan.14th to the Linux script, which does however require root permission in order to shift files around. Through trial and error, I have found that sudo is the thing, not kdesudo, which is for graphical programs. Kdesudo will cause errors. There is no way I know of getting around the permission requirement other than disabling the security altogether on one's system. I'm not quite confident enough to second-guess the Linux developers on that score. I'd rather just play along according to their rules.
- 11/13/2012 Update:
Minor edits for compatibility with Crawl 12 beta.
- 10/17/2012 Update:
Colorized the text, added for the first time a free public domain icon, reorganized the main menu, and fixed several bugs throughout the mods menu.
Fixed a little bug that had broken the 'edit batch file' option. Oopsy-daisy. Added a little colorizing trick that had occurred to me.
Improved the efficiency of the Install-New-Crawl option. Fixed the broken macro mod. Added polychromatic effect to mod menu.
Fixed a little issue with install-new-crawl. So many variables now, and of course batch language won't help me in keeping track of them.
- 10/08/2012 Update:
Add option to install new version of Crawl using 7-Zip or WinRar. This will install the game into a directory that is the default for regen.bat and thus ensure 100% compatibility. Several bug fixes to the Mods menu. Added 'command enhancement' mod.
- 09/30/2012 Update:
Just a few minor tweaks to improve efficiency. Improved start-up performance by skipping an unnecessary FIND. Eliminated a few redundancies through the use of subroutines. Reworded some comment statements. Everything working well on Windows XP with the latest beta version .11.