Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: DF Save File Format  (Read 2242 times)

Blomquistador

  • Bay Watcher
  • Pull the ☼Lever☼
    • View Profile
    • My Site
DF Save File Format
« on: May 21, 2020, 03:35:56 pm »

I would really like to make external tools for Dwarf Fortress which can parse and gather information from the save file.
Does anybody know if there has been any work in decoding and making sense of the .dat files as of late?
I know that most of the work has gone into mapping in-memory structures for DFHack.

After a bunch of searching these are the only things I could find. (Horribly out of date as well)
http://www.bay12forums.com/smf/index.php?topic=86417.0
https://dwarffortresswiki.org/index.php/User:Rick/Save_research

Is it even worth the effort of decoding the save format? Or should we just continue to focus on in-memory manipulation (like DFHack)?

Just a thought. It would be great to be able to process and view information about a world without having to have the world loaded in memory by Dwarf Fortress.
« Last Edit: May 21, 2020, 03:44:17 pm by Blomquistador »
Logged
Imagine it, a tombstone that has a scrolling LCD marquee of your best fortresses.

wierd

  • Bay Watcher
  • I like to eat small children.
    • View Profile
Re: DF Save File Format
« Reply #1 on: May 30, 2020, 03:58:11 am »

Wasted effort:  The save data changes (sometimes radically!) on each version.  This is why memory manipulation is the better option in most cases.
Logged

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: DF Save File Format
« Reply #2 on: May 30, 2020, 07:15:01 am »

I would really like to make external tools for Dwarf Fortress which can parse and gather information from the save file.
Does anybody know if there has been any work in decoding and making sense of the .dat files as of late?
I know that most of the work has gone into mapping in-memory structures for DFHack.

After a bunch of searching these are the only things I could find. (Horribly out of date as well)
http://www.bay12forums.com/smf/index.php?topic=86417.0
https://dwarffortresswiki.org/index.php/User:Rick/Save_research

Is it even worth the effort of decoding the save format? Or should we just continue to focus on in-memory manipulation (like DFHack)?

Just a thought. It would be great to be able to process and view information about a world without having to have the world loaded in memory by Dwarf Fortress.

Usually you can find the saving procedure and with info from dfhack (the offsets and layouts of structures) is not that hard to piece it together. However it'll be very sparse. Some from dfhack team are doing the reverse - if something is being saved you can see it's layout better. I've said it "not that hard" but disclaimer - never tried it and probably it's a slog :)

Urlance Woolsbane

  • Bay Watcher
    • View Profile
Re: DF Save File Format
« Reply #3 on: May 31, 2020, 07:51:15 pm »

Usually you can find the saving procedure and with info from dfhack (the offsets and layouts of structures) is not that hard to piece it together. However it'll be very sparse. Some from dfhack team are doing the reverse - if something is being saved you can see it's layout better. I've said it "not that hard" but disclaimer - never tried it and probably it's a slog :)
It can be tedious, but not especially difficult. DF is, by its nature, a fairly transparent game; .xml dumps, world-gen parameters, and raw files make tracing much of the saved data fairly trivial. I find that names are particularly helpful, since they are usually unique; one need merely know the order in which a given word appears in its language file. Files other than world.dat are a bit trickier, since they don't, as far as I am aware, affect anything in legends mode, and player-site files are yet another kettle of fish, given their inherent complexity.
Logged
"Hey papa, your dandruff is melting my skin. Is that normal?"
"SKREEEONK!!!"
"Yes, daddy."