Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Dwarf Therapist CLI?  (Read 3132 times)

janiczek

  • Escaped Lunatic
    • View Profile
Dwarf Therapist CLI?
« on: September 01, 2012, 06:34:54 pm »

Hi guys,
would there be a niche for something like Dwarf Therapist, but with CLI?
Imagine the possibilities :)

It would probably be something of an extension to DT, not aimed to replace its functionality, but to do the stuff that's easier done with text :)

For example, I *HATE* to click through a row of labors. I know, I can set a custom profession, but the interface is clumsy for me, at least it could support click-dragging to toggle more labors with single move. But I think text interface will do better.

Small example of what it could do: (nothing set in stonecode yet):

Code: [Select]
$ therapist list
 1 - Urist McMiner
 2 - Doren McCarpenter
(... snip ...)
17 - Lokum McCheesemaker
Code: [Select]
$ therapist create group miners 1 8 9
Created group 'miners' with these dwarves:
1 - Urist McMiner
8 - Zegon McMigrant
9 - Minkot McAnotherone
Code: [Select]
$ therapist add to group miners 13
Added to group 'miners':
13 - Teggud McUseless
Code: [Select]
$ # somehow create labor group hauling - or maybe some smart defaults?
Code: [Select]
$ therapist disable hauling on miners
Disabled 'hauling' labors on group 'miners':
 1 - Urist McMiner
 8 - Zegon McMigrant
 9 - Minkot McAnotherone
13 - Teggud McUseless
Code: [Select]
$ therapist enable mining on miners
Enabled 'mining' labor on group 'miners':
1 - Urist McMiner
(... snip ...)

Please post what you think of the idea!
What features would you like to see - what should it be able to do?
Logged
The Wereass Deduk Asoburist has come!
A large ass twisted into humanoid form.

It is crazed for blood and flesh. Its eyes glow golden yellow. Its cinnamon hair is long and shaggy.
Now you will know why you fear the night.

abadidea

  • Bay Watcher
  • [IS_8BIT_PROGRAMMER]
    • View Profile
    • 0xabad1dea
Re: Dwarf Therapist CLI?
« Reply #1 on: September 01, 2012, 08:44:59 pm »

I am intrigued, but your interface does not look like it would scale very friendily to 150+ dwarves.


.... let's see if we can shoehorn a query language in here. "create group miners where skill.mining >= excellent"
Logged
ABadIdea likes bandfire opal, black opal, claro opal, crystal opal, fire opal, harlequin opal, jelly opal, levin opal, pinfire opal, precious fire opal, red flash opal, white opal, and microcline for its vibrant hue.

glory in the thunder, resplendent in the sky <-- I wrote a whole novel. There will be more.

janiczek

  • Escaped Lunatic
    • View Profile
Re: Dwarf Therapist CLI?
« Reply #2 on: September 01, 2012, 09:23:53 pm »

Yeah, I was thinking about that scaling issue. The interface will definitely need some kind of smart queries - that's what I hope we could brainstorm here. Something usable but easy to use and preferably very close to "just say what you want to do".

Next ideas:
  • I don't really know if it should have some way to list all the dwarfs and their labors? I think DT already excels at that and the CLI would make it messy (on 80x25). But again, what about somebody playing in Dfterm, over SSH, without Qt and GUI in general? Should this thing be replacement or just a supplementary utility to DT?
  • Someone on IRC had an idea of reusing grouping from DT: for example migrant waves (but not limited to them). What about being able to select whole wave and take 10 guys from it by, say: $ therapist add to miners atmost 10 from wave 9; ? This would probably naturally be part of the query language.
  • What about having the group automatically setting the labors, and when you change it for the group, it changes for everybody in it (and for newcomers in future commands)? That would change the mindset a little bit, from imperative to declarative, and from making a list of dwarves and changing their labors to making a list of professions and changing who's doing them.
  • Not really sure about this, but I'll say it anyway: When run without arguments ($ therapist), running ncurses interactive mode? Think aptitude - when run with a subcommand ($ aptitude search xyz), just prints to stdout; when run without it ($ aptitude), takes control of your screen. But I'm afraid this would add complexity to the code. Making whole another UI, losing touch with the text commands... I wouldn't like to have to click again, only this time not with mouse but with keyboard. The queries are what attracts me.
  • It would be great if it could automatically nickname all the dwarves in the group. For example, I like to name my miners 'Miner 1', 'Miner 2', ... and squads 'SQ 1' for all guys from squad 1, 'SQ 2' for all guys from squad 2, etc. Sooo let's say... $ therapist nick squad1 'SQ 1'; therapist nick miners 'Miner %i'; ?
  • EDIT: One more thing. I'd be more likely against it, but let's see how you guys react. What about just making a fork of DT and adding some line of commandline to the statusbar or something? Some work's already done in DT with the filter scripting, but it doesn't allow for bulk actions, it's just filtering the view. Or am I wrong? It would probably be different thing from what I plan.
« Last Edit: September 01, 2012, 09:28:01 pm by janiczek »
Logged
The Wereass Deduk Asoburist has come!
A large ass twisted into humanoid form.

It is crazed for blood and flesh. Its eyes glow golden yellow. Its cinnamon hair is long and shaggy.
Now you will know why you fear the night.

GreatWyrmGold

  • Bay Watcher
  • Sane, by the local standards.
    • View Profile
Re: Dwarf Therapist CLI?
« Reply #3 on: September 01, 2012, 09:34:12 pm »

Elves.
You use DT, isn't that enough for you? In my day (now), I had to assign each dwarf its own labors, uphill both ways in the snow! And I like it that way!
Logged
Sig
Are you a GM with players who haven't posted? TheDelinquent Players Help will have Bay12 give you an action!
[GreatWyrmGold] gets a little crown. May it forever be his mark of Cain; let no one argue pointless subjects with him lest they receive the same.

janiczek

  • Escaped Lunatic
    • View Profile
Re: Dwarf Therapist CLI?
« Reply #4 on: September 01, 2012, 09:35:31 pm »

Elves.
You use DT, isn't that enough for you? In my day (now), I had to assign each dwarf its own labors, uphill both ways in the snow! And I like it that way!

We programmers are a lazy bunch :) Sodom and Gomorrah!
Logged
The Wereass Deduk Asoburist has come!
A large ass twisted into humanoid form.

It is crazed for blood and flesh. Its eyes glow golden yellow. Its cinnamon hair is long and shaggy.
Now you will know why you fear the night.

GreatWyrmGold

  • Bay Watcher
  • Sane, by the local standards.
    • View Profile
Re: Dwarf Therapist CLI?
« Reply #5 on: September 01, 2012, 10:03:05 pm »

Meh, laziness is an acceptable reason. Perhaps paradoxical, but acceptable.
Logged
Sig
Are you a GM with players who haven't posted? TheDelinquent Players Help will have Bay12 give you an action!
[GreatWyrmGold] gets a little crown. May it forever be his mark of Cain; let no one argue pointless subjects with him lest they receive the same.

janiczek

  • Escaped Lunatic
    • View Profile
Re: Dwarf Therapist CLI?
« Reply #6 on: September 02, 2012, 02:02:06 pm »

Again, IRC folks have been very useful, thanks! :)

There are few tools that do something similar:

dfhack autolabor - source
dfhack manipulator - source - forums - screenshot

EDIT: I could probably make use of dfhack Units module ( - API). Seems most handy from the bunch.

Manipulator seems to be almost exactly what I thought about in point 4 above.
Quote
Making whole another UI, losing touch with the text commands... I wouldn't like to have to click again, only this time not with mouse but with keyboard.
I can look into the sources and take inspiration, but generally I don't want to go that DT UI path.

And Autolabor - that's more like it! But I'd like the user to be in the control of what happens - like in DT, just more easily. The point 3 above touches this a little bit (profession settings automatically set for new dwarves added to the group) - but again, it happens only when the user wants to.
« Last Edit: September 02, 2012, 07:27:28 pm by janiczek »
Logged
The Wereass Deduk Asoburist has come!
A large ass twisted into humanoid form.

It is crazed for blood and flesh. Its eyes glow golden yellow. Its cinnamon hair is long and shaggy.
Now you will know why you fear the night.

abadidea

  • Bay Watcher
  • [IS_8BIT_PROGRAMMER]
    • View Profile
    • 0xabad1dea
Re: Dwarf Therapist CLI?
« Reply #7 on: September 02, 2012, 05:16:49 pm »

Elves.
You use DT, isn't that enough for you? In my day (now), I had to assign each dwarf its own labors, uphill both ways in the snow! And I like it that way!

Nope actually I don't use Dwarf Therapist, we takes our interface rrrraw and wrrriggli--

-- hey since WHEN has there been an OSX build of Dwarf Therapist?! BRB!

That being said, I still find the idea of queries highly intriguing 8)

Who am I kidding, what I really want is to write a bot to play a perfect game of DF for me.
Logged
ABadIdea likes bandfire opal, black opal, claro opal, crystal opal, fire opal, harlequin opal, jelly opal, levin opal, pinfire opal, precious fire opal, red flash opal, white opal, and microcline for its vibrant hue.

glory in the thunder, resplendent in the sky <-- I wrote a whole novel. There will be more.