Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: Before you play DF, use protection. Take no chances.  (Read 1592 times)

Keiseth

  • Bay Watcher
    • View Profile
Before you play DF, use protection. Take no chances.
« on: June 08, 2007, 03:59:00 pm »

Inflate Error -3? Power outage while saving? Class 5 Hurricane? Take NO chances! Although, it is possible I've gone a tad overboard...
http://img240.imageshack.us/img240/2546/nochancesml4.png

I've mentioned the format before, but it's pretty simple:

Region - Date - Dwarf/Adventure Mode. The last number is if I go really overboard and back up several times a day. XD

The bottom of course is a fresh untouched version of my world right after generation. It'll be handy as my world has some bizarre features, such as a large portion of the map that is entirely surrounded by mountains, inaccesible, but you can build a fort there; and still have contact with dwarves!

That and it's just a snazzy world besides. Athira Etha, "The Planes of Prophecy" =)

Anyone else back up their world excessively, as well? I'm going to miss it when the next version of DF is released, but it'll be worth it!

Logged

Fleeb

  • Bay Watcher
  • The Fleebiest
    • View Profile
Re: Before you play DF, use protection. Take no chances.
« Reply #1 on: June 08, 2007, 05:01:00 pm »

I am now, after getting shafted by the inflate -3 bug with my bestest most perfectest fortress ever.
Logged
"If you push something hard enough, it will fall over" -Fudds First Law of Opposition
"If it goes in, it must come out" -Teslicles Deviant to Fudds Law

Veroule

  • Bay Watcher
    • View Profile
Re: Before you play DF, use protection. Take no chances.
« Reply #2 on: June 08, 2007, 05:08:00 pm »

I tend to save and back up about every hour.  I don't always keep all the hourly saves, but I generally have a series of saves with a number and short description of what was going on.  I like being a god, able to roll back time when it suits me.
Logged
"Please, spare us additional torture; and just euthanise yourselves."
Delivered by Tim Curry of Clue as a parody of the lead ass from American Idol in the show Psych.

slMagnvox

  • Bay Watcher
  • Attend Party
    • View Profile
Re: Before you play DF, use protection. Take no chances.
« Reply #3 on: June 08, 2007, 06:24:00 pm »

An autosave util would be pretty sweet.  I haven't been backing up my games at all and now, after this scare-campaign, this creaky laptop is starting to worry me.

Who are our resident Util designers?

Logged

Keiseth

  • Bay Watcher
    • View Profile
Re: Before you play DF, use protection. Take no chances.
« Reply #4 on: June 08, 2007, 07:36:00 pm »

An autosave utility would be pretty tricky to implement, I think... especially if it saved at a really poor moment. Still, it would be handy.
Logged

nornagon

  • Bay Watcher
    • View Profile
    • nornagon.net
Re: Before you play DF, use protection. Take no chances.
« Reply #5 on: June 08, 2007, 07:44:00 pm »

That would be a pain, saving takes kind of a long time. Autosaving in the middle of your complicated mining operation would be annoying, to say the least.
Logged

herrbdog

  • Bay Watcher
    • View Profile
Re: Before you play DF, use protection. Take no chances.
« Reply #6 on: June 08, 2007, 09:07:00 pm »

I would prefer an annoying autosave to a '-3' anyday. I've lost a few forts and I am not quite as intensive but I save:

-world start
-current backup (becomes "last backup")
-last backup

each with a screenshot of current state, err map dump.

Logged

Shadowlord

  • Bay Watcher
    • View Profile
Re: Before you play DF, use protection. Take no chances.
« Reply #7 on: June 08, 2007, 10:02:00 pm »

I did make a utility that backs up any and all DF saves I make, if I leave it running - it repeatedly (and far more frequently than I save) checks the timestamp on all the .sav files, and compares them to the last timestamp it saved for that world. If it's newer, it waits 60 seconds and then makes a copy of that .sav and everything in its region folder.

To be honest, I'm not sure how useful it is, since I've only ever had one world crash and get a load error, and it was one in which my adventurer had just died moments before. I haven't even bothered to run the auto-backup program recently, but if I had, then I wouldn't have lost my best fort to an accidental overwrite a while back, so hmm.

Pros:
You don't have to remember to back up your saved games,
It labels the backup folders ("backup region1 from 2007 - Month 04 (Apr) - Day 21 - 14h 40m 13s" - that folder contains region1.sav and the region1 folder)

Cons:
It doesn't compress the backups,
You'd still have to save normally,
If your saved game takes more than 60 seconds to save, it might try to backup files while DF is still writing stuff,
It sits there checking all your saved games every 30 seconds (it could probably get away with checking once every 10 minutes instead, assuming you don't close it immediately after closing DF),
It's written in c++, it would need a good amount of changes to be portable to *nix, and I can only compile and test it on windows anyways,
You have to remember to actually start the auto-backup program for it to actually work :P

(If I released it, I would include the source code (probably GPL'd) so that anyone can modify it or change it to auto-back up anything else.)

It's a far cry from an autosave, but I don't think an autosave in DF is very feasible, considering it takes several seconds to save, and then pauses for several more seconds to clear memory and then reload (although if toady implemented autosave himself, it wouldn't need to clear or reload anything).

Well, if anyone's interested, I'll zip it up and upload it. If not, it won't bother me much. :P

[ June 08, 2007: Message edited by: Shadowlord ]

Logged
<Dakkan> There are human laws, and then there are laws of physics. I don't bike in the city because of the second.
Dwarf Fortress Map Archive

nornagon

  • Bay Watcher
    • View Profile
    • nornagon.net
Re: Before you play DF, use protection. Take no chances.
« Reply #8 on: June 08, 2007, 10:34:00 pm »

The only reasons you should ever lose saves are disk corruption, power loss or meddling (by you or some other program.) I reckon DF should support more than a single save file. That way we don't ever have to stick our fingers in the proverbial pie. An autosaver would be good for the paranoid among us, and compression of old saves could help with disk bloat.
Logged

Keiseth

  • Bay Watcher
    • View Profile
Re: Before you play DF, use protection. Take no chances.
« Reply #9 on: June 09, 2007, 02:20:00 am »

Some people appear to get Inflate Errors for no apparent reason whatsoever; and it's too late to try to fix the bug I understand, as the new version will be so radically different that it will be either gone or re-discovered. I think.

A good rule to play by is that when you accomplish something rather interesting (or a long boring amount of time passes), backup so you don't have to fumble through it again. Of course, when you're getting sieged constantly, death itself is crawling out of the abyss at you and magma men storm down your halls, it's probably difficult to remember something like saving!

Logged

Peristarkawan

  • Bay Watcher
    • View Profile
Re: Before you play DF, use protection. Take no chances.
« Reply #10 on: June 11, 2007, 03:48:00 pm »

quote:
Originally posted by Shadowlord:
<STRONG>It's written in c++, it would need a good amount of changes to be portable to *nix, and I can only compile and test it on windows anyways,</STRONG>

Eww.  This kind of thing is what shell scripts and cron jobs were made for.  Much more cross-platform, and would only take a couple minutes to write.  Also solves the problem of needing to remember to start it, and trivializes the task of compression to the point of just running a couple of extra commands.

[ June 11, 2007: Message edited by: Peristarkawan ]

Logged

Peristarkawan

  • Bay Watcher
    • View Profile
Re: Before you play DF, use protection. Take no chances.
« Reply #11 on: June 11, 2007, 03:49:00 pm »

quote:
Originally posted by Keiseth:
<STRONG>Some people appear to get Inflate Errors for no apparent reason whatsoever; and it's too late to try to fix the bug I understand, as the new version will be so radically different that it will be either gone or re-discovered. I think.</STRONG>

One of the tasks on Toady's list is an update of the zlib code, so hopefully the former.

Logged

Shadowlord

  • Bay Watcher
    • View Profile
Re: Before you play DF, use protection. Take no chances.
« Reply #12 on: June 22, 2007, 10:37:00 pm »

quote:
Originally posted by Peristarkawan:
<STRONG>

Eww.  This kind of thing is what shell scripts and cron jobs were made for.  Much more cross-platform, and would only take a couple minutes to write.  Also solves the problem of needing to remember to start it, and trivializes the task of compression to the point of just running a couple of extra commands.

[ June 11, 2007: Message edited by: Peristarkawan ]</STRONG>


You forgot to include the time it would take (if I were doing it) to install linux and/or cygwin, figure out how to start cron or find out if it's already started, figure out how to make cron work, remember how to make cron run something periodically, learn to write shell scripts, attempt to write such a shell script, and then test it. So that's basically why I didn't do that.

I could also have made it in python, but I chose c++ for some reason instead. I had done a backup script in python before, but not an automatic periodic-checking one.

The only reasons it isn't easily portable* are: (a) I stopped using linux 4 years ago, (b) cygwin has annoyed me into uninstalling it several times, and (c) I mostly made it for my own use, so I didn't bother looking up the linux alternative to the functions I was using.

* By virtue of being fairly small, it probably IS easily portable, but it may well be easier to just write one from scratch for linux instead.

Functions it uses (I don't know how many of these are windows-only. Perhaps all of them.):
FileTimeToSystemTime, MessageBox (for errors), SetCurrentDirectory, Sleep, CreateFile, GetFileTime, CloseHandle, CreateDirectory, CopyFile, FindFirstFile, CopyFile, FindNextFile, FindClose, and GetLastError.

Here is the binary and source, if anyone wants it, or feel free to make your own with shell scripts and cron jobs, or python, or whatever, of course. :P http://shadowlord13.googlepages.com/backupDFSave_v1.0.7z

(Personally, I only use windows XP. I've used DOS 5, 6, windows 3.1, windows 95, 98, ME, 2000, XP, and from time to time RedHat linux (before they had whatever they call their consumer-ish version), Mandrake linux (before mandriva existed), and Gentoo linux (with blackbox and reiserfs for a filesystem). I liked Gentoo the best out of all the linuxes I tried**. However, I tried XP after Gentoo, and to be honest, I rather liked XP better than any linux I had tried. Plus vastly more games worked on XP than on linux. I hear that has probably improved since then, but then I've also heard that new WINE versions have broken games which used to work too, so I think I'll stick with what works reliably (XP + vdmsound + DOSBox when necessary).

** It was the only one that didn't randomly crash and/or eat files on the HD, but that may have been due to the filesystem. I dunno. It got pretty frustrating having Mandrake hard crash every couple hours, deleting some files that were in-use every time it did that, and having it lock up the computer whenever it tried to reboot. (I tried Gentoo after Mandrake deleted files that were critical for X to work - twice)

XP has basically been far more reliable than any of the linuxes I tried. Gentoo wasn't crashing, but it eventually b0rked itself so badly that even repartitioning and reinstalling from the beginning didn't make it bootable - of course this was due to me trying something that should have been impossible: Logging in while the computer was shutting down... I wanted to cancel the shutdown, and couldn't very well enter commands while logged out. So I attempted to log back in! It sort of worked, and then Linux went insane. :P

[ June 22, 2007: Message edited by: Shadowlord ]

Logged
<Dakkan> There are human laws, and then there are laws of physics. I don't bike in the city because of the second.
Dwarf Fortress Map Archive

Keiseth

  • Bay Watcher
    • View Profile
Re: Before you play DF, use protection. Take no chances.
« Reply #13 on: June 24, 2007, 01:44:00 am »

Thanks for the program!

I've been using Ubuntu Linux myself. First Linux flavor I've actually tried and I'm quite happy with it. Ironically it's been more reliable then XP lately; I reformatted and set up a dual-boot with XP. Ubuntu figured out how to use my ethernet card and set up my internet connection silently, but it took me three days to track down the compatible drivers for XP. I have no idea what happened to the originals and they weren't online anywhere. =)

Of course, My only complaint is the lack of games available. There ARE some good ones, like Wesnoth, but my personal favorite game doesn't have a linux variant because it isn't open-sourced; Cave Story.

Logged

Jifodus

  • Bay Watcher
  • Resident Lurker
    • View Profile
    • Dwarf Fortress Projects
Re: Before you play DF, use protection. Take no chances.
« Reply #14 on: June 25, 2007, 12:39:00 am »

I've ported Shadowlord's code so it is theoretically compilable and usable under any of the nixes. It is available here: http://www.geocities.com/jifodus/backupDFSave_v1.0_portable.zip

Note: It's only the source code, it doesn't include binaries. Oh, I modified it so it's a 'c' not 'c++' source file (I think it'll be more compatible that way, I think). Also, I only tried compiling it on a VMware Fedora Core 3 installation I have (only reason I tried compiling it there). I also didn't test it under Windows or Linux so it may also be horribly messed up (I didn't want to start a new map***).

*** I generate maps (with the command line) using powers of 2 for IDs, so yeah I could use 1, 2, 4 or 8, but my current save game has the id 8192 which is beyond the hardcoded limitation of 9.

Logged
Pages: [1] 2