Q: How do I download DFHack?
A: Either add to your Steam library from our Steam page or scroll to the latest release on our GitHub releases page, expand the "Assets" list, and download the file for your platform (e.g. dfhack-XX.XX-rX-Windows-64bit.zip. If you are on Windows and are manually installing from the zip file, please remember to right click on the file after downloading, open the file properties, and select the "Unblock" checkbox. This will prevent issues with Windows antivirus programs.
This release is compatible with all distributions of Dwarf Fortress: Steam, Itch, and Classic.
Please report any issues (or feature requests) on the DFHack GitHub issue tracker. When reporting issues, please upload a zip file of your savegame and a zip file of your mods directory to the cloud and add links to the GitHub issue. Make sure your files are downloadable by "everyone with the link". We need your savegame to reproduce the problem and test the fix, and we need your active mods so we can load your savegame. Issues with savegames and mods attached get fixed first!
Highlights
Many new tools and features; Even more bug fixes
Many new tools and features
A bunch of new (or revived) features in this upcoming release. The most noticeable is that the smooth movement plugin is now officially part of DFHack. We've also added a tool to export world data for use with GIS mapping applications, reinstated the old stockflow tool (which allows automating work orders based on a stockpile's contents), reinstated labormanager as a work detail automation tool (with many improvements over the old one), made improvements to lots of existing tools, added a mitigation for a DF bug that made reclaimed/unretired fortresses behave badly, and added an API for doing bulk map scans from Lua efficiently. See the changelog, below, for more details.
Even more bug fixes
Even more DFHack bugs have been fixed. A big one is fixing the defect in timestream that prevented anyone from ever suffocating (an entirely unintended nerf). There's simply too many to write them all up here; check the changelog, below, for the full details.
Announcements
PSAs
PSAs
As always, remember that, just like the vanilla DF game, DFHack tools can also have bugs. It is a good idea to save often and keep backups of the forts that you care about.
Some DFHack tools that worked in previous (pre-Steam) versions of DF have not been updated yet and are marked with the "unavailable" tag in their docs. If you try to run them, they will show a warning and exit immediately. You can run the command again to override the warning (though of course the tools may not work). We make no guarantees of reliability for the tools that are marked as "unavailable".
The in-game interface for running DFHack commands (gui/launcher) will not show "unavailable" tools by default. You can still run them if you know their names, or you can turn on dev mode by hitting Ctrl-D while in gui/launcher and they will be added to the autocomplete list. Some tools listed as "unavailable" in the docs do not compile yet and are not accessible at all, even when in dev mode.
If you see a tool complaining about the lack of a cursor, know that it's referring to the keyboard cursor (which used to be the only real option in Dwarf Fortress). You can enable the keyboard cursor by entering mining mode or selecting the dump/forbid tool and hitting Alt-K (the DFHack keybinding for toggle-kbd-cursor). We're working on making DFHack tools more mouse-aware and accessible so this step isn't necessary in the future.
Changelog
New tools, fixes, and improvements
New Tools
devel/datamine: watch live values for changes and diff structure snapshots to aid script development and reverse engineeringdevel/infinite-sky-probe: tool for testing whether infinite sky is working correctlyexport-world-map: Export world map data for GIS and other external tools.fix/stuck-written-materials: free written materials that are stuck in a non-existent jobgui/export-world-map: New GUI tool to configure world map exports from the embark selection screen.smooth-movement: smoothly animate creature, item, and vehicle movement in the fortress viewportstockflow: (reinstated) queue manager jobs based on free space in stockpiles
New Features
autodump: newundestroyoption reverts pending item destruction while the game is still pausedbuildingplan: new "Do now" option marks the jobs of subsequently placed buildings as high prioritygetplants: new--dry-runoption counts affected plants without designating, and new--brewable/--edible/--oil/--cloth/--dyetrait filters restrict the selection by plant usegui/create-item: quality selection prompt now has 0-5 hotkeys matching the quality levelsgui/mod-manager: warn when loading a preset that doesn't include vanilla mods that were added to the game after the preset was savedgui/unit-info-viewer: the unit character sheet now shows the viewed unit's current and long-term mood, color-coded by stress levelidle-crafting: support cloth, silk, and yarn craftslabormanager:- the
autolaborplugin now provides a second command that manages labors through the work detail system instead of writing the labor matrix; use<cmd> mode legacy|modernor the work details overlay to switch - track job posting age and show a "task starvation" notification in the DFHack warning panel when any posting sits unclaimed for over a day
- the
prioritize:prioritize thisboosts the job related to the currently selected entity, absorbing the functionality ofdo-job-now(which still works and forwards to the new command)sort: the stress/happiness icons in the top bar are now clickable, opening a list of the citizens in that stress category; selecting a citizen centers the map on themstockpiles: the overlay now also attaches to the minecart hauling stop conditions panel, offering import/export of route stop conditionsstocks: the overlay'scollapse allhotkey now toggles, expanding all categories again when everything is collapsedsuspendmanager: suspend deconstruction jobs that would collapse connected machinery, such as waterwheels supporting other componentsquickfix: repairplotinfo.site_idon load when DF leaves it unassigned on reclaimed fortresses
Fixes
- Fixed a possible hang or assertion failure when pressing a hotkey while a DFHack GUI window was open but unfocused
- Fixed broken weather lookup in
World::ReadCurrentWeather - Fixed out-of-bounds color table access in
Screenmodule when Lua pens useCOLOR_RESET - Fixed persistent site data API (
dfhack.persistent.saveSiteData/getSiteData) failing on newly reclaimed fortresses until the first save - Fixed
dfhack.items.createItemmaking glob items of an incorrect size - Plugin commands that throw uncaught C++ exceptions now report an error instead of crashing the game
3dveins:- fix crash when a tile's biome cannot be resolved
- fix failure on embarks that cross midmap tiles
aquifer:- make
--skip-topand top-relative--levelstake effect for thedrain,convert, andaddactions instead of being silently ignored - make
--help/-hactually print help instead of running a map-widelist
- make
autochop: fix crash when a burrow-based command names a burrow that doesn't existautodump:destroyno longer leaves the contents of destroyed containers in limbo or crashes when destroying unit-held itemsbodyswap: fix "invalid argument count" when the target unit has no nemesis recordbuildingplan:- fix roller material estimate asking for one chain per tile instead of one chain total
- fix "Unlink all" only unlinking some mechanisms (or crashing) when freeing mechanisms from the building
burrow: fixtiles clearand other tile operations silently failing because burrow block z-coordinates were stored incorrectly in theBurrowsmodulecaravan: fix doubled "total value of items marked for trade" after toggling filter options, and keep item marks when switching between filter views in theBring goods to depotoverlaycombine: dyes are combined again, but only when theirdye_profilematches, so mixed dyes no longer revert to a component dyeexport-world-map: fix crash exporting site data for a site whose owner has an undefined racefix/loyaltycascade: guard against citizens that are not historical figures and emit a warning.gui/quickfort: show smoothing designations immediately after applying a blueprintgui/settings-manager: preserve built-in work details added after saved settings were createdgui/siegemanager: fix nil index if there are no siege engines on the maphide-tutorials: also suppress the adventure mode start tutorial (defaults its checkbox to off and dismisses the popups)item: thereachable/unreachablefilters no longer count installed building parts, and now treat loose contents of unwalkable buildings (like bolts loaded in a bolt thrower) as reachable when a citizen can stand next to the buildingoverlay: overlay hotkeys no longer steal typed characters while the game is capturing text input, e.g. when renaming a buildingquestport: fix crash on current DF versions and make the teleport actually move the player in fast travelreveal-adv-map: fix live quest log map update when revealing or hiding the mapsort: fix the Places/Workshops and task searches missing workshops by their current display names (e.g. "Stoneworker's Workshop", "Screw Press")stocks:- overlay now resets scroll position when collapsing categories so the item list is no longer left blank and unscrollable
- overlay now resets scroll position when collapsing categories so the item list is no longer left blank and unscrollable
strangemood:- updated to match behavior of current DF version
- fix crash when
--idis given a non-numeric unit id
suspendmanager: fix out-of-bounds parameter read whensetis given too few argumentstiletypes: remove plants (including trees) rooted on a tile that is painted into something that cannot host them, so cleared ground no longer regrows floating treestimestream:- deal properly with units who have breathing difficulties
- pass the validated numeric value to the fps setter so
set fpswith unusual numeric strings (e.g.60.9) can't be silently misapplied
Units::teleport:- update unit occupancy on the full 3x3 footprint of EQUIPMENT units (e.g. wagons) instead of only their center tile
- only clear tile unit occupancy flags when no other unit of the same kind remains on the tile
Misc Improvements
- Added
Coord2dandCoord3dC++ templates, providing a standard set operations for 2-tuples and 3-tuples of any numeric type - Renamed the
stockpilestool tag tostockpileso it no longer collides with thestockpilesplugin ingui/launcher caravan:- the
Bring goods to depot,Trade, andAssign items for displayoverlays now allow searching for items with non-ASCII characters in their description - the
Tradeoverlay will use the trader's appraisal skill instead of the broker's to round/obfuscate the value of items
- the
gui/quickfort: transform hotkeys changed from()_=to,.[]since()is easily confused with<>in the game font
Documentation
- Document
autodump-destroy-here. Remove mention ofautodump destroyable to revert destruction.
Removed
confirm: removed thesquad-disbandandhotkey-resetconfirmations; the game asks for both itself now ("Really disband?" and "Really overwrite")
API
- Added
Maps::addRegionBiomeOffsetto shift world region coordinate by region_details biome reference - Added
Maps::describeSurroundingsto get surroundings classification from savagery and evilness - Added
Maps::forEachTilewithMaps::TileFilter/Maps::TileActionsto scan a cuboid of tiles, matching tiles by tiletype, tiletype attributes, and designation/occupancy bits, and counting, rewriting tiletypes, editing designation/occupancy bits, spawning constructions, or invoking a callback on matching tiles - Added
Maps::getCurrentWeatherto determine the current weather on the map. - Added
Maps::getSiteTypeNameto print the sites classification as a string (e.g. "mountain halls") - Added
MiscUtils::print_rangeto print ranges with prefix, separator, and suffix - Added
Units::breathesandUnits::getBreathingState - Deprecated
World::ReadCurrentWeatherin favor ofMaps::getCurrentWeather
Lua
- Added
dfhack.maps.forEachTileto scan a cuboid of tiles with a declarative filter and apply actions (count, set tiletype or per-tiletype replacements, set designation/occupancy fields, spawn constructions, Lua callback) in a single native call
Structures
- added support for overriding code generation for a specific type
- added
graphic_viewport_spatter_flagand related definitions