Bay 12 Games Forum

Please login or register.

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

Author Topic: Integrated Dwarf Foreman (with functional prototype)  (Read 21255 times)

Valdemar

  • Bay Watcher
    • View Profile
Integrated Dwarf Foreman (with functional prototype)
« on: April 05, 2010, 08:28:29 pm »

Dwarf Foreman (or its most recent incarnations like Dwarf Manager and Dwarf Therapist) are considered by many to be absolutely essential tools for properly managing a fortress. This has been proposed many times, and currently ranks fairly high in the Eternal Suggestion Voting. But how can such a seemingly complicated feature be implemented?

I've thought about this problem, and coded up a fully functional prototype of what this screen could look like in Javascript. It looks fairly similar to the new military screen, with the same general format as Dwarf Foreman/Manager/Therapist:


(this is just an image, follow the link above for the actual working version)

To be clear, this is not a utility, but a working prototype for what the integrated Dwarf Foreman could look like. I would suggest putting it under the Units screen with the hotkey "f".

Use the arrow keys to move around the screen. Shift + an arrow key will move 10 units in any direction. The full name, profession, and current labor column are displayed at the bottom, since each is highly abbreviated (especially the labors). The numbers indicate the relative skill levels, and the shaded in cells are enabled labors. I've fit almost all the labors on the one screen, though a second page will be required for the animal/hunting and medical labors. At the very right are the hauling professions; obviously there is no skill for these, but labors can still be easily toggled.

Press Enter in any cell to toggle the labor for the current dwarf. Shift-Enter will toggle the labor for all dwarves with the same custom profession as the currently selected dwarf. Control-Enter will toggle the entire labor group (the ones with the same color) for the selected dwarf; this is mostly intended for quickly turning hauling on and off.

Professions can be edited directly on this page with the y key. An underscore will pop up under the profession name at the bottom, and you can type and use backspace to edit the name. Press enter when you're done.

Another feature I put in that currently has no equivalent in normal Dwarf Fortress is editing the color of dwarves. It always annoys me when dwarves have a completely different color than their actual job, so you can press c to change the color of the current dwarf to that of the current labor. Ideally this would resort the list, but I haven't implemented that. If this goes contrary to DF design in some way, this need not actually be implemented.

Since one will probably have more dwarves than will fit, the screen will probably need to page in some way. Either automatically scrolling when you reach the bottom with the arrow keys or using + and - or / and * would work fine, though I haven't implemented that.

I hope this prototype will be a useful demonstration of what an integrated Dwarf Foreman could look like. I know I would be thrilled if something like this made it into Dwarf Fortress.
« Last Edit: April 05, 2010, 08:33:32 pm by Valdemar »
Logged

jfsh

  • Bay Watcher
    • View Profile
Re: Integrated Dwarf Foreman (with functional prototype)
« Reply #1 on: April 05, 2010, 09:43:01 pm »

Brilliant, I love it.

Can't believe you coded a working version!

immibis

  • Bay Watcher
    • View Profile
Re: Integrated Dwarf Foreman (with functional prototype)
« Reply #2 on: April 05, 2010, 10:44:58 pm »

Great idea!
Logged
If I wanted ramps I would've designated ramps, dammit!

MagicGuigz

  • Bay Watcher
  • [magical]
    • View Profile
Re: Integrated Dwarf Foreman (with functional prototype)
« Reply #3 on: April 05, 2010, 10:50:16 pm »

Great idea, but you're going to run out of space with double digit skill levels, so it'd also need horizontal paging, or better yet actual categories.

Still, I hope this gets implemented in some way.
Logged

immibis

  • Bay Watcher
    • View Profile
Re: Integrated Dwarf Foreman (with functional prototype)
« Reply #4 on: April 05, 2010, 11:45:38 pm »

It should also be moused controlled, so we can click on the grid to easily toggle labors.
Logged
If I wanted ramps I would've designated ramps, dammit!

Steely Glint

  • Bay Watcher
    • View Profile
Re: Integrated Dwarf Foreman (with functional prototype)
« Reply #5 on: April 06, 2010, 12:25:47 am »

This has always been my highest priority desired feature, and has always been one of my eternal voting selections. You've designed it almost exactly how I imagined it.

Great idea, but you're going to run out of space with double digit skill levels, so it'd also need horizontal paging, or better yet actual categories.

Still, I hope this gets implemented in some way.
Digits above 9 could blink, or be a different color.
Logged

Valdemar

  • Bay Watcher
    • View Profile
Re: Integrated Dwarf Foreman (with functional prototype)
« Reply #6 on: April 06, 2010, 03:21:11 pm »

Great idea, but you're going to run out of space with double digit skill levels, so it'd also need horizontal paging, or better yet actual categories.

Still, I hope this gets implemented in some way.

I have it using the letters A-E and L for Legendary once it runs out of numbers, so that no profession ever takes up more than one column. I've changed the random skill generator so it actually generates skills that high.

A second page for the columns will be needed to fit some of the other labors anyways. Collapsing the column headers by labor group could work, though it seems like it would become confusing and you'd lose the big overview you get with the grid. Collapsing the dwarf list by custom profession name like in Therapist would definitely be useful, though.

It should also be moused controlled, so we can click on the grid to easily toggle labors.

That would be great. I didn't want to go too far, since even though several screens in DF use the mouse, it's rare, which probably means it makes the coding more difficult for Toady. But if possible, it would definitely make the screen easier to use. Left click for toggling, right click to move the cursor, and Shift and Control click working like the modifiers for Enter would work well.

« Last Edit: April 06, 2010, 03:22:55 pm by Valdemar »
Logged

khantin

  • Bay Watcher
    • View Profile
Re: Integrated Dwarf Foreman (with functional prototype)
« Reply #7 on: April 06, 2010, 04:16:13 pm »

It would be rad if you could expand the profession names at the expense of the # of dwarves in the list.  Like the tab button changes the view from 15 dwarves and 2 letter skill names to 5 dwarves and 12 letter skill names.
Logged

Zedzy

  • Escaped Lunatic
    • View Profile
Re: Integrated Dwarf Foreman (with functional prototype)
« Reply #8 on: April 06, 2010, 04:32:17 pm »

It would be more intuitive if the letter order were reversed so that A were Grand Master ________ and if E were Accomplished ________ because an B on a test is good, but a D is bad, if that makes any sense.

An awesome example nonetheless.
Logged

Valdemar

  • Bay Watcher
    • View Profile
Re: Integrated Dwarf Foreman (with functional prototype)
« Reply #9 on: April 06, 2010, 06:53:13 pm »

It would be more intuitive if the letter order were reversed so that A were Grand Master ________ and if E were Accomplished ________ because an B on a test is good, but a D is bad, if that makes any sense.

An awesome example nonetheless.
Ah yes, that makes much more sense. The letters now go E-A, with Legendary remaining L.

It would be rad if you could expand the profession names at the expense of the # of dwarves in the list.  Like the tab button changes the view from 15 dwarves and 2 letter skill names to 5 dwarves and 12 letter skill names.
You can now press Tab to expand the profession abbreviations to 4 letters. It just cuts off the first two dwarves in the prototype; I wrote the display code really quickly and it would be a real hassle to shift them down. I'm not certain that it's much better this way, since it looks like a big jumble of letters until you concentrate on reading down, but it's certainly a good option to have.

Squirrelloid

  • Bay Watcher
    • View Profile
Re: Integrated Dwarf Foreman (with functional prototype)
« Reply #10 on: April 06, 2010, 07:44:17 pm »

What's wrong with it being in a separate window?  I mean, it would be nice if it was bundled with the game, possibly even if it started with the game, but there's no reason it has to be *in* the same window as DF.  In fact, it probably loses functionality doing that.

It would be pretty simple to write a script that started DF and Dwarf Therapist/Foreman/whatever with a single doubleclick.  At which point there's no real need to merge the code.

Other ASCII games (eg, Angband) have multiple windows to display useful information so you can track information while using the main game.  That those extra windows are controlled directly by the parent program isn't especially relevant - the fact that foreman is essentially separate is an advantage in the modern multi-core world, because it can run on a different core than DF. 

Basically, what advantages are there to combining this program into the DF codebase that don't exist when running it separately?
Logged

Valdemar

  • Bay Watcher
    • View Profile
Re: Integrated Dwarf Foreman (with functional prototype)
« Reply #11 on: April 06, 2010, 09:41:15 pm »

What's wrong with it being in a separate window?  I mean, it would be nice if it was bundled with the game, possibly even if it started with the game, but there's no reason it has to be *in* the same window as DF.  In fact, it probably loses functionality doing that.

It would be pretty simple to write a script that started DF and Dwarf Therapist/Foreman/whatever with a single doubleclick.  At which point there's no real need to merge the code.

Other ASCII games (eg, Angband) have multiple windows to display useful information so you can track information while using the main game.  That those extra windows are controlled directly by the parent program isn't especially relevant - the fact that foreman is essentially separate is an advantage in the modern multi-core world, because it can run on a different core than DF. 

Basically, what advantages are there to combining this program into the DF codebase that don't exist when running it separately?

The point is that we shouldn't have to rely on third-party utilities for such an important purpose. I'm sure we all agree that managing a large fortress without Foreman is a complete nightmare. While the separate-window utilities do work, we have to worry about them possibly corrupting memory or saves, and of course they need to be updated for every new version. And I personally far prefer to play DF full-screen on a widescreen monitor than in a window, so am forced to either play it in a window or constantly switch out. It also breaks immersion since the Foreman windows look so completely different from the DF UI.

My goal with this prototype was to demonstrate how the Foreman interface could be programmed using interface elements already in DF, which should present a minimum of hassle for Toady to code if he so chooses. It may be slightly less convenient than the third-party tools, but it's definitely good enough for me and I hope many others. You'll always be able to use the third-party utilities if you prefer them.

Strife26

  • Bay Watcher
    • View Profile
Re: Integrated Dwarf Foreman (with functional prototype)
« Reply #12 on: April 06, 2010, 09:56:23 pm »

I'd be happy for an ingame foreman utility, even if it lost some functionality. It helps keep Toady independent, while the utilities are great things, it can cause all sorts of problems for the project if a new version does something to break one, forcing people to choose between the new version or the utility.
Logged
Even the avatars expire eventually.

Trouserman

  • Bay Watcher
    • View Profile
Re: Integrated Dwarf Foreman (with functional prototype)
« Reply #13 on: April 06, 2010, 11:09:54 pm »

Basically, what advantages are there to combining this program into the DF codebase that don't exist when running it separately?

How about portability and ubiquity?  It would run everywhere DF runs, because it would be part of the program.  It's just absurd to say that it's important functionality, but shouldn't be part of the program.
Logged

Rafal99

  • Bay Watcher
    • View Profile
Re: Integrated Dwarf Foreman (with functional prototype)
« Reply #14 on: April 07, 2010, 12:08:11 am »

Nice script!
This is quite similar to how I imagined Dwarf Foreman integrated into DF.
Nice feature to have would be sorting dwarves by specific skill. That way you can easily find these with highest level at certain skill, and enable the labor only for them.
Logged
The spinning Tantrum Spiral strikes The Fortress in the meeting hall!
It explodes in gore!
The Fortress has been struck down.
Pages: [1] 2 3 ... 5