dfhack icon indicating copy to clipboard operation
dfhack copied to clipboard

Request: `automandate`

Open DragonEyeNinja opened this issue 2 years ago • 2 comments

Just a small QoL that I think would be useful. Have a plugin automatically create work orders for noble mandates and demands.

  • blacklist materials and object types, e.g. valuable adamantine or statues that take lots of mats to craft
  • blacklist nobles that you plan on giving unfortunate accidents to
  • default material blacklist of valuable mats
  • gui not needed but may be helpful

DragonEyeNinja avatar Oct 28 '23 22:10 DragonEyeNinja

wise words from Ozzatron on Discord https://discord.com/channels/793331351645323264/793331351645323267/1183629308586106931

In a bit more detail than what myk said,

The reason automandate hasn't been made at any time in the last ten years is that the annoyance to the user of having to fulfill mandates manually roughly equates to the annoyance to the user of having the tool not do it "the way you would've done it".

Now I agree it's probably true that a good fraction of users would just turn it on and never notice or care about the settings, but for it to see as widespread adoption as you might like, you would need a lot of configuration options... meaning those options need sane defaults. Meaning all that UI and functionality needs to be thought about beforehand.

Off the top of my head, you'd need something like the Kitchen cooking ban menu at the very least, to stop mandates from using anything but worthless material. A good first guess is that it would exclude all metals of over 10 value by default, along with flux stone, and refuse to use wood for anything that can be made of any other material. But what about iron? Do you have enough to casually use it on mandates? What if it's the only metal on the embark and they asked for a metal object? What about obsidian? What if the player wants to restrict things to specific "junk woods"?

myk002 avatar Dec 11 '23 05:12 myk002

I would opt for a whitelisting rather than a blacklisting approach:

  1. Specify a list of (useful) items with materials (i.e., iron bolts). If a mandate matches one of those, just queue the corresponding job.
  2. Specify a list of materials priorities (i.e., "bone, yarn, rock"). For any mandate that isn't handled by (1), queue a job using the first valid (available?) material from the list.
  3. If the mandate cannot be satisfied using any of the materials set in (1-2), do nothing and (optionally) yell at the player.

Also, I'd be happy to help with the development of this. I'm fairly optimistic that nothing in this plugin will create a performance problems, so I guess this can be implemented completely in Lua.

chdoc avatar Dec 11 '23 13:12 chdoc