DwarfExplorer
=============
A DFHack plugin for browsing Dwarf Fortress internal structures (Windows/Linux).
**NEW!!** Linux release available. See below for installing instructions.
![](images/dwarf_explorer.png)
Features
--------
* Graphical viewer for all Dwarf Fortress structures known from DFHack.
* Open any individual structure in a new window for easy understanding.
* All structure types supported (vectors, arrays, pointers, enums, unions, bitfields, etc).
* Hexadecimal memory viewer for Dwarf Fortress process memory.
* Show comments and 'refers-to' (if defined) attributes for fields in structures.
* Show the dfhack xml file where each structure is defined.
* Stores opened df structures so you can track evolution of the structures in time (rather primitive right now).
* Automatic decoding of enums, bitfields, coordinates and language names.
* Decoding of derived classes showing its hierarachy.
Motivation
----------
We all know gm-editor, the wonderful in game browser invaluable for researching Dwarf Fortress internal structures. Dwarf Explorer does something similar with the following advantages:
* A treeview allows a better understanding of a structure. You can expand/compact fields as you wish.<br>
gm-editor changes to a new screen each time you move down in the structure.
* DFHack has a hex memory viewer, but is a command line one. Dwarf Explorer allows you to open a hex memory viewer for each field of a df structure and even follow pointers.
Dwarf Explorer has also some disavantadges:
* Right now you can't change values in Dwarf Fortress memory.
This is something that will change in future versions of the plugin.<br>
Use gm-editor for that task.
---
Qt DFHack plugins, what sorcery is this?
----------------------------------------
You need to thanks Clement. Yes that Clement, the one that maintains Dwarf Therapist.
He found a method for loading Qt inside DFHack, so you can create multiplatform graphical applications running in the same process as Dwarf Fortress.
Think about that. You get access to all the abilities that DFHack provides for plugins, and you can show all that information graphically!
---
How do I install the plugin?
----------------------
First, download the plugin from github. https://github.com/ragundo/DwarfExplorer/releases
You need to download the plugin for the dfhack version that you have installed in your computer.
### Windows
Extract all the files to the Dwarf Fortress installation directory.
You will get six files:
* `dwarfexplorer.plug.dll`
* `qapplication.dll`
* `Qt5Core.dll`
* `Qt5Gui.dll`
* `Qt5Widgets.dll`
* `qwindows.dll`
The first and second ones are the dfhack plugin libraries and are installed in the subdirectory `/hack/plugins`.
Qt5Core, Qt5Gui and Qt5Widgets are installed in the Dwarf Fortress directory.
qwindows.dll is installed in a subdirectory called `platforms`.
### Linux
Install Qt using your package manager. For example, In Ubuntu type:
`sudo apt-get install qt5-default`
After that, extract all the files to the Dwarf Fortress installation directory.
You will get two files:
* `dwarfexplorer.plug.so`
* `qapplication.plug.so`
These files are the dfhack plugin libraries and are installed in the subdirectory `/hack/plugins`.
**NOTE:** If you are using the Lazy Newcomers Pack for Linux http://dffd.bay12games.com/file.php?id=12762 the you must download the plugin compiled for GCC4.8. If you install the GCC8 version of the plugin, it will not work
---
How do I run the plugin?
----------------------
<b>Dwarf Explorer only works in PAUSED games</b>.
There's no way that the plugin can track all the data that changes in Dwarf Fortress in real time, so the plugin automatically pauses the game, gets the data from DF and shows it.
Launch Dwarf Fortress (and DFHack of course) and load your world.
In the dfhack console type:
`enable qapplication`
This loads the Qt dynamic libraries into Dwarf Fortress process.
After that, launch the graphical viewer typing
`dwarfexplorer`
The plugin window will be displayed without any data, just telling you that Dwarf Fortress is running.
![](images/1.gif)
You need to pause Dwarf Fortress using the Suspend button in the toolbar. When you do this, Dwarf Fortress will pause and the plugin window will display all the known global variables (aka df.global).
![](images/2.gif)
You can now browse all the data, view memory, open new windows, etc. When you are done, press the resume button in the toolbar and continue playing.
![](images/6.gif)
---
Where's the data?
----------------------
The most important global variable is world (df.global.world). This structure has all the data that your fortress uses. So, navigate to the bottom of the windows and locate world.
Then expand the tree and marvel about all the glorious Dwarf Fortress data.
If your tree gets convoluted with too much data, you can also open any structure in a new window by selecting it and using the menu `Window->Open in new window`.
![](images/3.gif)
---
Some DF data examples
----------------------
* Where are my dwarves?<br>
They are in the vector df.global.world.units.active
* How much vermin exists in my embark?<br>
Check vector df.global.world.vermin.all.
* What about the fortress buildings?<br>
vector df.global.world.buildings.all
* Where is the rest of the world data?<br>
It's in the pointer df.global.world.world_data
* What's the tallest mountain in the world?<br>
Look for the field height in df.global.world.world_data.mountain_peaks vector
---
The memory viewer
----------------------
As you browse Dwarf Fortress data, you will encounter a lot of unknow structures (data where we know the C++ type of the field but we don't know its meaning related to the game).
For every field or df structure, you can always see the Dwarf Fortress process memory where this data resides. To do that, select the field and click in the menu `Window->Open address in hex viewer`.
A memory viewer will open at the address where the field is stored.
![](images/4.gif)
For some C++ structures like vectors or pointers, the data has a another level of indirection.
If you open a memory viewer for a vector you will not get the real data. This is because the internal structure of a vector consists of three pointers, being the first pointer the one that points to the data beginning.
To do this operation easier, just select `Window->Open destination address in hex viewer` and you will get the hex memory viewer pointing to the real data.
![](images/5.gif)
---
Does it run with the LNP (Lazy Newcomers Pack)?
----------------------------------------------
Yes as long as your LNP version matches the plugin version.
If the plugin is compiled for DFHack 0.44.12, your LNP must be 0.44.12 also.
Linux users of the LNP must use the plugin compiled with GCC4.8
---
No MacOS?
----------------------------------------------
I've zero knowledge of Macs. In theory the code should be portable across operating systems (Qt strenght). But it seems that there are problems in that platform.
---
What happens when Dwarf Fortress / DFHack changes?
----------------------
The plugin code is generated automatically from DFHack `codegen.out.xml` file using a tool.<br>
Each time that a new DFHack version will be released, I'll update the plugin accordingly.
---
Bugs, suggestion, etc
----------------------
You can use github issues or contact me by irc in `#dfhack` in freenode.
---
Closing thoughts
----------------------
*The real *FUN* is not in your fortress but in the code!!!!*
I hope this tool will encourage more people to do researching in Dwarf Fortress. It'a fascinating puzzle ready to be assembled.
You can try to find relationship between known and unknown data, discover new structures or fields, etc. Then, open a pull request in https://github.com/DFHack/df-structures
for providing that valuable info to the community.
When you starts digging into Dwarf Fortress internals, you
没有合适的资源?快使用搜索试试~ 我知道了~
DwarfExplorer:DFHack插件,用于可视化Dwarf Fortress结构
共152个文件
png:56个
cpp:43个
h:30个
5星 · 超过95%的资源 需积分: 14 1 下载量 145 浏览量
2021-02-05
21:12:08
上传
评论
收藏 9.84MB ZIP 举报
温馨提示
DwarfExplorer:DFHack插件,用于可视化Dwarf Fortress结构
资源详情
资源评论
资源推荐
收起资源包目录
DwarfExplorer:DFHack插件,用于可视化Dwarf Fortress结构 (152个子文件)
.clang-format 3KB
fill_nodes.cpp 8.08MB
fill_offsets.cpp 1.92MB
enum_values.cpp 780KB
DF_Types.cpp 647KB
offsets_cache.cpp 520KB
df_types_size.cpp 401KB
bitfield_values.cpp 171KB
df_2_rdf.cpp 166KB
polymorphic_factory.cpp 110KB
fill_globals.cpp 89KB
enum_sizes.cpp 52KB
df_model.cpp 20KB
df_model_array.cpp 19KB
df_model_vector.cpp 19KB
qhexview.cpp 18KB
MainWindow.cpp 16KB
qhexrenderer.cpp 15KB
df_model_data_from_value.cpp 15KB
df_model_pointer.cpp 11KB
dfstructure_window.cpp 9KB
df_model_df_array.cpp 8KB
main.cpp 6KB
df_model_util.cpp 5KB
qhexdocument.cpp 5KB
df_model_data_from_structure.cpp 4KB
Log.cpp 4KB
qhexcursor.cpp 4KB
df_model_data_from_type.cpp 4KB
main.cpp 3KB
hexviewer_window.cpp 2KB
qhexmetadata.cpp 2KB
node.cpp 2KB
df_proxy_model.cpp 2KB
Application.cpp 1KB
LogWindow.cpp 1KB
EventProxy.cpp 894B
qhexbuffer.cpp 828B
qmemorybuffer.cpp 749B
qmemoryrefbuffer.cpp 729B
replacecommand.cpp 418B
removecommand.cpp 407B
insertcommand.cpp 353B
hexcommand.cpp 160B
4.gif 2.76MB
5.gif 1.52MB
1.gif 1.42MB
2.gif 1.1MB
3.gif 1.04MB
6.gif 547KB
.gitignore 31B
.gitmodules 105B
tl_expected.h 100KB
tl_optional.h 79KB
DF_Types.h 75KB
df_all.h 67KB
node.h 12KB
df_model.h 4KB
qhexdocument.h 3KB
qhexrenderer.h 3KB
qhexcursor.h 2KB
MainWindow.h 2KB
Log.h 2KB
qhexview.h 2KB
TopLevelWidget.h 2KB
dfstructure_window.h 2KB
qhexmetadata.h 1KB
hexviewer_window.h 1KB
df_proxy_model.h 1KB
LogWindow.h 1KB
Application.h 1KB
EventProxy.h 1KB
RDF_Types.h 1KB
utils.h 1KB
qhexbuffer.h 890B
qmemorybuffer.h 687B
qmemoryrefbuffer.h 664B
offsets_cache.h 506B
replacecommand.h 371B
hexcommand.h 352B
insertcommand.h 322B
removecommand.h 310B
COPYING.LESSER 7KB
LICENSE 1KB
README.md 8KB
dwarf_explorer.png 652KB
handle.png 3KB
down_arrow.png 1008B
radio_checked_disabled.png 972B
radio_checked.png 940B
radio_checked_focus.png 846B
group.png 804B
radio_unchecked_disabled.png 760B
cube.png 745B
radio_unchecked.png 728B
radio_unchecked_focus.png 646B
t_small.png 599B
close-hover.png 598B
close-pressed.png 598B
close.png 586B
共 152 条
- 1
- 2
janejane815
- 粉丝: 24
- 资源: 4611
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论1