Dwarf Fortress data structure descriptions
Clone or download
quietust Update ui.main, identify sub-structure for nemesis offloading
Said structure is also used inside viewscreen_savegame.

The 3-byte padding in ui.main is to work around a strange bug in IDA 7.0
which causes it to totally ignore the alignment requirements on the new
sub-structure
Latest commit 4ba7694 Nov 26, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Call the new keydisplay search script. Oct 2, 2012
.travis.yml Add .travis.yml Feb 13, 2018
Bitfield.pm Revert "Remove non-trivial bitfield constructors" Dec 27, 2016
Common.pm Make since attributes work with type definitions Apr 3, 2018
Enum.pm Add new army_controller (probably) vector from 0.44.11 Jul 10, 2018
README.md Fix markdown heading Jan 13, 2018
SYNTAX.rst Linked list Jul 1, 2018
StructFields.pm Support automatic array size detection from index-enum Jun 26, 2018
StructType.pm More supporting code for linked lists. Jul 1, 2018
codegen.pl Properly mark static.fields-*.inc files as generated Mar 22, 2016
defs.xml-empty Add a perl script that automates resetting for a new version. Mar 7, 2012
df-code.lisp Add stubs to let cl-linux-debug parse new tags. Jun 1, 2016
df.advmode.xml 0.44.10 - realign ui_advmode May 6, 2018
df.announcements.xml .1 to .01 in since attributes Jun 27, 2018
df.art.xml Merge branch 'master' into performance Nov 24, 2018
df.building-raws.xml Change bitfield <compound>s to <bitfield>s Dec 27, 2016
df.building-vectors.xml missing buildings_other_id values Jan 8, 2018
df.buildings.xml .1 to .01 in since attributes Jun 27, 2018
df.creature-raws.xml Fix creature_raw size (#276, reverts #272) Jun 27, 2018
df.d_init.xml Remove "announcements" global, merge into d_init where it belongs Dec 4, 2017
df.descriptors.xml Fix broken instance-vectors Mar 10, 2018
df.entities.xml Update structures Mar 11, 2018
df.entity-raws.xml Fix profession array sizes to include MESSENGER Jun 26, 2018
df.globals.xml lever_target_type: convert to complex enum, add building_type attr, a… Apr 9, 2018
df.graphics.xml Add original-name for enabler Dec 27, 2017
df.history.xml another field type in world_history Nov 23, 2018
df.init.xml support 'long' type directly because size differences on win/others Jul 19, 2016
df.interaction.xml Add breath_attack_type.OTHER Jun 27, 2018
df.item-raws.xml .1 to .01 in since attributes Jun 27, 2018
df.item-vectors.xml Branch-related additions May 10, 2016
df.itemimprovements.xml more poetic_form fields Jul 15, 2018
df.items.xml Name 0.34.01 field in item_body_component, remove comment Jun 20, 2018
df.job-types.xml Add job_type attribute helper if it was generated from designation Jun 18, 2018
df.jobs.xml More supporting code for linked lists. Jul 1, 2018
df.keybindings.xml Automatically generated symbols.xml for DF 0.44.11 Jun 23, 2018
df.knowledge.xml Allow unions of types with non-trivial constructors (e.g. bitfields) Dec 28, 2016
df.language.xml Identify language name categories Nov 23, 2017
df.legends.xml Update structures Mar 11, 2018
df.machines.xml Change bitfield <compound>s to <bitfield>s Dec 27, 2016
df.map.xml More supporting code for linked lists. Jul 1, 2018
df.materials.xml .1 to .01 in since attributes Jun 27, 2018
df.meeting.xml added performance info Jul 16, 2018
df.military.xml Add new army_controller (probably) vector from 0.44.11 Jul 10, 2018
df.pathfinding.xml Add new unit_path_goal enum values Dec 25, 2015
df.plant-raws.xml Add all remaining classes Nov 23, 2017
df.plants.xml more field names. Oct 28, 2018
df.projectile.xml More supporting code for linked lists. Jul 1, 2018
df.raws.xml Update 'world' for v0.44.06 Mar 10, 2018
df.reaction-raws.xml Fix broken instance-vectors Mar 10, 2018
df.refs.xml Update structures Mar 11, 2018
df.resource.xml assign names to some unnamed fields to prevent "anon_X" conflicts in … Mar 18, 2018
df.skills.xml Add profession::MESSENGER Jun 26, 2018
df.stockpile.xml Add setup_character_info (used by setupdwarf/setupadventure) and iden… Feb 21, 2018
df.syndrome.xml Name unk values in syndrome structure Jul 1, 2018
df.tile-types.xml Fix name of viewscreen_topicmeeting_fill_land_holder_positionsst Feb 26, 2015
df.ui-menus.xml sync ui_sidebar_menus.command_line with g_src Jul 7, 2018
df.ui.xml Update ui.main, identify sub-structure for nemesis offloading Dec 1, 2018
df.unit-thoughts.xml Add new unit_thought_type items in 0.44.12 (expulsion related) Aug 7, 2018
df.units.xml Merge pull request #301 from Putnam3145/patch-3 Nov 1, 2018
df.vermin.xml Change bitfield <compound>s to <bitfield>s Dec 27, 2016
df.viewscreen.xml Update ui.main, identify sub-structure for nemesis offloading Dec 1, 2018
df.world-data.xml Named is_volcano flag Jul 18, 2018
df.world-site.xml some fields types in world_site Nov 23, 2018
df.world.xml added performance info Jul 16, 2018
disasm.lisp Don't list linux globals that couldn't be decoded. Feb 18, 2012
how-to-update.rst links to metasm and df_mist repos Jul 5, 2016
list.pl Include all static*.inc files in list of generated files Dec 3, 2017
lower-1.xslt Linked list Jul 1, 2018
lower-2.xslt Allow associating certain attributes with type-name and pointer-type. Jul 21, 2012
make-csv.sh make-csv: use $() instead of backticks Jul 20, 2018
make-dt.pl Use the three-argument form of open() Jul 21, 2014
make-keybindings.pl Fix make-keybindings.pl inserting INTERFACEKEY_ before keys that end … Mar 10, 2018
make-scans.sh make-scans: Use ./ before wildcards Jul 20, 2018
match-ctors.pl Use the three-argument form of open() Jul 21, 2014
match-vtables.pl Misc uncommitted changes for v0.40 from my checkout. Dec 4, 2015
new-release.pl Correct flows symbol, and found timed_events. All symbols for DF 43.0… Jul 9, 2016
start-utils.lisp Add more wrappers for finder functions in cl-linux-debug. Oct 5, 2012
start.lisp Fix final objects in the old test file to auto-mark things aligned. Dec 13, 2015
start.sh Allow specifying the process id as an argument to start.sh. Mar 3, 2013
start.sh-core Determine the sbcl heap size based on the architecture. Mar 6, 2012
symbols.xml win32: fix vtables for viewscreen_storesst and squad_order_rescue_hfst Aug 23, 2018
version.lisp Update structure .lst Dec 3, 2017

README.md

DF-structures

DF-structures is the core information on which DFHack depends.

For information on how to understand this format, see ./SYNTAX.rst. For how to update for a new version of DF, see ./how-to-update.rst

Originally dfhack used a file called Memory.xml to describe data structures of the game. It explicitly listed addresses of known global variables, and offsets within structures to fields, not unlike the ini files used by Dwarf Therapist.

However, as the number of known fields and objects grow, maintaining the explicit offset lists quickly becomes difficult, error prone, and inefficient.

This format instead represents data structure layout purely via listing all fields in the correct order, exactly like a structure definition does in the C++ language itself. There is still a file with numeric data, but it only contains absolute addresses of global objects.