Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[quickfort] Stockpile and zone support #2974

Closed
myk002 opened this issue Mar 5, 2023 · 1 comment · Fixed by DFHack/scripts#728
Closed

[quickfort] Stockpile and zone support #2974

myk002 opened this issue Mar 5, 2023 · 1 comment · Fixed by DFHack/scripts#728
Assignees

Comments

@myk002
Copy link
Member

myk002 commented Mar 5, 2023

The most important missing feature of quickfort today is stockpile placement and configuration. Placement is done by place mode, and should not be too difficult to update on its own. However, stockpile configuration is done in query blueprints, and is a greater challenge.

query and config blueprints are "freeform keystroke repeaters" -- you could have them reproduce any key sequence. This was fine when everything could be done with the keyboard. In v50, it is a great liability.

I propose we deprecate query and config modes entirely (along with keystroke aliases in general) and move stockpile configuration into place mode, introducing a DSL for configuration. This approach has already been proven to work with the existing zone blueprint format, where you can set zone properties as you declare the zones.

All existing logic in query blueprints would need to be migrated, but given the change in the operating environment, I don't think this is avoidable. We can keep compatibility with existing place blueprints, though, with simple "all or nothing" category enablement.

The DSL could be based on the current (successful) keystroke alias library, using a similar vocabulary. e.g.:

f{plants}(10x10)
f{forbid plants; forbid tallow; forbid dye}(4x7)
pd{bronzeweapons; permit steelweapons, forbid masterworkweapons; forbid artifactweapons}

or more formally:

<stockpile-config> ::= "{" <commands> "}"
<commands> ::= <command> | <command> ";" <commands>
<command> ::= <name> | "permit" <name> | "forbid" <name>

where <name> is the name of a saved stockpile config that the stockpile plugin can apply to the given stockpile. stockpile will need to be extended to add ("permit") or subtract ("forbid") stockpile settings in addition to just overwriting the config (when the <name> is given without a command prefix).

We would also need to create all these library stockpile configs and make them accessible.

@myk002
Copy link
Member Author

myk002 commented Mar 5, 2023

Project plan

  • create stockpile config library, covering all existing keystroke aliases
  • implement reading library stockpile configs from a different directory (same structure as orders, though we may want to consider making the "library/" prefix optional)
  • implement "permit" and "forbid" stockpile commands
  • replace alias guide with stockpile configuration guide (very similar content)
  • enable place-mode in quickfort
  • parse new place-mode text syntax in quickfort and use stockpiles to apply
  • convert dreamfort blueprints to use new syntax
  • remove dreamfort query and config blueprints (keep unmigrated functionality (like QSP logic) in "ignore" blueprints)
  • update dreamfort walkthrough
  • remove query and config modes from quickfort
  • update quickfort blueprint creation guide with new syntax
  • update dreamfort case study
  • update blueprint to use new place mode syntax if it detects that the stockpile has a name that matches an available saved stockpile config (add --ignore-stockpile-config option to bypass this new default)
  • enable place mode in gui/blueprint and surface stockpile config option

Next steps

We'll need replacements for other "query" and "config" use cases:

  • create a way to automate quantum stockpiles. a new "hauling" mode?
  • create stockpile links (can be integrated into "place" mode)
  • name buildings (can be integrated into "build" mode)
  • name zones (can be integrated into "zone" mode)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant