Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: What do we know about the save game format?  (Read 819 times)

Nadaka

  • Bay Watcher
    • View Profile
    • http://www.nadaka.us
What do we know about the save game format?
« on: December 06, 2007, 02:51:00 pm »

Specifically, does anyone know a how geographic features are encoded in the save files? And more specifically, are the presence of "hidden fun stuff", chasms, particular minerals and underground streams also recorded? Or are they generated based on a stored random seed?

Knowing this, one could develop a utility that could say... search for magma vents, particular rock layers, etc. It would allow one to set criteria for starting locations and automatically search the entire world surface for matches.

For instance, one might look for flux layers next to a magma vent for potential steel manufacture.

Logged
Take me out to the black, tell them I ain't comin' back...
I don't care cause I'm still free, you can't take the sky from me...

I turned myself into a monster, to fight against the monsters of the world.

BurnedToast

  • Bay Watcher
  • Personal Text
    • View Profile
Re: What do we know about the save game format?
« Reply #1 on: December 06, 2007, 07:14:00 pm »

I think the maps are generated when you embark, there are over 38 *billion* 'local' tiles per world so it would make savegames awful huge if it had info for every single one of them. Remember, at least 30 z-levels (15 up and 15 down) per local tile, sometimes more.

so no, such a utility is probably not possible.

You might be able to make a utility that uses the seed to generate each tile, check it, then go to the next if you knew how that worked exactly. I imagine it would be very very slow though.

Logged
An ambush! curse all friends of nature!

Nadaka

  • Bay Watcher
    • View Profile
    • http://www.nadaka.us
Re: What do we know about the save game format?
« Reply #2 on: December 06, 2007, 08:19:00 pm »

I am aware that it would be impossible to actually store all the information for every single tile in the world.

However it is obvious that certain information on each map section is predefined. For instance magma vents to the surface, elevations, biomes and 2 to 6 rock layers are all visible from the embarkation screen.

Even if this is the only information available it would still be useful to be able to read it directly from the files to produce a list of starting locations meeting certain criteria.

Logged
Take me out to the black, tell them I ain't comin' back...
I don't care cause I'm still free, you can't take the sky from me...

I turned myself into a monster, to fight against the monsters of the world.

hactar1

  • Bay Watcher
    • View Profile
Re: What do we know about the save game format?
« Reply #3 on: December 06, 2007, 11:08:00 pm »

I believe the maps are procedurally generated when you actually enter them, either in adventure mode, or dwarf mode.  A deterministic algorithm creates the map features from the map seed based on their X-Y coordinates.  The same algorithm is probably run (at a lower resolution, to make it faster) when you're browsing sites in the embark screen.

This would mean that you probably couldn't look at specific features with a third-party utility.  However, I suppose it may be possible to look at memory contents while actually in the embark browser, to glean information that the game doesn't give you.

Logged