I’ve updated my DFHack repos with support for DF 0.43.05 for Windows (64-bit) - pronvit/dfhack and pronvit/df-structures.

There’s a binary package available for those who wants to help testing plugins and all the functions. As with the OS X version, main plugins seem to work, but I expect some data structures to be incorrect. Several global addresses are also missing for Windows version.

·

Status of 64-bit DFHack

Recently I spent couple days helping DFHack team with support for the new 64-bit Dwarf Fortress version in DFHack. Of course, I was primarily interested in the OS X platform. There were several things that needed to be done in this case:

Scripts to find globals

There is number of scripts in jjyg/df-misc repo that need to be run on new binaries to extract addresses of global variables and vtables, and other stuff. The author is away, and I don’t have any Ruby knowledge, so I decided to write my own scripts for Hopper. They are now available in mifki/df-hopper-scripts, couple of them even support Windows (and Linux support should be easy to do).

Update Lua to 5.3 and make sure DFHack builds for 64-bit

We needed to update Lua from 5.2 to 5.3 to support 64-bit integer numbers (in particular, memory addresses). Also I had to bunch of int32_t variables to intptr_t. Other than this, there were no major difficulties with DFHack. Lethosor fixed an issue with vararg functions that suddenly started to crash on 64-bit.

Update DF structure definitions

long type is used in the DF graphics code, so those structures needed to be updated. But that was easy. While the big problem is that in many places, when we don’t know the meaning of a field in some structure, we simply use int32_t type for it. However, some of this fields are actually pointers, and while this wasn’t a problem on 32-bit, now all the pointers changed size, and a lot of data structures became incorrect. On the bright side, now we can better understand what are pointers and what are integers in DF structures.

It took long time to find such fields in world, world_data and some other structures, but in the end I got a working 64-bit DFHack with most of the plugins (that I’ve tried) working.

Current status

Repos with 64-bit fixes (look for 64-bit branches): pronvit/dfhack, pronvit/df-structures, pronvit/scripts. The last one has an updated devel/find-offsets script to find almost all of the required global addresses.

I don’t have any more time to work on this (need to release DF Remote with support for DF 0.43.03 as soon as possible), and what needs to be done now is just further testing of all plugins to make sure all data structures are correct. I don’t know how much time this is going to take and who is working on it now.

·

Running Linux Dwarf Fortress binary on Windows 10

Even hating Windows as much as I do, I must admit, the ability to run Linux software on Windows 10 is pretty awesome. I just installed the required packages with apt-get as I would do on real Linux, downloaded Dwarf Fortress, and it worked. Oh, you also need an X server for GUI stuff. I guess, you can use this for development, like building DFHack, without a separate, real or virtual, Linux machine.

On the other hand, it woudln’t be Windows, if it worked without issues. Of course, I don’t use Windows anywhere (apart from XP VM to build plugins), so upgraded Win 7 on one of my office machines just for fun. And it was DF kind of !!fun!!.

First, I found a tray icon to launch the upgrade assistance, or whatever it’s called. However, it told me that I have some incompatible virtual network adapter installed, that no-one needs for ages, but it definitely could not proceed with such a terrible incompatibility. There was a link to buy a new PC though.

I then removed that adapter as well as tons on other software I don’t need. To my surprise, the upgrade application still complained about the same thing and there was no retry button or anything that would tell what to do after fixing the listed issues. Apart from the link to buy a new PC, of course.

Ok, it seems there’s an application running daily that updates the compatibility report. I will never understand why I have to wait a day, so I quickly found a command to force the scheduled task to run. No luck here though, the application checks the date itself, so the only option was to change the system date.

However, I found what seemed to be a solution - you can download a stand-alone upgrade application to start the process. I did that, it started to check the compatibility again and… said my display was not compatible. I had no idea what that meant - video adapter, the monitor itself or what - there was no additional information or hints what to do next. Of course there was a link to buy a new PC.

I tried to update video drivers but that didn’t help, and the last option was to burn an upgrade DVD, but started to look like not much fun, so I gave up.

The next day, I checked the standard upgrade notification again, and, surprise, it was ready to upgrade this time, and had no issues with display. And the upgrade process even didn’t get stuck at 76% or any other number like for some other people in the office.

In short, some things are really cool, user experience is below acceptable as usual, Notepad application still has only 1 step of undo - welcome to 2016.

·

Status update

I spent last few days improving df-luacheck tool and now can actually use it to update DF Remote server scripts for new DF/DFHack versions. That’s pretty awesome and otherwise it would require a lot more time to check all the code manually. It also found several errors in the existing DF Remote code for 0.40.24.

As for the application itself, I will now work on setting details for work orders. Then some general improvements from my big to-do list, and I think I will be ready to release a new version with support for 0.42/0.43.

·

Still deciding which Dwarf Fortress versions to support

Dwarf Fortress 0.43.03/0.43.04 are out now (the latter having some issues), and next versions will now be 64bit, which means it will possibly take long time until DFHack supports them.

Initially, I was planning to support last version in each DF release cycle, which would be 0.40.24, 0.42.06 and 0.43.04. However, now that 0.43 release cycle seems to be finished, there’s no point in supporting 0.42. But also since saves from previous versions can be used with 0.43, there’s almost no point in supporting 0.40, which would greatly simplify the development.

The only problem is that this will be a very bad surprise for users who update the app and can no longer connect to their server without additional actions, even if it’s just a simple DF update. I’m thinking about releasing another app version now that would show a note about the upcoming update.

I’m still deciding what to do, in the meanwhile just continuing to implement 0.42/0.43 new features. By the time I finish, it should be clear what the last build in 0.43 cycle is, and how difficult it is for me to support several DF versions.

·

Instrument descriptions when adding workshop jobs.

·

Working on locations-related screens.

·

Checking Lua scripts against Dwarf Fortress data structures

Dwarf Fortress Remote server contains a lot of Lua code, and now that I’m adding support for more DF versions, I need to make sure all my code is updated as DF data structures change. I could probably just diff data structure definition files, but I’d like to have a less time consuming and more reliable solution.

So I started to work on a tool that automatically checks Lua scripts and shows access to wrong fields, incorrect assignments and so on - things that a compiler would show errors for, were Lua a statically typed language.

Here it is: https://github.com/mifki/df-luacheck

It’s a work in progress, with a lot of unsupported things, including require statements and built-in DFHack library functions, so it can’t be used to check real scripts yet, but I’ll improve it until it can check all of the DF Remote code and show what needs to be fixed for 0.42. Some examples of what it can do below.

function test(unitid)
    local ret = {}

    for i,unit in ipairs(df.global.world.units.active) do
        if unit.civ_id == df.global.ui.civ_id and unit.flags1.tame and not unit.flags1.dead and not unit.flags1.forest then
            local work = (unit.profession == df.profession.TRAINED_WAR or unit.profession == df.profession.TRAINED_HUNT)
            local geld = unit.flags3.geld

            -- ...    
        end
    end

    return ret
end

test(1)

---------------------------
6: ERROR value TRAINED_HUNT does not exist in enum df.profession
6: ERROR type of operand df.profession.TRAINED_HUNT is unknown, assuming the result is bool
7: ERROR field geld does not exist in unit.flags3 of type df.unit_flags3
7: ERROR type of expression is unknown unit.flags3.geld

function test(bldid)
    local bld

    if bldid then
        bld = df.building.find(bldid)
    else
        bld = df.global.world.selected_bld
    end    

    bld.owner_id = df.global.world.units.active[0]
end

test(1)

---------------------------
7: ERROR field selected_bld does not exist in df.global.world of type df.world
7: ERROR type of expression is unknown df.global.world.selected_bld
10: ERROR assigning df.global.world.units.active[0] of type df.unit to bld.owner_id of type number
·

I'm happy to announce that Dwarf Fortress Remote 1.15 is available on the App Store. This release introduces multilevel rendering and contains a lot of other user interface and usability improvements. Below is a lengthy detailed list of changes.

Multilevel Rendering
This feature is well known to users of TWBT plugin on desktop, and now it’s available on mobile. It allows to see not just the current z-level, but also everything below. Only the top X levels are refreshed though, where X is configurable and is set to 3 levels by default. You can tweak fog and shadow parameters if required (darker tilesets may require more dense fog and shadows to distinguish between z-levels easily).

Fast building placement mode
When you need to place a lot of buildings like beds, doors or coffins, where you do not care which items will be used, you can do it much faster now. Just long press the green OK button when placing a building, and the closest item(s) will be automatically selected, without showing the item selection screen.

Fast linking mode
The same when linking buildings to a lever or trap - long press OK button, and the first two mechanisms will be automatically selected to be used for the link.

New clean style for the top status bar and for announcements at the bottom of the screen. Two announcements are now shown at a time, allowing to see more of them in time in a busy fortress.

Selection size is now shown when designating, creating zones and stockpiles

Long press z-level up/down buttons to show list of Points - this allows to quickly zoom to various parts of the fortress

When adding jobs in a workshop, swipe to add a job and set it repeat

When viewing a cage, swipe a contained animals to release them without loading the full Assign Animals screen

On the announcements and reports screens, “today”, “yesterday” and “X days ago” are now shown alongside the dates

Clutter status and number of contained items are now shown when viewing a workshop

Swipe a server in the server list to clear caches and connect - useful if you experience map corruption issues

Changelog is shown in the bottom of the server list screen to keep you informed about fixes and additions being made to the server plugin and in-app help

Zone information view can now be opened by pressing OK button when a zone is selected. Also, zone status is shown in the information bar.

Fixed orientation of horizontal axle and water wheel shown incorrectly when placing these buildings

Fixed an issue with loading noble view after leaving a position vacant

Close button is removed from trading screens to prevent accidental closing and losing status of all the items marked for trade

Support for iOS 8.0 - iOS 8.2

·

On DF versions supported by Dwarf Fortress Remote

So, Toady released DF 0.43.01 today, which means 0.42.06 is the last build of the 0.42 version. There now will be several more builds of 0.43 after which I believe there will be a long period without new releases when Toady will experiment with 64 bits and new compiler. And, most importantly, we don’t know how long it will take to make DFHack compatible with these changes.

Saves from 0.40 and 0.42 are compatible with 0.43, so I’m not sure if I will support 0.42.06 in DF Remote or just the last build of 0.43 if it’s finalised while I’m working. Ideally I wish I could drop support for 0.40 altogether because you can just upgrade and continue playing, but unnecessary complications with upgrade may upset some users.

On the other hand, I was going to add support for DF 0.34.11 because there are lots of saves and community games not compatible with newer DF versions, and, well, to disable features that were not available in 0.34 is not that hard.

·