Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Lazily claim items for move-to-stockpile tasks  (Read 1364 times)

Derakon

  • Bay Watcher
    • View Profile
Lazily claim items for move-to-stockpile tasks
« 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 ]

Logged
Jetblade - an open-source Metroid/Castlevania game with procedurally-generated levels

Lyrax

  • Bay Watcher
    • View Profile
Re: Lazily claim items for move-to-stockpile tasks
« Reply #1 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.
Logged
Witty

Comedian
Dabbling Pacifier
Dabbling Judge of Intent
Skilled Forum Poster

PresidentEvil

  • Bay Watcher
    • View Profile
Re: Lazily claim items for move-to-stockpile tasks
« Reply #2 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.
Logged
I will mod in plastic as a resource.  I will then tweak the Dwarven civ entry so that coins are only made out of plastic, and are called "credit cards".
I will make dwarves purchase things with bushels of credit cards.  It will be a mockery of both systems.
It will be stupid.  But it will be gloriously stupid.

Jay

  • Bay Watcher
  • ☼Not Dead Yet☼
    • View Profile
Re: Lazily claim items for move-to-stockpile tasks
« Reply #3 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.
Logged
Mishimanriz: Histories of Pegasi and Dictionaries

Align

  • Bay Watcher
    • View Profile
Re: Lazily claim items for move-to-stockpile tasks
« Reply #4 on: April 20, 2008, 02:08:00 pm »

I thought that was already the case.
Logged
My stray dogs often chase fire imps back into the magma pipe and then continue fighting while burning and drowning in the lava. Truly their loyalty knows no bounds, but perhaps it should.

Mikademus

  • Bay Watcher
  • Pirate ninja dwarves for great justice
    • View Profile
Re: Lazily claim items for move-to-stockpile tasks
« Reply #5 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.

Logged
You are a pirate!

Quote from: Silverionmox
Quote from: bjlong
If I wanted to recreate the world of one of my favorite stories, I should be able to specify that there is a civilization called Groan, ruled by Earls from a castle called Gormanghast.
You won't have trouble supplying the Countess with cats, or producing the annual idols to be offerred to the castle. Every fortress is a pale reflection of Ghormenghast..

Derakon

  • Bay Watcher
    • View Profile
Re: Lazily claim items for move-to-stockpile tasks
« Reply #6 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.
Logged
Jetblade - an open-source Metroid/Castlevania game with procedurally-generated levels

Tayrin

  • Bay Watcher
    • View Profile
Re: Lazily claim items for move-to-stockpile tasks
« Reply #7 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:

  • Press [Space] to pause the game
  • Loo[k] at the item and [f]orbid it
  • Un[f]orbid the item
  • Use the item for some other task
  • Press [Space] to unpause the game

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 ]

Logged

Derakon

  • Bay Watcher
    • View Profile
Re: Lazily claim items for move-to-stockpile tasks
« Reply #8 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.

Logged
Jetblade - an open-source Metroid/Castlevania game with procedurally-generated levels

Tayrin

  • Bay Watcher
    • View Profile
Re: Lazily claim items for move-to-stockpile tasks
« Reply #9 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 ]

Logged

Puzzlemaker

  • Bay Watcher
    • View Profile
Re: Lazily claim items for move-to-stockpile tasks
« Reply #10 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.
Logged
The mark of the immature man is that he wants to die nobly for a cause, while the mark of the mature man is that he wants to live humbly for one.

Thassa

  • Bay Watcher
    • View Profile
Re: Lazily claim items for move-to-stockpile tasks
« Reply #11 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.
Logged
Dwarf Fortress players: Coming up with solutions for problems that haven't been implemented yet. 

Derakon

  • Bay Watcher
    • View Profile
Re: Lazily claim items for move-to-stockpile tasks
« Reply #12 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.

Logged
Jetblade - an open-source Metroid/Castlevania game with procedurally-generated levels