Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Dwarfmux: better PRINT_MODE:TEXT support for DFHack  (Read 1443 times)


  • Escaped Lunatic
  • Optical Disc
    • View Profile
Dwarfmux: better PRINT_MODE:TEXT support for DFHack
« on: August 05, 2021, 07:40:31 pm »

All of the terminal games I play work just fine with my favorite terminal application.
They are all completely fine to play with the same colors, fonts, and scalable cleartype rendering.
I can zoom in and out nicely, and there's no critical features that stand out as missing when I play them this way.

Except Dwarf Fortress.

Dwarf Fortress's text mode, and DFHack's support for it, have sucked pretty bad for a long time.
Apparently when the input code for keybindings was written wayyyy back, it was only meant to support SDL inputs.

Since it seemed like no one was really in a hurry to fix this, I decided to take a stab at it myself.
Here it is:

What I've done here is set up a python script that dynamically generates a config for Tmux that replaces all of the DFHack commands by grabbing them from your dfhack.init file.
It should be adaptable to each user's individual DFHack configuration, and it even has support for extra options via a comment line.
As a bonus, this also allows you to detach and reattach from the running Tmux session. This allows Linux users to log out and play from the console to save battery, or even play the game remotely through SSH with all of the keybindings still working.
Of course, some terminal input limitations had to be worked around with an extra keybinding layer to get everything working. (more details on that in the repo)

There's also optional HJKL controls for fans of traditional roguelikes.

If you need a hand figuring things out in-game, you can press Alt + Shift + ? in-game to access this help screen:

To install and use, all you have to do is drop the script in your Dwarf Fortress folder and run it.
At the moment, this can only be used by Linux and Mac users, since PRINT_MODE:TEXT is disabled on Windows.
More detailed instructions can be found in the github repo's readme.

BONUS: If you're looking for a TTF font to use with this that's good, scalable and 1:1 square, I would recommend Kreative Square. I haven't been able to find *any* square TTF font with this quality anywhere on the internet. It's a real keeper.
« Last Edit: August 09, 2021, 09:56:35 pm by opticaldisc »
Optical Disc.