On
Eternal Suggestion Voting.
OK, I'm now continuing my current theme of taking combining small gripes and requests for changes into a massive overhaul of a major game system so that the game can overall become more realistic and flexible and immersive. Today's topic: Finding ways to have a little more control over those little buggers, while at the same time not having to micromanage them so darn much.
In a sense, this is a combination of two other suggestions. The current second most popular suggestion on the ESV is the Standing Orders mod. There is another set of suggestions that appears frequently on the boards for requesting meddling in the priorities that dwarves set for completing various jobs, often jobs like meeting with traders.
In another sense, however, this idea also stems a bit from playing games like Final Fantasy XII or Dragon Age, where you can rely upon relatively accessable player-editable scripts to make the micromanagement of your troops a much more simple affair.
I would like to have a system whereby we can create an AI script for your fortress to follow. Preferably in an external utility, such as a text file, which can be imported, (or at least have an export/import saved script system) so that we players have the ability to transfer these scripts between games, creating complex scripts that will serve them at all stages throughout the life of a fortress.
This would also be the "Noob-friendly" aspect of this: Experienced players can upload general-purpose scripts to suppliment the one or two scripts that Toady would likely make part of the vanilla package, and the already-existant "Noob Pack" mods that include setting up init options and installing graphics packs can now also download a variety of "most commonly useful scripts" so that they don't have to muck around in the details.
Of course, if we are doing this by inputting .txt files, there will need to be a routine upon loading a script to scrub any commands that are invalid due to syntax errors, which, in turn, means it needs to have a means of reporting said errors (with at least an in-game pop-up message, not an invisible export to an errorlog.txt that players may not know to check) so that players aren't simply confused by why nothing seems to be working.
At its most basic, this should be a way of prioritizing what labors a dwarf should complete first. Gone will be the complaints of dwarves set to meet with diplomats or caravans ignoring that in favor of making some barrels instead or cleaning up some mud stains because you forgot to turn off every other possible labor the dwarf might want to prefer over the one you set for it.
The script can basically just be an ordered list of actions that the dwarves will take, arranged by their priority. This is, most likely, what we already have in the game in a hardcoded fashion, so I wouldn't expect making this part scriptable would be terrifically difficult.
The scripting, as I said, should be a combination of the "Standing Production Orders" scripting and a related Dwarven individual AI script. The Standing Production Orders already, as described in the ESV, has implied that it can use variables that draw information out of sources like the stocks screen to figure when to add new jobs to job queues, as well as using boolean and comparative logic operations.
This would allow you to say that you would want some job, like, say, brewing, to be a higher priority job than, say, carpentry under normal conditions, however, when "EMPTY_BARREL < 4", then carpentry would be thrust up as a higher priority so that they would temporarily attempt to go out making more barrels first, and you could potentially put a "WOOD < 2" task to go woodcutting in along with it, to help dwarves always be part of trying to solve supply-chain problems, rather than simply quitting when they run out of materials, and generating job cancellation spam.
Another potential use for this would be, again, with the problems people have with dwarves needing to meet with diplomats or the like running off to eat and then sleep and then drink before meeting. You could have priorities set to voluntarily send a dwarf off to eat before he is seriously hungry under certain conditions. Thus, they would consider eating when their hunger meter is more than half full (probably best to measure these things percentage-wise, or with some sort of set, text-descriptive level, where "peckish" means half-hungry) more important than most normal functions, but then consider meeting with diplomats more important than food until it hits the critical point where dwarves will always consider their hunger the most important thing to them.
While this could be used with just the fairly basic steps above and make a wonderful addition to the game, I believe that it could be potentially used to greatly expand certain game mechanics.
Consider, if you will, a "powergoal" of having a dwarven combat medic. Not a real combatant, just a dwarf who is set to follow a squad, generally keeping out of danger, until a soldier dwarf becomes critically injured. The medic could then try to rush in (hopefully with some script from the other soldiers to try to provoke the agressor onto themselves) and drag the wounded dwarf to a triage center. There, dwarven medics could have scriptable priorities over what maladies (or important persons, such as champions and legendaries) to treat first.
This would require the ability to script in the ability to either be a part of a squad without actually being a "soldier" (which requires intigration with the military interface), or the ability to use in the scripting language a way to simply select squads to follow by number with a "when activated", having some control over whether or not dwarves run from enemies by default, or charge to their destinations regardless, having a "follow X tiles behind" syntax, and syntax for recognizing statuses of other dwarves (such as noticing when they are poisoned, unconscious, have significant wounds to specific locations, or other problems), a "taunt enemy" command, and a command to be able to haul injured dwarves to treatment, although that is already an extension of what doctors do, anyway, and perhaps something I am not noticing right now.
Doing even more in conjunction with the military interface (which might benefit from scripting and import/export abilities, like haivng the ability to
import and export uniform data or training schedules, so that the scripting can be less time-consuming), we might even be able to finally get some manner of control over military tactics. Instead of charging enemies, we might have the ability to set up certain dwarves to be "wingmen" who stay in a certain formation (2 tiles to the left side of the squad leader's facing) until battle is met, who will not rush out to engage until fellow warriors are amassed, who will disengage on anything besides death or fear, so that they do not fight even past being tired and wounded and dying of thirst against creatures like Bronze Collosi that refuse to die.
By extension, we could also make dwarves
automatically enter and exit burrows depending on certain conditions, such as making woodcutters no longer be allowed in their "outside" burrows when seiges take place. (Like with squads, for this to happen in scripts that have no direct access to game data, you would need to have some ability to designate burrows by number, or the ability to make a custom string on burrows that scripts can do a search for.) We can then automate the process, so that the barrelmaker that is scripted to start cutting wood when it runs out will suddenly be changed from a burrow that includes only his workplace, living quarters, and other general public areas could then be put into a burrow that includes areas to chop wood, and then a script line puts them back to their original burrow when the lack of wood case is no longer true.
EDIT: Addendum that I forgot in first posting: I have been considering including in this the ability to let the scripts automatically change labor settings, as well.
On the "pros" side, it would give more power to the player who could set up more sophisticated scripts because of it, and giving players options they don't have to use is never really a bad thing.
However, n one sense, you could use the previous scripting and just not give a job any priority at all except under special conditions, which would effectively replicate the labor being disabled, anyway. Making scripts change labors could also lead to players trying to struggle against their own scripts if they need to make more dynamic changes (although simply switching to a different script would be a better solution to that).