Bay 12 Games Forum

Please login or register.

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

Author Topic: Reducing Deadheading  (Read 1912 times)

korora

  • Bay Watcher
    • View Profile
Re: Reducing Deadheading
« Reply #15 on: July 09, 2008, 09:48:42 pm »

I suspect because it's usually faster for a given job to cycle through available dwarves than for a given dwarf to cycle through available jobs - while dwarves usually max out at 200, even a medium sized fort can have thousands of rocks and various items for hauling, chopping, mining, crafting, etc,etc. I'm probably not entirely correct, but it's plausible.

While this is true in the best case, what computer scientists usually analyze is the worst case (because you can't expect to get best-case and it's usually hard to figure out the expected-case cost).  By this measure it's the same either way: jobs*dwarves.

If you keep track of all the jobs in a couple of queued lists, you shouldn't need to process them all every time.  Job = Priority * Distance * I have that task, start at the top of the priority list, and grab the first job you can do.  At that point you have a min priority * distance,  At some point, the priorities will get low enough that even a job on the square you're standing on wouldn't be higher priority, so it can stop looking.

I don't know what Toady uses for pathfinding; if he uses a single-source algorithm (finds all shortest paths from one place) this is really easy if you just give each dwarf a priority queue.  When the dwarf becomes idle, it updates the queue and attempts to take the best job (moving on to the next one if it's been claimed).  With a single-source shortest path algorithm, this is fast and only happens when pathfinding would happen anyways.

If he just finds the shortest path between two points, though, then this incurs a lot of pathfinding costs.
Logged
DFPaint, a cross-platform 'screenbuilder' utility

Osmosis Jones

  • Bay Watcher
  • Now with 100% more rotation!
    • View Profile
Re: Reducing Deadheading
« Reply #16 on: July 09, 2008, 11:03:52 pm »

Toady has said he uses a method whereby the computer indexes all connected tiles. If the destination is not connected, it stops right there, otherwise it's just runs a shortest distance calculation. It's in the same interview where he outlines how water pressure, and you should be able to find a link to it in either the dev notes, or a pressure thread.

Referring to the OP, isn't a lot of this going to be dealt with to some extent in the burrows arc? Admittedly, the burrows won't remove deadheading completely, but any deadheading is going to be over short distances only, and hence less of an issue.
Logged
The Marx generator will produce Engels-waves which should allow the inherently unstable isotope of Leninium to undergo a rapid Stalinisation in mere trockoseconds.

Elvenshae

  • Bay Watcher
    • View Profile
Re: Reducing Deadheading
« Reply #17 on: July 10, 2008, 01:22:31 pm »

Referring to the OP, isn't a lot of this going to be dealt with to some extent in the burrows arc? Admittedly, the burrows won't remove deadheading completely, but any deadheading is going to be over short distances only, and hence less of an issue.

To some extent, this may be helped out by the burrows arc, where the ore stockpile to magma smelter to bar stockpile to magma forge logistics all take place within the same burrow.  However, the forge output - weapons, armor, furniture, and crafts - and the ore input are likely going to require inter-burrow hauling tasks.
 
Those are still going to suffer the same issues where, as I mentioned before, you'll end up with a dwarf taking the arrows from the forge up to your military area, then running down into the mines to bring a single stone up to your masonry burrow, etc., instead of a much more efficient routing.
Logged
Patryn of Elvenshae

Ascii Kid

  • Bay Watcher
  • This is just a test
    • View Profile
Re: Reducing Deadheading
« Reply #18 on: July 11, 2008, 12:36:57 pm »

It's my understanding that there's a Barrow system in the works that would solve this problem; ie. Dwarves from the North District use North stone, place in North piles, mine in north mines, etc.  I imagine this will opperate pretty much like zones do now, on a different option menu.  Then, using this and the pathway maker, you could probably lower that nasty inefficency.
Logged
"...you'll have you live with your GRANDmother and pick beans!"
-Homer

Elvenshae

  • Bay Watcher
    • View Profile
Re: Reducing Deadheading
« Reply #19 on: July 11, 2008, 04:03:27 pm »

*sigh*
Logged
Patryn of Elvenshae

Erk

  • Bay Watcher
    • View Profile
Re: Reducing Deadheading
« Reply #20 on: July 11, 2008, 05:57:14 pm »

The burrows arc seems to get bandied around a lot lately, not just in this thread. Did Toady make a big announcement about it that I missed? Honestly I think it's only a small help to the deadheading problem, not a cure. As Elvenshae pointed out, it'll still be easy to deadhead between burrows, and knowing our beloved dwarves i have a feeling this will still be a problem. Just less of one.

In other words, I'd still like detailed control over who can use my stockpiles and such ;)
Logged
'River' cancels eat: Food is problematic.

Qmarx

  • Bay Watcher
  • "?"
    • View Profile
Re: Reducing Deadheading
« Reply #21 on: July 11, 2008, 06:22:32 pm »

For mining, it would be nice to designate all of a mining area as a job taken by a single dwarf, so you don't have to worry about the two or three stragglers...
Logged

Quiller

  • Bay Watcher
    • View Profile
Re: Reducing Deadheading
« Reply #22 on: July 11, 2008, 07:09:54 pm »

I'm not sure I'm entirely understanding this.  So jobs find dwarves, and sometimes the dwarves are nowhere near the required material?  So why doesn't a job find the nearest unclaimed material of the type needed, put a claim on it (so another job doesn't claim it first) and then find the nearest dwarf to the material who is able and willing to do the hauling?  At least for stockpile jobs that would seem to make sense, workshop jobs after all often need multiple materials so the nearest dwarf to the workshop would make more sense there.
Logged
Pages: 1 [2]