Bay 12 Games Forum

Please login or register.

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

Author Topic: Construction Helper [Update: "designation-like" support for constructions]  (Read 27612 times)

expwnent

  • Bay Watcher
    • View Profile
Re: Construction Helper [Update: "designation-like" support for constructions]
« Reply #15 on: December 22, 2012, 11:50:35 am »

Great stuff! I'd really like a feature where you can designate constructions out in open space, though. It would be really handy for megaproject planning.
Logged

nbp

  • Bay Watcher
    • View Profile
Re: Construction Helper [Update: "designation-like" support for constructions]
« Reply #16 on: December 22, 2012, 12:22:28 pm »

Great stuff! I'd really like a feature where you can designate constructions out in open space, though. It would be really handy for megaproject planning.

To be able to designate and entire structure, tens of stories tall, and to let the dwarves go about their work without constant hovering micromanagement would be amazing.
Logged

falconne

  • Bay Watcher
    • View Profile
Re: Construction Helper [Update: "designation-like" support for constructions]
« Reply #17 on: December 23, 2012, 07:11:04 am »

I've just updated the plugin with a new version that does a better check for where constructions can be placed in rectangular selection mode. The previous version disallowed some valid placement options, such as in open space that's orthogonally adjacent to a valid floor.

Please download the new version (v0.5). If you notice the plugin disallow any other valid tiles, or try to place constructions where it shouldn't, do let me know.

Great stuff! I'd really like a feature where you can designate constructions out in open space, though. It would be really handy for megaproject planning.

Yes I do want to look at that too. I'll have to try it out and see if that breaks anything. This would also require suppressing the job cancellation spam that an unreachable construction will generate, as well as a routine to regularly unsuspend them.
Logged
Utility plugins for DFHack, for improving Dwarf Fortress' user interface.

expwnent

  • Bay Watcher
    • View Profile
Re: Construction Helper [Update: "designation-like" support for constructions]
« Reply #18 on: December 23, 2012, 10:39:02 am »

I don't think it would. You can designate a small number of constructions in open space by constructing wide rectangles, and that works fine. I think the game can handle that sort of thing.
Logged

falconne

  • Bay Watcher
    • View Profile
Re: Construction Helper [Update: "designation-like" support for constructions]
« Reply #19 on: December 23, 2012, 08:50:54 pm »

Looks like there's still a limitation in the plugin... it won't build floors in open space that is more than one tile away from an existing floor, even if part of your selection is over valid building spots. I'll fix that after work today.

I don't think it would. You can designate a small number of constructions in open space by constructing wide rectangles, and that works fine. I think the game can handle that sort of thing.

Yeah the game will probably deal with it. The tricky part is that I won't be able to make use of the game's material selection dialog; to invoke that I have to place a construction on a valid spot so the game can do it's pathing calculations. I could try to find a dummy spot nearby, but that's hacky and unreliable. I'd need to re-implement the material selection menu myself (and I'm not entirely sure what qualifies items to be building materials) and also create a rough distance calculation algorithm (I might wait for your pathing routines to be finished for that).
Logged
Utility plugins for DFHack, for improving Dwarf Fortress' user interface.

expwnent

  • Bay Watcher
    • View Profile
Re: Construction Helper [Update: "designation-like" support for constructions]
« Reply #20 on: December 23, 2012, 11:05:58 pm »

The pathing stuff does at least almost work if you wanted to get started. I won't be able to really work on it until early January.
Logged

falconne

  • Bay Watcher
    • View Profile
Re: Construction Helper [Update: "designation-like" support for constructions]
« Reply #21 on: December 23, 2012, 11:29:14 pm »

I might do that... it will be more accurate than using linear distance anyway.

How optimized would you say it is currently? The screen would need to calculate a path for every possible building material in the fort, which could be thousands of items. This can be cut down of course, since I can use the same value of all items in any given stockpile and for items that are in close proximity to each other. But this probably still leaves a lot of items to go through.
Logged
Utility plugins for DFHack, for improving Dwarf Fortress' user interface.

expwnent

  • Bay Watcher
    • View Profile
Re: Construction Helper [Update: "designation-like" support for constructions]
« Reply #22 on: December 24, 2012, 10:45:04 am »

It's fast. My only concern at this point is correctness. I don't know of anything specifically wrong with it, but I haven't tested it incredibly throroughly. And there's no documentation whatsoever.
Logged

falconne

  • Bay Watcher
    • View Profile
Re: Construction Helper [Update: "designation-like" support for constructions]
« Reply #23 on: December 25, 2012, 08:49:08 am »

I've just uploaded a new version (v0.6) that fixes the limitation with extending the selection over open space.

This version also enables complete unconnected open space construction designation as discussed above (so you don't have to be connected to any existing floor tile - you can place it against floor tiles that will exist in the future). I've also enabled this functionality for stairs and ramps, which means you should be able to pre-designate a multi-level structure that the dwarves will be able to traverse as they build the necessary routes.

Like with rectangular select, this feature is not enabled by default; there is a new option, toggled with "o" (Enable Open Placement), that will appear on the construction menu to allow this functionality. This screenshot shows some walls and floors designated with this option turned on, that would not be possible to designate in one go in vanilla (the black tiles are pending floor designations):



While the plugin can manually place construction designations anywhere (which is how I can allow open space designation), it's only possible to invoke the material selection menu by letting the base game do it, which requires a valid tile a construction can be placed on. If your designation includes at least one valid tile, the plugin will use this as an anchor point to invoke the materials menu from. However, when the designation is completely in open space and there are no connections to an already built construction, this is not possible. What the plugin will do is perform a search, starting from the first corner of your selection and spiralling out inside a 11x11 square, going up to 4 z-levels down, to find a valid tile it can use for this purpose. No construction will be placed on this anchor point; it' just being used to invoke the menu.

For this reason, while placing unconnected designations, you may notice when you get to the materials selection screen the cursor has moved to a location that is not in your selection, possibly even on a different z-level if you're designating a multi-storey structure. Don't worry about that, there won't be anything built there. Once you have selected the materials the interface will refresh back at your original cursor location.
« Last Edit: December 25, 2012, 09:03:02 am by falconne »
Logged
Utility plugins for DFHack, for improving Dwarf Fortress' user interface.

expwnent

  • Bay Watcher
    • View Profile
Re: Construction Helper [Update: "designation-like" support for constructions]
« Reply #24 on: December 28, 2012, 10:15:56 pm »

Fantastic!
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: Construction Helper [Update: "designation-like" support for constructions]
« Reply #25 on: December 30, 2012, 11:02:32 am »

I noticed that in the most recent version, you can't designate constructions out in space if the tiles have not been allocated.

Add a

Code: [Select]
Maps::ensureBlockAt(pos)
or some simple variation at

https://github.com/Falconne/dfhack/blob/automaterial/plugins/automaterial.cpp#L548

and that should fix the problem. I would try it myself and push a commit, but I'd have to go back and make a proper branch for it from the previous release and recompile everything which takes me 15 minutes on my weak laptop.
Logged

falconne

  • Bay Watcher
    • View Profile
Re: Construction Helper [Update: "designation-like" support for constructions]
« Reply #26 on: December 30, 2012, 05:13:11 pm »

Ah ok, thanks. I didn't know about the map blocks having to be allocated. Is it something the game does to save memory, only allocating map blocks as you start building nearby?
Logged
Utility plugins for DFHack, for improving Dwarf Fortress' user interface.

expwnent

  • Bay Watcher
    • View Profile
Re: Construction Helper [Update: "designation-like" support for constructions]
« Reply #27 on: December 30, 2012, 08:39:02 pm »

Sky blocks are unallocated until the game has a reason to allocate them. Or if DFHack asks the game nicely to do so.

But yes, it's to save on memory usage.
Logged

Aerval

  • Bay Watcher
    • View Profile
Re: Construction Helper [Update: "designation-like" support for constructions]
« Reply #28 on: December 31, 2012, 08:13:53 am »

2 things:

1. Wow, another cool plug-in by falconne, especially the advanced version is super useful. This time I'll defenetly name the firstborn dwarf in my next fortress after you.

2. You can allocate blocks with dfhack? Why did nobody tell me about that? This super useful when "painting" fortresses with tiletypes. Oh man, how much time could that have saved me ???
Logged

falconne

  • Bay Watcher
    • View Profile
Re: Construction Helper [Update: "designation-like" support for constructions]
« Reply #29 on: January 01, 2013, 01:29:23 am »

I've just uploaded a new version (0.7) which allocates sky blocks if required and also includes a fix to allow stairs to be designated on top of each other in open space.
Logged
Utility plugins for DFHack, for improving Dwarf Fortress' user interface.
Pages: 1 [2] 3 4 5