Bay 12 Games Forum

Please login or register.

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

Author Topic: DFHack: quickfort | buildingplan | blueprint | blueprints/library  (Read 92308 times)

myk

  • Bay Watcher
    • View Profile
Re: DFHack script: quickfort
« Reply #45 on: August 22, 2020, 04:12:50 pm »

Ok I must have pulled the wrong branch. Sorry! I'll fix tonight, but if you like, you can fork my GitHub repo and merge all my feature branches. It's all up there, just not all in one place. Make a local branch and merge in all branches that start with quickfort_

edit: I uploaded a new version of quickfort.7z. The problem was that I forgot to merge the quickfort_gui branch into my own combined branch </facepalm>.

Anyway, it should have a gui now : )
« Last Edit: August 22, 2020, 07:06:56 pm by myk »
Logged

Rogue Yun

  • Bay Watcher
  • Beware of the Carp
    • View Profile
Re: DFHack script: quickfort
« Reply #46 on: August 23, 2020, 11:44:47 am »

I'm just a rather old out of touch DF fart (haven't played DF in about 2 years) so I beg your pardon if I missed seeing this somewhere, but will this eventually be dig priority compatible? d = 4 and if you like replace d with numbers 1-7 to indicate the priority you would like a blueprint dug at? If not I'd like to suggest it for your consideration.
Logged

.:Simple Mood 16x16 ASCII:.
Keep it Simple. Keep it Safe.

myk

  • Bay Watcher
    • View Profile
Re: DFHack script: quickfort
« Reply #47 on: August 23, 2020, 01:33:00 pm »

I actually hadn't heard of dig priorities until now, but it looks very useful. How do you think it could best be integrated into quickfort?
Logged

Rogue Yun

  • Bay Watcher
  • Beware of the Carp
    • View Profile
Re: DFHack script: quickfort
« Reply #48 on: August 23, 2020, 03:04:08 pm »

As I say I'm kind of out of it I don't remember the exact syntax required to design forts and I lost all my old csv files of them... But I'll do my best.

I was thinking along the lines of
Code: [Select]
, , , , ,3, , , , ,
d,d,d,d,d,3,d,d,d,d,d
d,d,d,d,d,3,d,d,d,d,d
d,d,d,d,d,3,d,d,d,d,d
d,d,d,d,d,3,d,d,d,d,d
d,d,d,d,d,3,d,d,d,d,d
d,d,d,d,d,3,d,d,d,d,d
d,d,d,d,d,3,d,d,d,d,d
d,d,d,d,d,3,d,d,d,d,d
d,d,d,d,d,3,d,d,d,d,d
d,d,d,d,d,3,d,d,d,d,d
d,d,3,3,3,3,3,3,3,d,d
 , ,3, , , , , ,3, ,
4,4,2,4,4, ,4,4,2,4,4
4,2,2,2,4, ,4,2,2,2,4
4,2,2,2,4, ,4,2,2,2,4
4,2,2,2,4, ,4,2,2,2,4
4,4,4,4,4, ,4,4,4,4,4

This concept was mostly thought of for editing the CSV file by hand as I don't know how well it could be implemented with export plugins in DF (But you are welcome to try!). Where d would by synonymous with 4 (Cause dig is 4 anyway) and 1 through 7 would be the priority of the dig. Spaces represent where you don't want to dig. The above example (if I've done it right) would clear a path quickly to the bottom of a what will eventually be an 11 by 11 room to construct the rooms and clear the space for the workshops first to quickly get a fort's production up and going.

As for the implementation for the code I'd have to somehow see the code and be lead by the hand to understand it. I know a little python but it's a self taught understanding. I don't know if you would have time for something as silly as that.

Thank you, and I hope that gives some clarity!
Logged

.:Simple Mood 16x16 ASCII:.
Keep it Simple. Keep it Safe.

myk

  • Bay Watcher
    • View Profile
Re: DFHack script: quickfort
« Reply #49 on: August 23, 2020, 05:14:49 pm »

Ok, I read up on priorities at https://dwarffortresswiki.org/index.php/DF2014:Designations_menu. I'm not sure how I missed them before.

Anyway, it looks like they can be set for any kind of designation, not just standard dig. The natural syntax might be the designation letter followed by the priority, that is, d3 or h3 instead of just 3, and the priority number would go before any expansion notation, e.g. d1(20x3). And if no priority is specified, we'd assume 4. This is totally doable. I'll add it to my todo list. You're welcome to take a stab at it too. The code is actually in Lua, not Python, but it's easy to pick up (I didn't know anything about Lua when I started this project). I think the code for this would follow the same pattern as what I have for custom stockpiles that have multiple categories enabled: an _index handler that parses arbitrary text and generates a table entry based on an existing table entry. Check out place.lua or zone.lua in my last PR to see what I mean: https://github.com/DFHack/scripts/pull/185/files
« Last Edit: August 23, 2020, 06:11:10 pm by myk »
Logged

Starver

  • Bay Watcher
    • View Profile
Re: DFHack script: quickfort
« Reply #50 on: August 23, 2020, 08:06:58 pm »

Perhaps assume a bare digit to be "dig, priority <n>", like the suggestion of a bare letter to be "<whatever>, priority 4". Any requirements beyond that (or pedantic specification of the assumption, for at least the better human readability of the 2.5-dimensional data without the overwhelming vision of whitespace 'gaps') need to be char+digit.

(I don't know if there's similar use of Marking and Designate-(All,Auto-mine,etc)...  Perhaps the automine extension, but perhaps not given the purpose to carefully mould rooms, without excess.)


Priorities are sooooo useful, as demonstrated. Especially that trick of slightly raised(/not so depressed) priorities encouraging immediate extension of reach into higher priority 'bubbles' that start to attract workers en mass once encountered.

(Though I would have extended those 3s one further space into the 2s. That final 3 in the doorway reveals three 2s beyond to suck up effort, whereas the 2 is slightly premature and draws in just one worker slightly too quickly for my liking. But that's just me.)

Logged

indyofcomo

  • Bay Watcher
    • View Profile
Re: DFHack script: quickfort
« Reply #51 on: August 24, 2020, 01:25:29 pm »

There's also marking and the auto-dig options.
Logged

Starver

  • Bay Watcher
    • View Profile
Re: DFHack script: quickfort
« Reply #52 on: August 24, 2020, 02:52:33 pm »

(I don't know if there's similar use of Marking and Designate-(All,Auto-mine,etc)...  Perhaps the automine extension, but perhaps not given the purpose to carefully mould rooms, without excess.)


...and as for the Marking.  Well, I sort of imagined that this is some of what quickfort does (apply things when you want them, though you set it up beforehand) so...  Yes, I imagine you could 'quickfortmark' (or quickfort while manually in Mark mode) and then paint Mark-Toggle-Off over it later.

But I'm not really sure of the relative advantages.

Still, always useful to know about, both for user and an dev who is working with Designation stuff.  Up to everyone whether either take advantage of the facility, where available, though. ;)
Logged

lethosor

  • Bay Watcher
    • View Profile
Re: DFHack script: quickfort
« Reply #53 on: August 24, 2020, 09:05:03 pm »

There's also marking and the auto-dig options.
In my opinion, these probably aren't that important to support, at least right now. From what I remember (which could be out of date), auto-dig only works on revealed vein tiles, so I don't see much of a use-case for pre-planned auto-dig designations (since they would most likely do nothing). As for markers, there's a d-M option that you could use to toggle the marker status of some (or all) of a blueprint after it has been applied. I don't expect many cases where people would want fine-grained control over which tiles are just markers, but I suppose there could be some.

I'm not intending to shoot down your suggestions - they're definitely options that could be implemented (and possibly easily, if the relevant pieces are extensible), but they may not be as high-priority (heh) as priorities and other features right now.
Logged
DFHack - Dwarf Manipulator (Lua) - DF Wiki talk

There was a typo in the siegers' campfire code. When the fires went out, so did the game.

myk

  • Bay Watcher
    • View Profile
Re: DFHack script: quickfort
« Reply #54 on: August 24, 2020, 11:07:45 pm »

Marker mode is actually already supported, though I realize I forgot to document it properly in the user manual (added to my TODO list -- edit: documentation PR submitted). add 'm' the beginning of the designation letter to dig the blueprint tile in marker mode. e.g. to dig the outline of a room but leave the interior in marker mode:

Code: [Select]
#dig
d, d, d, d,d
d,md,md,md,d
d,md,md,md,d
d,md,md,md,d
d, d, d, d,d

or, equivalently:
Code: [Select]
#dig
d,d,d,d,d
d,md(3x3),,,d
d, , , , d
d, , , , d
d,d,d,d,d

There is also a global quickfort setting `force_marker_mode` which will apply all blueprint dig tiles in marker mode while it is set to true:

Code: [Select]
[DFHack]# quickfort run important_level.csv
[DFHack]# quickfort set force_marker_mode true
[DFHack]# quickfort run level_i_just_want_to_plan_but_not_dig_right_now.csv
[DFHack]# quickfort reset

setting marker mode in the UI with 'M' won't affect quickfort since it doesn't use the UI to run the blueprint. It designates the tiles directly in DF's memory structures. I probably *could* use the 'M' state as a replacement for the flag, though, if people find that more intuitive.

as lethosor said, auto-dig probably doesn't make sense to support.

Perhaps assume a bare digit to be "dig, priority <n>", like the suggestion of a bare letter to be "<whatever>, priority 4". Any requirements beyond that (or pedantic specification of the assumption, for at least the better human readability of the 2.5-dimensional data without the overwhelming vision of whitespace 'gaps') need to be char+digit.

this sounds good to me. I'll call this the plan.
« Last Edit: August 26, 2020, 10:03:08 pm by myk »
Logged

myk

  • Bay Watcher
    • View Profile
Re: DFHack script: quickfort
« Reply #55 on: August 28, 2020, 01:37:17 am »

This is my current "what's next" short list, though I'm holding off on any more Lua code development while I get the current quickfort code merged into master. I do want to highlight that others are welcome to contribute to this script as well!

  • Dreamfort case study in user manual
  • Configure configurable activity zones (e.g. pit/pond toggle)
  • Enforce rules that buildings have to be sufficiently far from the map edge
  • Dig priorities
  • Respect item filters in buildingplan
  • Support constructions in buildingplan
  • Support all other building types in buildingplan
  • More library blueprints

The case study will be a deep dive into how the library "Dreamfort" set of blueprints is put together. Those blueprints use pretty much every quickfort feature, so the case study can model how to create advanced blueprints using practical examples, as opposed to the simplified "toy" examples currently in the user guide. I'm hoping this will lower the difficulty of authoring a blueprint.

I think the enhancements to buildingplan will also be a game changer. Having designated buildings suddenly disappear because of lack of materials is a confusing and frustrating player experience. The workaround is currently to run quickfort orders first and pre-build the materials, but when buildingplan supports all building/construction types players can designate first and build materials later without issues.

For the last item -- more library blueprints -- I'd love to hear ideas from the players here on what would be a good, generally useful and/or instructive blueprint to have in a standard library. Right now I have Dreamfort, post-embark workshops and stockpiles, exploratory mining patterns, and marker-mode diagonal lines that can be used to find diagonal intersections. What else should we include?
« Last Edit: August 28, 2020, 01:44:00 am by myk »
Logged

Zalthor

  • Bay Watcher
    • View Profile
Re: DFHack script: quickfort
« Reply #56 on: August 29, 2020, 02:12:10 pm »

What else should we include?
The bedroom styles from the old quickfort library provided in the LNP.

Edit: Also, is there some bug with queries, or am I simply not using it correctly? I generate a blueprint in DFHACK, and apply the query blueprint to a set of rooms I've built, but it doesn't apply. No errors appear in the log, so I'm confused.
« Last Edit: August 29, 2020, 02:36:46 pm by Zalthor »
Logged

myk

  • Bay Watcher
    • View Profile
Re: DFHack script: quickfort
« Reply #57 on: August 29, 2020, 06:25:51 pm »

try applying the blueprint with the -v parameter to enable verbose logging. If something unexpected is   happening, that should tell you why.

Are the bedroom blueprints online somewhere I can check them out? Are they from https://github.com/joelpt/quickfort/tree/master/Blueprints ?

Thanks to lethosor, who has been reviewing all my code, the quickfort script was fully merged into the DFHack/scripts master branch. The most up to date code will now always be available in the standard unstable builds.
Logged

Zalthor

  • Bay Watcher
    • View Profile
Re: DFHack script: quickfort
« Reply #58 on: August 29, 2020, 08:00:58 pm »

Are the bedroom blueprints online somewhere I can check them out? Are they from https://github.com/joelpt/quickfort/tree/master/Blueprints ?
No, they're in the ...\LNP\utilities\Quickfort\blueprints folder from the PeridexisErrant's Starter Pack.

I uploaded them separately as well, if you would prefer.

Edit: I attempted the command with verbose logging, and it says that it is applying everything, but then I'm greeted with this blinking, but with no rooms assigned.
« Last Edit: August 29, 2020, 09:14:31 pm by Zalthor »
Logged

myk

  • Bay Watcher
    • View Profile
Re: DFHack script: quickfort
« Reply #59 on: August 29, 2020, 09:29:29 pm »

Ahh, I'm guessing the blueprint plugin is missing the enter at the end: r+ instead of r+&. That's actually something I discussed with the author of the original quickfort (Joel): why did r+ ever work? If you enter that in the ui, you get exactly what you see in your screenshot - the room isn't applied until you hit enter! Joel didn't know why it was functional. it might have been a bug or a side effect of the "choose next available material" algorithm used for buildings.

Since there are probably a lot of blueprints out there that have this, I'll see if I can alias r+ to mean r+&. Thanks for bringing this to my attention!

Until then, put a & at the end and that should get it working.

edit: sent PR#188 to fix this.
« Last Edit: August 30, 2020, 01:36:36 am by myk »
Logged
Pages: 1 2 3 [4] 5 6 ... 29