Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: DFHack and visualizing DF, where to even start..  (Read 2029 times)

robst

  • Bay Watcher
    • View Profile
DFHack and visualizing DF, where to even start..
« on: November 16, 2018, 03:15:32 pm »

Hello,

always was kind of a small dream of me to have a cool dwarf fortress visuals. now i know there are stonesense and armok vision, but somehow they feel kinda wonky for me. don't know.

now recently i started learning unity and c#, and now i would like to try out building my own visualizier for dwarf fortress in unity.

where do i start, really? i think that i could use this DFHack plugin "RemoteFortressReader". apparently it can give me all the needed information from dwarf fortress at runtime, but other than that i really don't know where to start.

So do i need to write a script in unity that accesses the information that RemoteFortressReader gives me? And if so, besides unity, what is the common way of doing such a thing? Or do i have to do something more complicated?

greetings

rob



Logged

ragundo

  • Bay Watcher
    • View Profile
Re: DFHack and visualizing DF, where to even start..
« Reply #1 on: November 17, 2018, 12:29:37 pm »

Your best option is, as you say, use Japa's RemoteFortressReader.
It provides to you a lot of "cooked" information ready to be processed by your tool. You will be using Unity, so C#, which has support for Protocol Buffers.

The other option would be to write a dfhack plugin in C++ and then, get all the data that you need from dfhack, process, package in protocol buffers and send it to Unity. That's what RemoteFortressReader do.
Cons: You need to be able to write a dfhack C++ plugin (relatively easy to do), generate .proto files for the data to be sent/received to/from unity, run protoc compiler to generate C++ files and add them to the source files of the plugin.

If you need support about that option, feel free to ask in #dfhack in freenode IRC. We'll provide support there.

Forget about lua scripts, as they are very slow compared to C++ plugins and if you add the delay that protocol buffers layer adds to the processing time, things become very very slow.
If there's something that you need and RemoteFortressReader doesn't provide, you can try to add pull requests or fork it and modify it.



PD: My always unfinished project is a dfhack plugin that provides protocol buffers support for any dfhack documented data structure, so you acces the data from your tool as if you were accesing it in a dfhack C++ plugin or lua script.
Alas, job is keeping me very busy so I don't have time to finish it.
Logged