Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Changing pickup order  (Read 662 times)

ac31

  • Bay Watcher
  • [FIREBREATH]
    • View Profile
Changing pickup order
« on: June 14, 2009, 12:58:44 am »

how complex would it be to change the dwarf's AI to pick up the OLDEST stone/mineral/ore rather than the newest one?

Logged
Just wondering if it would be possible (however unwise) to make demons a civilisation
I don't see any reason they couldn't be. What would happen if they breached the HFS?
Horrors! Annoying relatives in the deep!

blah28722

  • Bay Watcher
    • View Profile
Re: Changing pickup order
« Reply #1 on: June 14, 2009, 10:21:48 am »

I have no idea how DF handles the hundreds of ores on the ground, but if it's in an array, it's just changing the index when adding/retreiving.

If that's the case, pretty easy.

Which is why it's probably not how it's handled. If it was so easy it'd be fixed by now :(
Logged

Leartes

  • Bay Watcher
    • View Profile
Re: Changing pickup order
« Reply #2 on: June 15, 2009, 02:49:16 pm »

If the AI really picks the oldest stone all the time then it should be some sort of array / linked list structure and would be really easy to fix. Could get more complex if it uses some sort of tree though i dont really know why you would want to use any here - maybe easier to search for a specific ore if all stones are stored in the same datastructure.

After thinking for some time I guess there are dozend ways of doing it since it also depends on your way of searching the closest available ressources ... Propably only toady knows the answer, could range from really easy (array, linked list) to quiet hard (some fancy datastructure used for other purposes as well).
Logged

Taritus

  • Bay Watcher
    • View Profile
Re: Changing pickup order
« Reply #3 on: June 15, 2009, 03:36:59 pm »

I think the AI just picks the nearest stone.  At least that's how it works in the new versions.  Not sure about you and your old one there...
Logged



SniHjen

  • Bay Watcher
    • View Profile
    • http://www.youtube.com/user/Hacenten
Re: Changing pickup order
« Reply #4 on: June 15, 2009, 03:49:55 pm »

as far as I know, dwarfs don't have ai, jobs do, and they choose dwarfs to do 'em.

Wallsite: "HEY DWARF"
Urist: "me?"
Wallsite: "yeah you, grab a rock and build me right now."
Logged
That [Magma] is a bit deep down there, don't you think?
You really aren't thinking like a dwarf.

If you think it is down too far, you move it up until it reaches an acceptable elevation.

i2amroy

  • Bay Watcher
  • Cats, ruling the world one dwarf at a time
    • View Profile
Re: Changing pickup order
« Reply #5 on: June 15, 2009, 04:06:40 pm »

I think the AI just picks the nearest stone.  At least that's how it works in the new versions.  Not sure about you and your old one there...
Yeah, this is the way that it works now.
Logged
Quote from: PTTG
It would be brutally difficult and probably won't work. In other words, it's absolutely dwarven!
Cataclysm: Dark Days Ahead - A fun zombie survival rougelike that I'm dev-ing for.

Flaede

  • Bay Watcher
  • Beware the Moon Creatures.
    • View Profile
Re: Changing pickup order
« Reply #6 on: June 15, 2009, 08:43:24 pm »

Does "nearest" mean "shortest path" or does it mean true "closest", and ignore z-levels etc?
Logged
Toady typically doesn't do things by half measures.  As evidenced by turning "make hauling work better" into "implement mine carts with physics".
There are many issues with this statement.
[/quote]

Taritus

  • Bay Watcher
    • View Profile
Re: Changing pickup order
« Reply #7 on: June 15, 2009, 09:15:38 pm »

It ought to be calculated the same way pathfinding is.  So, probably ignores z-levels.
Logged



i2amroy

  • Bay Watcher
  • Cats, ruling the world one dwarf at a time
    • View Profile
Re: Changing pickup order
« Reply #8 on: June 15, 2009, 11:32:23 pm »

I believe that it ignores z-levels.
Logged
Quote from: PTTG
It would be brutally difficult and probably won't work. In other words, it's absolutely dwarven!
Cataclysm: Dark Days Ahead - A fun zombie survival rougelike that I'm dev-ing for.

ac31

  • Bay Watcher
  • [FIREBREATH]
    • View Profile
Re: Changing pickup order
« Reply #9 on: June 16, 2009, 02:05:44 am »

yeah im playign 23a

no z-level witchcraft for ME :D

and it has to be oldest for hauling purposes at least

if i select a job involving ore to be hauled it goes by newest one made, however, if i do a job involving ore processing my dorf goes for the nearest valid ore

same with masonry

this is really inconvienient in terms of getting rid of stone from living areas however

especially since i cant use my handy granite.exe tool to rewall tiles with items on them without some pretty significant bugs occuring  >:(
Logged
Just wondering if it would be possible (however unwise) to make demons a civilisation
I don't see any reason they couldn't be. What would happen if they breached the HFS?
Horrors! Annoying relatives in the deep!

Shima

  • Bay Watcher
  • Time to go fishing, lads.
    • View Profile
Re: Changing pickup order
« Reply #10 on: June 16, 2009, 02:46:09 am »

I've watched Dwarves completely ignore the quantum stockpiles that I keep neatly full and right next to the Stoneshops, and bypass them, walking aaaaalll the way down to the furthest corner of the primary mines on the lowest floors or otherwise the current excavation project.  Other times, they'll path right to the stockpile, grab, and walk the 6 tiles back to their shop.
Logged
(giant worm leather coat)
Weight: 718238Γ
Owner: Udil Evonudil, Planter

Oh Armok, the spice.