Currently, as I understand from doing a little bit of !!SCIENCE!!, this is how dwarves go about looking for a drink:
- Check if preferred drink exists, if not too far*, choose that barrel. Else, look for closest available barrel.
- Check if a goblet/mug/cup exists, choose one closest to the dwarf's current position, and grab it.
- Check if target drink still exists, and go to it.
*I haven't determined exactly how far is too far.This will occasionally result in unwanted behavior such as dwarfs choosing goblets stockpiled closer to them but in the opposite direction to where the drinks they want to get, instead of getting goblets that are stockpiled closer to the drinks they wanted. In extreme cases, e.g. a dwarf halfway between the caverns and the tavern might go all the way up to the tavern to pick up a goblet and then all the way back down to the caverns to get their drink.
I propose the following changes:
- No change in step 1
- Check if a goblet/mug/cup exists on the same z-level as the target barrel, and grab the closest one to the barrel on the target z-level. If none exists on the target z-level, skip to step 3 without collecting a goblet/mug/cup.
- No change in step 3
Players will need to stockpile mugs on every level where drinks are stockpiled, or just live with having some dwarves getting the occasional bad thought from drinking without a proper mug. The reason for restricting checking for mugs on same z-level is to minimize unnecessary traveling time, as sometimes dwarves might end up choosing a goblet that's one or two z-levels above/below the target barrel, but the pathing to it is actually a lot longer than a goblet on the same level.