Bay 12 Games Forum

Dwarf Fortress => DF Suggestions => Topic started by: Derakon on April 18, 2008, 07:25:00 pm

Title: Lazily claim items for move-to-stockpile tasks
Post by: Derakon on April 18, 2008, 07:25:00 pm
I frequently find myself in the situation that I have an item that is marked for moving to a stockpile which I want to use instead for some other task. For example, I've just made some coke, and I want to use that coke to run a forge, but the coke is marked for transport to my bar/block stockpile, so I can't use it until it's moved to the stockpile. Or I put a pump in the wrong place; I can deconstruct the pump, but until its component pieces have been put back in the relevant stockpiles, I can't use the pump.

The really annoying thing about this is that there tends to be dozens of move-to-stockpile tasks ready at any given time, so it frequently takes a very long time for my dwarves to get around to moving the stuff I actually care about. The only recourse I have is to remove the relevant stockpile, queue up the construction/crafting task, and then re-create the stockpile, which has the obviously undesirable side-effect of canceling all the other move-to-stockpile tasks I have queued up that I actually want finished. . The ideal behavior would be that move-to-stockpile jobs wouldn't claim items until a dwarf takes the task. At that point, if the item isn't available any more, the job should be cancelled.

Edit: note that the task to create the relevant construction doesn't claim the relevant materials until a dwarf takes the task...if I recreate the stockpile before construction actually starts, then the stockpile will claim the item!

[ April 18, 2008: Message edited by: Derakon ]

Title: Re: Lazily claim items for move-to-stockpile tasks
Post by: Lyrax on April 18, 2008, 07:45:00 pm
Get more peasants.  I agree that this would be really, really nice though.  I've run into the same problem many a time.
Title: Re: Lazily claim items for move-to-stockpile tasks
Post by: PresidentEvil on April 20, 2008, 07:45:00 am
No, the problem he has is that items are claimed by a move job long before any dwarf actually starts moving them. He's suggesting that items don't get claimed until the dwarf takes a job. This would, I believe, cause less peasents to be required.
Title: Re: Lazily claim items for move-to-stockpile tasks
Post by: Jay on April 20, 2008, 10:44:00 am
Yeah, there's no need for it to get TSK'ed until somebody's actually, you know, going to take it.
Title: Re: Lazily claim items for move-to-stockpile tasks
Post by: Align on April 20, 2008, 02:08:00 pm
I thought that was already the case.
Title: Re: Lazily claim items for move-to-stockpile tasks
Post by: Mikademus on April 20, 2008, 02:17:00 pm
I take it we're basically talking about hauling here? So you're suggesting that the closest thing to be hauled is selected, and the closet appropriate pile is targeted? Sounds good to me!

This will also have the spin-off bonus of optimising runs, so that if there's anything to haul from the stockpile being delivered to, that will be the next job. This would be very good for moving stuff to and from the trading depot.

This system would really work best in conjunction with a job priority system, though, so some tasks or some special hauls will take precedence.

Title: Re: Lazily claim items for move-to-stockpile tasks
Post by: Derakon on April 20, 2008, 02:25:00 pm
quote:
Originally posted by Mikademus:
<STRONG>I take it we're basically talking about hauling here? So you're suggesting that the closest thing to be hauled is selected, and the closet appropriate pile is targeted? Sounds good to me!</STRONG>
Actually, I'm talking about the fact that once an item has been marked to be moved to a stockpile, it can't be used for anything else until it is already in that stockpile. It can't be used to build things, and if it's in the way of a building, it can't be moved. And items are claimed for being moved to stockpiles as soon as the item is available, assuming there is room in the stockpile.
Title: Re: Lazily claim items for move-to-stockpile tasks
Post by: Tayrin on April 20, 2008, 02:33:00 pm
When you want to use an item that's already tasked for another job, do the following:

Edit: Of course, this won't work well if it's not a task which will immediately claim the item, but it works fine for buildings and constructions and such.

[ April 20, 2008: Message edited by: Tayrin ]

Title: Re: Lazily claim items for move-to-stockpile tasks
Post by: Derakon on April 20, 2008, 03:19:00 pm
quote:
Originally posted by Tayrin:
<STRONG>Edit: Of course, this won't work well if it's not a task which will immediately claim the item, but it works fine for buildings and constructions and such.</STRONG>
In fact, it won't work for buildings. As a simple exercise, try this:

* Embark with some stone in your wagon.
* Set up a stone stockpile at least as large as the amount of stone you embarked with
* Mark a workshop to be constructed from that stone
* Unpause.
* Set a dwarf to do no hauling and to have the relevant labor needed to make the shop

The dwarf will cancel the workshop as the item to be used in making the shop is claimed by the stockpile.

Now, this might work for making walls; I haven't checked. But it's certainly the case that workshops don't claim their component materials until a dwarf starts making them.

Title: Re: Lazily claim items for move-to-stockpile tasks
Post by: Tayrin on April 20, 2008, 03:33:00 pm
Oops. Seems I should've double-checked that it'd work with buildings. I confirmed that it worked with constructions just before I posted, but not with buildings. Sorry about that; thanks for the correction.

Edit: Actually, the particular test I did seems to work with buildings, too. I think I just didn't do enough tests in different circumstances regarding stockpiles. Oh well.

Edit2: By the way, Derakon, did you actually do the part I mentioned about forbidding the item? The forbidding cancels the task of the item, so it won't work correctly if you don't do that.

[ April 20, 2008: Message edited by: Tayrin ]

Title: Re: Lazily claim items for move-to-stockpile tasks
Post by: Puzzlemaker on April 20, 2008, 03:44:00 pm
You know what else would solve this?  A better hauling system.  Dwaves should be able to haul more then 1 item at a time.
Title: Re: Lazily claim items for move-to-stockpile tasks
Post by: Thassa on April 20, 2008, 08:35:00 pm
This would depend a lot on the size of the item.  With seeds of course a single dwarf should be able to clear the entire dining room/kitchens area in a single pass.  But for floodgates and doors you would need some kind of cart or something, before you could haul more then one at a time.
Title: Re: Lazily claim items for move-to-stockpile tasks
Post by: Derakon on April 20, 2008, 10:29:00 pm
Yet another example of how absurd this gets: I have a smelter running the following queue:

* Make iron bars
* Make iron bars
* Make pig iron bars
* Smelt coke from lignite
* Make steel bars

He cancelled the "make pig iron bars" because he didn't have any iron bars. There were two in his workshop, both TSKed to move to the bar stockpile, six squares away.