Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: DF Save Version Control  (Read 694 times)

StrongAxe

  • Bay Watcher
    • View Profile
DF Save Version Control
« on: April 04, 2010, 08:12:54 am »

Has anyone worked up a method of version controlling their saves?  I was looking at doing this using svn on a shared machine, as a way of also sharing my saves between computers.

Psuedo Code:
Code: [Select]
cd ~/df/data/
If .svn does not exist Then
   svn checkout <REPO_URL> (force overwrite)
   svn add saves (ignore failure)
Else
   svn update
End If
../DwarfFort.exe
Subversion Commit

Does anyone see a problem with this, or a way it could be made better?  I'd have already implemented it if it weren't for the Windows 7 (x64) / Subversion bug.
Logged

Ampersand

  • Bay Watcher
    • View Profile
Re: DF Save Version Control
« Reply #1 on: April 04, 2010, 08:26:57 am »

Actually seems like a rather brilliant solution. Although, maybe a bit overdoing it. I assume you're passing up packing them in properly timestampped .rar or .zip files for conveniences sake. In which case my suggestion is to not script it out. Update and commit to your svn folder manually every time. You don't want to be in a position where the script doesn't properly execute due to some network problem only to find out later. It's not even hard to do with shell extensions.

Alternately, you can use Dropbox instead, at least until the bug is fixed.

Logged
!!&!!

Urist McDepravity

  • Bay Watcher
    • View Profile
Re: DF Save Version Control
« Reply #2 on: April 04, 2010, 08:54:24 am »

Go with mercurial or git, you will have whole repository locally, so will not have troubles with pulling/pushing to svn server all the time.
Also, this idea seems brilliant, i'll try it myself with git. Its easy to add watchdog for file edits, so it will auto-commit upon any new edit.
Only problem is proper commit names. Best solution would be to grab complete year-month-day info from the game, but that needs some memory hacking.
Logged

Fastred

  • Escaped Lunatic
    • View Profile
Re: DF Save Version Control
« Reply #3 on: April 04, 2010, 02:42:14 pm »

I recently began trying Bazaar (a python based VCS) to handle my saves.  I got tired of continually futzing around with compressing and naming my savegame region folder.  Not to mention that if I wanted to rollback I had to futz around more with deleting the savegame folder and extracting the correct compressed version.  Now I can just save the game, bring up the VCS window, commit the savegame (with a comment if I wish) and go right back into the game.  Rolling back if I want to test something out or I screw something up badly is a lot easier too.
Logged

StrongAxe

  • Bay Watcher
    • View Profile
Re: DF Save Version Control
« Reply #4 on: April 04, 2010, 03:40:53 pm »

Go with mercurial or git, you will have whole repository locally, so will not have troubles with pulling/pushing to svn server all the time.

I thought about that, but for me sharing the saves is as important as having them version controlled.  I suppose I could still do an hg push

I love this Mercurial tutorial btw.
Logged

StrongAxe

  • Bay Watcher
    • View Profile
Re: DF Save Version Control
« Reply #5 on: April 04, 2010, 08:57:11 pm »

Progress: Got my repo checked out on my machine and the process is working manually.  Note that the initial pull/push for a region is huge as you need to save tons and tons of world data, but a save commit for gameplay is fairly small, at least in fortress mode.

Next step: The script.
Logged