Bay 12 Games Forum

Please login or register.

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

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

myk

  • Bay Watcher
    • View Profile
Re: DFHack script: quickfort
« Reply #30 on: August 13, 2020, 01:35:59 am »

Hehe yeah, the more I program in C++, the more I like C ^_^.

I'm still working on buildingplan integration. I have it working for the furniture types that buildingplan already supports, which is cool, but I have some questions about how I'm "Lua-izing" the plugin before I start modifying it further. So while I'm waiting for some feedback on PRs, I worked on some packaging functionality.

Specifically, I'm working on meta blueprints, that is, blueprints that run a series of other blueprints. I'm finding that many blueprints follow this pattern:
- apply dig
- wait for miners to dig
- apply build
- apply place
- apply query to configure stockpiles
- wait for buildings to get built
- apply query to configure rooms

Those three "apply"s in the middle might as well get done in one command instead of three. A meta blueprint can encode that sequence.

This requires a number of design choices. How do you address parts of a blueprint? How do you make that addressing scheme usable with both .csv and .xlsx files? I came up with a labeling syntax that I think will do the trick, similar to the cursor offset notation. I also added the ability to have multiple blueprints in a single file/sheet. This way sets of blueprints can be packaged into a single .csv file and be addressable by a meta blueprint in that same file. I decided not to allow meta blueprints to access other files because that opens a packaging can of worms -- it's much easier to verify that a meta blueprint is valid if all the data is in a single file. You can still keep blueprints in separate spreadsheet sheets, of course, so it shouldn't make blueprint editing any more complex.

Eventually meta blueprints could maybe script repetitions and transformations of blueprints, but just getting sequencing done will be useful enough for now :-)
« Last Edit: August 13, 2020, 02:03:05 pm by myk »
Logged

myk

  • Bay Watcher
    • View Profile
Re: DFHack script: quickfort
« Reply #31 on: August 16, 2020, 02:03:58 am »

Ok, more progress. I'm pretty happy with how meta blueprints came out. You can now apply a bunch of blueprints with a single command. I also implemented a "hidden()" marker for blueprints that are managed by meta blueprints so the lower-level blueprint doesn't clutter up the quickfort list output.

Also done is a #zone mode for placing zones, similar to the existing #place mode for stockpiles.

BTW, the user manual is now up! For now, you can view it here, but eventually we'd like to integrate it into the DFHack docs on https://docs.dfhack.org/. I've written explanations for all the features I've completed so far (including a few which are done but haven't been merged yet). Please give it a read and tell me if anything isn't clear!

I've been working on a large-scale end-to-end example to stress test all these features, and the biggest issue I'm running into is complexity management. You have a long list of blueprints in quickfort list. Which one do you apply next? At what point should you run quickfort orders to queue up the manager orders so you can apply build blueprints? And which "meta" blueprints refer to build blueprints such that running quickfort orders is worthwhile?

It makes me think more about blueprint packaging and user experience. Now that we have meta blueprints to manage all the lower-level blueprints, do we need something even higher level than meta?

One feature I just added was the ability for a blueprint to output a message when it completes. For example, if you require a manual action after the blueprint runs, this message could give you details. For example, if a #zone blueprint just designated a pasture, the message could remind you to assign animals to it. Perhaps a series of meta blueprints with "next step" messages would be a good way to keep track of what's next. I'll try that with my example fort (which has 23 steps) and see how it goes.
« Last Edit: August 16, 2020, 02:24:17 am by myk »
Logged

indyofcomo

  • Bay Watcher
    • View Profile
Re: DFHack script: quickfort
« Reply #32 on: August 18, 2020, 01:12:31 pm »

PTW. This is great. I just recently started my first serious attempt at using quickfort. Didn't know this was being done.

I came to the forum to ask a question about python quickfort, but I'll ask here. I'm still reading through the manual at the moment, but does your quickfort support comments? Like "# This is a comment" in a cell?
« Last Edit: August 18, 2020, 01:14:37 pm by indyofcomo »
Logged

indyofcomo

  • Bay Watcher
    • View Profile
Re: DFHack script: quickfort
« Reply #33 on: August 18, 2020, 03:29:25 pm »

Oh, also: does this work with dfhack planner?
Logged

myk

  • Bay Watcher
    • View Profile
Re: DFHack script: quickfort
« Reply #34 on: August 18, 2020, 06:26:51 pm »

Yes, it supports comments, and if by "planner" you mean buildingplan, then yes, if buildingplan supports a building type, the quickfort script will use buildingplan to manage the building.

Once I get the current script fully merged, I plan to extend buildingplan to support more building types.
Logged

indyofcomo

  • Bay Watcher
    • View Profile
Re: DFHack script: quickfort
« Reply #35 on: August 18, 2020, 08:13:11 pm »

that's great, myk! I didn't want to have to construct 200+ beds before running my #build :)
Logged

myk

  • Bay Watcher
    • View Profile
Re: DFHack script: quickfort
« Reply #36 on: August 19, 2020, 03:54:38 pm »

I've completed the last two major development milestones! There is now a small library of example blueprints, including the large-scale "dreamfort" end-to-end example. There is also now a GUI, so you can use quickfort from a pop-up dialog instead of the command line. Once it all clears review and gets merged, it will be available for actual use! I'm really looking forward to feedback so we can smooth out any remaining rough edges and implement features that people come up with.
« Last Edit: August 20, 2020, 05:23:12 pm by myk »
Logged

Zalthor

  • Bay Watcher
    • View Profile
Re: DFHack script: quickfort
« Reply #37 on: August 21, 2020, 03:51:38 am »

You madman, well done! This community is really inspiring, at times.
Logged

myk

  • Bay Watcher
    • View Profile
Re: DFHack script: quickfort
« Reply #38 on: August 21, 2020, 04:43:03 pm »

Glad to be a part of it : )

There are still quite a few PRs to submit. I'm getting it merged feature by feature, and I don't want to overload lethosor with too many PRs at once (the quickfort script is almost 4000 lines long at this point). All the required C++ code has been merged, though, so if you're building DFHack from source and want to try quickfort, you can download it here. Just extract the file in your hack/scripts directory. It contains the quickfort.lua entrypoint (which is mostly just help text) and the actual script logic in internal/quickfort/*.lua. It will be much easier, of course, to wait until it's included in an actual release (I'm hoping it will all be merged by the upcoming -r3), but I'm posting the code in case anyone is eager to try it out.
Logged

Zalthor

  • Bay Watcher
    • View Profile
Re: DFHack script: quickfort
« Reply #39 on: August 22, 2020, 06:44:38 am »

There are still quite a few PRs to submit. I'm getting it merged feature by feature, and I don't want to overload lethosor with too many PRs at once (the quickfort script is almost 4000 lines long at this point). All the required C++ code has been merged, though, so if you're building DFHack from source and want to try quickfort, you can download it here. Just extract the file in your hack/scripts directory. It contains the quickfort.lua entrypoint (which is mostly just help text) and the actual script logic in internal/quickfort/*.lua. It will be much easier, of course, to wait until it's included in an actual release (I'm hoping it will all be merged by the upcoming -r3), but I'm posting the code in case anyone is eager to try it out.
So the download is if one would like to compile dfhack? Do you or anyone else have a post-compiled version we could drop in just to see how it works?
Logged

myk

  • Bay Watcher
    • View Profile
Re: DFHack script: quickfort
« Reply #40 on: August 22, 2020, 07:56:29 am »

ah, of course -- you can pick up a pre-compiled binary at https://dfhack.org/builds/ -- the most recent "Unstable automated build". Here's the direct link

then just extract the quickfort script on top of that.
« Last Edit: August 22, 2020, 02:16:40 pm by myk »
Logged

Zalthor

  • Bay Watcher
    • View Profile
Re: DFHack script: quickfort
« Reply #41 on: August 22, 2020, 07:59:00 am »

Ah, okay, I thought that your files had to be part of the compilation process. Thanks for all your hard work, again!
Logged

Zalthor

  • Bay Watcher
    • View Profile
Re: DFHack script: quickfort
« Reply #42 on: August 22, 2020, 02:31:08 pm »

I've completed the last two major development milestones! There is now a small library of example blueprints, including the large-scale "dreamfort" end-to-end example. There is also now a GUI, so you can use quickfort from a pop-up dialog instead of the command line. Once it all clears review and gets merged, it will be available for actual use! I'm really looking forward to feedback so we can smooth out any remaining rough edges and implement features that people come up with.
Is the gui present in the build that you linked? If so, how it is accessed? Perhaps I'm being blind, but I see no reference to it anywhere.
Logged

myk

  • Bay Watcher
    • View Profile
Re: DFHack script: quickfort
« Reply #43 on: August 22, 2020, 02:34:59 pm »

Does 'quickfort gui' not work? If not, I must have saved from the wrong branch :-\ Will fix when I get home. Btw, full command documentation will be on docs.dfhack.org once the script is merged, but for now you can read it in the top comment in quickfort.lua.
Logged

Zalthor

  • Bay Watcher
    • View Profile
Re: DFHack script: quickfort
« Reply #44 on: August 22, 2020, 02:49:30 pm »

Does 'quickfort gui' not work? If not, I must have saved from the wrong branch :-\ Will fix when I get home. Btw, full command documentation will be on docs.dfhack.org once the script is merged, but for now you can read it in the top comment in quickfort.lua.
It does not, it only reprints the usage commands. Also, the documention does not mention anything about the GUI, I believe. I did a whole control-f and everything.
Logged
Pages: 1 2 [3] 4 5 ... 29