Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: [Minor] If you can't do it, don't  (Read 751 times)

JT

  • Bay Watcher
  • Explosively Canadian
    • View Profile
    • http://www.jtgibson.ca/df/
[Minor] If you can't do it, don't
« on: March 20, 2007, 05:22:00 pm »

One issue that cropped up in one of my fortresses is that while building up a complicated front entrance, I made the mistake of building a channel linked directly to the river while the dwarves were still mining in a completely enclosed area.  When the channel flooded, those dwarves became trapped in their enclosed area, as the only exit to the enclosed area now had a filled channel of water across it.

I tried to build a bridge across the channel, but the problem was that because this was a miner wolfing run, all of my trapped miners had the architecture task enabled.  So, a trapped miner would look at the bridge and try to build it, then complain that the materials weren't accessible and suspend the construction.

The problem, of course, is that there were still two people that were not trapped in that enclosed area, who had ready access to the materials and who had the architecture task enabled.  But before they could have a chance to build the bridge to rescue their compatriots, the job was claimed and suspended by one of the trapped miners.  I had to explicitly disable architecture on the trapped miners to get the bridge built.

My suggestion is to have a "round robin" style of job claiming, where a job tracks who can attempt the job and who can't.  If a job is checked by someone and they can't perform that job at the moment, they simply ignore that job and the next available dwarf checks that job.  This process repeats itself until one of the following conditions is met:

1) A dwarf successfully accepts the task, or
2) All dwarfs with the required labour task are unable to perform the job, whereupon the job becomes suspended.

[ March 20, 2007: Message edited by: JT ]

Logged
"The very existence of flamethrowers proves that some time, somewhere, someone said to themselves, 'You know, I want to set those people over there on fire, but I'm just not close enough to get the job done.'" --George Carlin

Toady One

  • The Great
    • View Profile
    • http://www.bay12games.com
Re: [Minor] If you can't do it, don't
« Reply #1 on: March 20, 2007, 11:11:00 pm »

I'll note it down.  I think this came up before, so I might already have a note, but I'll make another one.
Logged
The Toad, a Natural Resource:  Preserve yours today!

scjohnno

  • Bay Watcher
    • View Profile
Re: [Minor] If you can't do it, don't
« Reply #2 on: March 21, 2007, 02:03:00 am »

The only problem I can see with this is the potentially huge slowdown when a completely-inaccessible item is checked by 200 dwarves in a row.
Logged

Chthon

  • Bay Watcher
    • View Profile
Re: [Minor] If you can't do it, don't
« Reply #3 on: March 21, 2007, 06:21:00 am »

rarely are all 200 dwarves ready to accept a job all at the same time.  Instead it would usually be about 20 at most.
Logged
''d be perfect if I weren''t so arrogant.

axus

  • Bay Watcher
  • Axe Murderer
    • View Profile
Re: [Minor] If you can't do it, don't
« Reply #4 on: March 21, 2007, 07:59:00 am »

Heh, if Toady ever decided to get a PhD he could do his thesis on "Optimum Pairing of Bearded Agents and Local Time-Sensitive Tasks"
Logged