DFHack / dfhack

Memory hacking library for Dwarf Fortress and a set of tools that use it
Other
1.88k stars 479 forks source link

buildingplan can choose to attach inaccessible items to jobs #4803

Open myk002 opened 4 months ago

myk002 commented 4 months ago

from the code:

// This is tricky. we want to choose an item that can be brought to the job site, but that's not
// necessarily the same as job->pos. it could be many tiles off in any direction (e.g. for bridges), or
// up or down (e.g. for stairs). For now, just return if the item is on a walkable tile.
static bool isAccessible(color_ostream& out, df::item* item) {

but this isn't good enough in many cases. We should check directly orthogonal tiles (and maybe further away for floors/bridges built over empty space)

example from https://dffd.bay12games.com/file.php?id=17139

image

the building on the left chooses the inaccessible item on the right. they are both on walkable tiles, but in separate walkability groups.

ab9rf commented 2 months ago

a possibly related issue: buildingplan does not respect civilian alerts when active, and will assign materials which cannot be reached due to an active civilian alert, which stalls building