Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3 ... 10

Author Topic: Extended workflow plugin with in-game UI, inventory dashboard and history charts  (Read 76165 times)

falconne

  • Bay Watcher
    • View Profile

Update: DFHack r3 comes with inventory monitoring screen built-in and includes an improved workshop UI written by ag. I recommend adding the following keybindings to your dfhack.init file:

Code: [Select]
keybinding add Ctrl-W@dwarfmode/QueryBuilding/Some "gui/workflow"
keybinding add Ctrl-I "gui/workflow status"

Pressing Ctrl-W with a job selected in a workshop will take you to the new workflow settings screen. It's more complicated than the old screen. Arumba has created a video tutorial that explains how to use it.

Pressing Ctrl-I or the Status option from the above screen will take you to the inventory monitor:



Note: the released version looks a little different to these screenshots as it's been re-written in Lua.

This screen shows a list of all the item types being tracked by the plugin (known as "constraints"). The selection shows tracking of bars of coal. The green number on the right is my current stock level (81), the S means it's tracking stacks and 100 is the target limit. The colour of the stock level number indicates how "healthy" the stock level is based on current count and trend. Bright green is very good, green is good, red is bad, bright red is very bad. Specifically:
Spoiler (click to show/hide)

The limit number is also colour coded (as you can see some of them are red). Red means that there are currently no workshops producing that item (i.e. no jobs). If it's yellow, that means the production has been delayed, possibly due to lack of input materials.

The chart on the right is a plot of the last 14 days (28 half day plots) worth of stock history for the selected item. The bright green dashed line is the target limit (maximum) and the dark green line is that minus the gap (minimum). You can see the coal bars are slowly climbing upwards, but well below the minimum, hence the stock level is coloured green. Currently this stock history is not being persisted in the savegame along with the rest of the workflow data, so it will reset when you save and start again.

Along the bottom there are more controls. Note that they are now uppercase, so use "shift". Shift-O will toggle the sort order between alphabetical and severity. The latter mode puts the red entries that need attention at the top. You can see that in the following screen, showing how the drinks are trending down:
Spoiler (click to show/hide)

Since this list of constraints can be quite long, there is a "Search" option along the bottom. Search mode is always active.

Shift-A lets you add a new constraint directly without going through a workshop. This is useful to add tracking for items that cannot be produced (meaning you can't add a worksho job for it). For example, you can use it to track how many logs you have, complete with the history chart and colour coding based on your set limit/gap, so you can tell at a glance if the logs are depleting faster than they are being replaced. Or you can use it to track items you buy from merchants but can't produce yourself.

Further, you may want to read this post (from the second paragraph on) about how to set specific input materials for workshop jobs, if you want them to link to specific constraints.
« Last Edit: June 22, 2013, 06:33:42 am by falconne »
Logged
Utility plugins for DFHack, for improving Dwarf Fortress' user interface.

groznij

  • Escaped Lunatic
    • View Profile

AH-MAY-ZING
Logged

ag

  • Bay Watcher
    • View Profile

As a matter of policy, I consider any modifications to the rendering of existing DF screens to be a last-resort approach, because that opens the road to accusations of confusing the user. The very last thing we want is bug reports on the tracker about things done by dfhack. Not to mention that DFHack can't use TTF text for various reasons, and mixing fixed & variable width text it in the same screen looks weird.

Also note that a single job can be controlled by multiple constraints at once; that is a critical aspect of the functioning of the plugin, and is unavoidable e.g. due to there being ores that produce multiple metals when smelted; see my own gui script for a smelt galena job:

Spoiler (click to show/hide)

The monitor thing looks nice though, although you're not supposed to be able to "edit" constraints either - the type+material+etc part should really be a part of the persistent key. :P
Logged

falconne

  • Bay Watcher
    • View Profile

As a matter of policy, I consider any modifications to the rendering of existing DF screens to be a last-resort approach, because that opens the road to accusations of confusing the user. The very last thing we want is bug reports on the tracker about things done by dfhack. Not to mention that DFHack can't use TTF text for various reasons, and mixing fixed & variable width text it in the same screen looks weird.

Hmm true... I didn't worry too much about it because your lua screen will be in the next release anyway and I can just modify my plugin to get rid of the workshop UI.

However from a user-friendliness point of view it would be nice to at least have a single hotkey displayed to take you to the next screen... from what I've seen on the forums a lot of people don't know most of what DFHack can do because you'd have to read the whole readme to find hidden gems.

Also note that a single job can be controlled by multiple constraints at once; that is a critical aspect of the functioning of the plugin, and is unavoidable e.g. due to there being ores that produce multiple metals when smelted; see my own gui script for a smelt galena job:

Yes for the initial version I'm just picking the first constraint. I want to hear of any bugs before I complicate it more. And I also plan to support the ability to set quality levels in the constraint, which will mean even more "many-to-many" relationships between jobs and constraints.

Actually, when I found out you were making your own workshop gui, I decided I didn't need to bother about that, because the dashboard only deals with constraints, not jobs. I'll let your screen handle the joins.

By the way, how do you deal with the fact that some workshop jobs don't translate well into constraints? Such as weaving plant fibre cloth, which picks any plant?

although you're not supposed to be able to "edit" constraints either - the type+material+etc part should really be a part of the persistent key. :P

From what I could see in the code it didn't matter though... because changing it causes the persistent data to be changed anyway? (aside from the possible creation of duplicates, which I'll check for in the next version). If it is an issue it's easy enough to replace the Edit option with a "Copy From" option that gives you the add screen with those values preselected... but it feels inconvenient to manually create a new constraint and delete the old one to change the material.
Logged
Utility plugins for DFHack, for improving Dwarf Fortress' user interface.

ag

  • Bay Watcher
    • View Profile

However from a user-friendliness point of view it would be nice to at least have a single hotkey displayed to take you to the next screen... from what I've seen on the forums a lot of people don't know most of what DFHack can do because you'd have to read the whole readme to find hidden gems.

Maybe we should have some screenshots and stuff in the readme...

By the way, how do you deal with the fact that some workshop jobs don't translate well into constraints? Such as weaving plant fibre cloth, which picks any plant?

In such cases you are expected to edit the job (via another gui script):

Spoiler (click to show/hide)

It has always been like that, only before you had to use the "job item-material" command.

From what I could see in the code it didn't matter though... because changing it causes the persistent data to be changed anyway? (aside from the possible creation of duplicates, which I'll check for in the next version). If it is an issue it's easy enough to replace the Edit option with a "Copy From" option that gives you the add screen with those values preselected... but it feels inconvenient to manually create a new constraint and delete the old one to change the material.

It can just delete the old one, and create the new one in the code; the ui is immaterial.
Logged

falconne

  • Bay Watcher
    • View Profile

Cool... Initially I had been planning to send the user to my material selection to choose from there, but wasn't keen on making the effort since I just wanted to make the dashboard and the workshop UI was just a pre-requisite. I'll just leave that as is (it works enough for testing purposes) and continue working on the dashboard.

And yeah I think screenshots in the documentation might help. Getting to the point that DFHack has so many features it needs its own wiki.
Logged
Utility plugins for DFHack, for improving Dwarf Fortress' user interface.

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile

Cool... Initially I had been planning to send the user to my material selection to choose from there, but wasn't keen on making the effort since I just wanted to make the dashboard and the workshop UI was just a pre-requisite. I'll just leave that as is (it works enough for testing purposes) and continue working on the dashboard.

And yeah I think screenshots in the documentation might help. Getting to the point that DFHack has so many features it needs its own wiki.
AFAIK dfhack readme is sort-of a wiki. It uses different markup but can include pictures and whatnot. It may need to be split somewhat to be more manageable (imho) but it needs to be insync with code for every commit and not be duplicated anywhere (thus not have too old or too new info which sometimes could happen when releases are far between), thats why i think that it should sit in the repository (where it is) and reflect current code as best as it can.
« Last Edit: November 09, 2012, 07:27:18 am by Warmist »
Logged

TeleDwarf

  • Bay Watcher
    • View Profile

It is awesome. Do not let them discourage you, I like the workshop commands a lot. In any case bugs should be reproduceable in vanilla before reporting in the tracker.

Some issues I have found so far:
1. Milking job translates into a "liquid_misc" constraint, which covers all other extracts as well (like syrup...)
2. Shearing translates into a "corpsepiece" constraint, which might be interfered with butchering.
3. I am unable to select the particular wood type(like pine, palm, etc.) for wooden items.
4. I am unable to remove job for creating wooden shields (maybe it will be reproduceable with other jobs.). I have enabled monitor and then disable monitor. When I cancel the job - it magicaly reappears. Markng workshop for removal does clear all the jobs in it for good though.
Edit: nope, the jobs re-appeared after in-game day. Looks like I will have to rebuild the workshop.
« Last Edit: November 09, 2012, 07:26:19 am by TeleDwarf »
Logged

ag

  • Bay Watcher
    • View Profile

In any case bugs should be reproduceable in vanilla before reporting in the tracker.

Never underestimate how, um, confused some users can be...

4. I am unable to remove job for creating wooden shields (maybe it will be reproduceable with other jobs.). I have enabled monitor and then disable monitor. When I cancel the job - it magicaly reappears. Markng workshop for removal does clear all the jobs in it for good though.

Since you don't want your painfully configured jobs to disappear when the stupid dwarf can't find a log, and you can't tell a cancellation from user action (well, actually nowadays you can, but when it was made you couldn't), workflow stops all repeat jobs from disappearing. You need to first remove the repeat status, then cancel it.
Logged

TeleDwarf

  • Bay Watcher
    • View Profile

Since you don't want your painfully configured jobs to disappear when the stupid dwarf can't find a log, and you can't tell a cancellation from user action (well, actually nowadays you can, but when it was made you couldn't), workflow stops all repeat jobs from disappearing. You need to first remove the repeat status, then cancel it.

That would be the case if I had that job still "monitored". Since I stopped monitoring, and "workflow list" does not show any shields - I would expect that job protection would not protect it(shield-producing job).

Wen I remove the repeat status and cancel it - it immediately appears as SR (suspended, repeat)
Logged

falconne

  • Bay Watcher
    • View Profile

It is awesome. Do not let them discourage you, I like the workshop commands a lot. In any case bugs should be reproduceable in vanilla before reporting in the tracker.

Some issues I have found so far:
1. Milking job translates into a "liquid_misc" constraint, which covers all other extracts as well (like syrup...)
2. Shearing translates into a "corpsepiece" constraint, which might be interfered with butchering.
3. I am unable to select the particular wood type(like pine, palm, etc.) for wooden items.
4. I am unable to remove job for creating wooden shields (maybe it will be reproduceable with other jobs.). I have enabled monitor and then disable monitor. When I cancel the job - it magicaly reappears. Markng workshop for removal does clear all the jobs in it for good though.
Edit: nope, the jobs re-appeared after in-game day. Looks like I will have to rebuild the workshop.

Nah it's all good. It's true that modifications should be separated out from vanilla (at least by default) because there are a lot of people who wouldn't realise it otherwise. In any case, that workshop UI is temporary, ag is making a better one that I can replace it with.

As for 1., yeah unfortunately that's a limitation of the Farming (and some other jobs) needing more manual detail. I'll look it up when I'm back at my main machine but I think you might be able to get it to work by editing the liquid_misc constraint, going to the Materials (third) column, searching for milk and picking and individual animal (e.g. cow's milk). Then manually adding constraints for other milk types.

Not sure about 2, will have to look into that. 3 is a bit weird, did you search the materials column for pine? Don't select wood in the second column, just search the third.

4. that's part of the workflow plugin itself (the monitor isn't enabled or disabled, but using the monitor enabled workflow). It keeps repeat jobs from being cancelled. Just remove the repeat mode from the job before cancelling it.

That would be the case if I had that job still "monitored". Since I stopped monitoring, and "workflow list" does not show any shields - I would expect that job protection would not protect it(shield-producing job).

Wen I remove the repeat status and cancel it - it immediately appears as SR (suspended, repeat)

It put it back even after you removed the repeat flag? Hmm... let me go see if that's happening in my version.

Edit: Ah nuts, yes I did break that. Will fix it now and upload a new version.
« Last Edit: November 09, 2012, 08:48:30 am by falconne »
Logged
Utility plugins for DFHack, for improving Dwarf Fortress' user interface.

ag

  • Bay Watcher
    • View Profile

That would be the case if I had that job still "monitored". Since I stopped monitoring, and "workflow list" does not show any shields - I would expect that job protection would not protect it(shield-producing job).

The repeat protection applies to all Repeat workshop jobs without any exception, if the workflow plugin is enabled. To stop it you need to run "workflow disable". I just don't like workshop job cancellations.

Wen I remove the repeat status and cancel it - it immediately appears as SR (suspended, repeat)

If you did that right, that would suggest some newly introduced bug - the version of workflow in dfhack mainline works perfectly.
Logged

falconne

  • Bay Watcher
    • View Profile

Just fixed the problem with non repeat jobs being protected. Thanks for the catch.

There's a new version (v0.2) uploaded to: https://github.com/Falconne/dfhack/downloads
Logged
Utility plugins for DFHack, for improving Dwarf Fortress' user interface.

cecilx22

  • Escaped Lunatic
    • View Profile

Just wondering, any chance of a build of these plugins for the Linux version?

Thanks!
Logged
Pages: [1] 2 3 ... 10