Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: .dat file decompressor  (Read 3139 times)

BenLubar

  • Bay Watcher
  • [BODY:HUMANOID_LEGLESS_6ARMS]
    • View Profile
.dat file decompressor
« on: March 12, 2015, 07:30:37 pm »

A Dwarf Fortress save in an uncompressed tar is 166,123,520 bytes (158.4 MiB). Compressed using xz, region2.tar.xz is 156,374,900 bytes (149.1 MiB). That's 94.1% of the original size.

The same Dwarf Fortress save is 1,296,906,240 bytes (1236.8 MiB) when decompressed using this program before archiving. Compressed with xz using the same settings, the result is 85,715,988 bytes (81.7 MiB). That's 51.6% of the original size.

As you can see, uncompressed saves compress down to a much smaller size than compressed saves. However, you probably don't want to play with uncompressed saves, especially if you have backups enabled. This utility will decompress any Dwarf Fortress .dat file that it is given (dragged onto the program). Any file that can't be decompressed will be left alone. If you give this utility a folder, it will try to decompress all the .dat files inside it.

Windows: http://dffd.bay12games.com/file.php?id=10672
Linux: http://dffd.bay12games.com/file.php?id=10673
Mac: http://dffd.bay12games.com/file.php?id=10674

Source code: https://github.com/BenLubar/df2014/tree/master/df-decompress
Logged

Quietust

  • Bay Watcher
  • Does not suffer fools gladly
    • View Profile
    • QMT Productions
Re: .dat file decompressor
« Reply #1 on: March 14, 2015, 08:52:38 am »

As I recall, Andux's Save Tools also has the ability to decompress and recompress DF save files (specifically, the "undat2" and "redat2" commands).
Logged
P.S. If you don't get this note, let me know and I'll write you another.
It's amazing how dwarves can make a stack of bones completely waterproof and magmaproof.
It's amazing how they can make an entire floodgate out of the bones of 2 cats.