Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Hard designation priorities to fix distant miner priority inversion  (Read 325 times)

TheBeardyMan

  • Bay Watcher
    • View Profile

Suppose that you have a farm plot 1 z-level below the surface and you want to remove the ceiling to convert it into an above ground farm plot. It's at least three cells in both dimensions, so you need to ensure that the miners remove the middle first and work outward from there. If you don't, they might mine the edges first and cause the middle to cave in and destroy the farm plot.

At a first glance, it looks like designation priorities can solve the problem. Designate the middle as highest priority and designate rings around that as progressively lower priorities.

But what if Urist McMiner, having just finished the last mining job for the magma pump stack 60 z-levels below, calls dibs on one of the high priority inner ring jobs of removing the farm plot ceiling? While he's making the trek up from the depths, the other miners will finish the rest of the inner ring, but not the job that Urist has called dibs on. Then they'll mine the outer rings and cause the cave in that you were trying to avoid. That's distant miner priority inversion.

To fix this, designations could have a "hard priority" flag. When set, it would change the rules of how designation priorities affect the order in which mining jobs are done. The rule that we have now is that a lower priority designation job cannot be taken until all accessible higher priority designation jobs are taken. The rule for jobs with the hard priority flag set would be that a lower hard priority designation job cannot be taken until all higher hard priority designation jobs are completed.
Logged