Dwarf Fortress data structure descriptions
Perl Common Lisp XSLT Shell
Pull request Compare This branch is 500 commits behind DFHack:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
linux
osx
windows
.gitignore
Bitfield.pm
Common.pm
Enum.pm
README.md
SYNTAX.rst
StructFields.pm
StructType.pm
codegen.pl
defs.xml-empty
df-code.lisp
df.advmode.xml
df.announcements.xml
df.art.xml
df.building-raws.xml
df.building-vectors.xml
df.buildings.xml
df.creature-raws.xml
df.d_init.xml
df.descriptors.xml
df.entities.xml
df.entity-raws.xml
df.globals.xml
df.graphics.xml
df.history.xml
df.init.xml
df.interaction.xml
df.item-raws.xml
df.item-vectors.xml
df.itemimprovements.xml
df.items.xml
df.job-types.xml
df.jobs.xml
df.keybindings.xml
df.language.xml
df.legends.xml
df.machines.xml
df.map.xml
df.materials.xml
df.meeting.xml
df.military.xml
df.pathfinding.xml
df.plant-raws.xml
df.plants.xml
df.projectile.xml
df.raws.xml
df.reaction-raws.xml
df.refs.xml
df.resource.xml
df.skills.xml
df.stockpile.xml
df.syndrome.xml
df.tile-types.xml
df.ui-menus.xml
df.ui.xml
df.unit-thoughts.xml
df.units.xml
df.vermin.xml
df.viewscreen.xml
df.world-data.xml
df.world-site.xml
df.world.xml
disasm.lisp
how-to-update.rst
list.pl
lower-1.xslt
lower-2.xslt
make-csv.sh
make-dt.pl
make-keybindings.pl
make-scans.sh
match-ctors.pl
match-vtables.pl
new-release.pl
start-utils.lisp
start.lisp
start.sh
start.sh-core
symbols.xml
v0.42.01.lst
version.lisp

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.