Improved Task Queuing for Bots
Posted: Sun Jan 31, 2021 5:43 pm
Let me start by saying that Factorio is one of the very best games I've ever encountered and surely the best money I've ever spent given the number of hours I've played.
During the development of my self-building mega-factory blueprints (https://factorioprints.com/view/-MNZWdWosuqr3vtaC2hD), I've found an issue with the construction queue for the bots.
The linked blueprints build entire "blocks" in a deterministic order to ensure correctness. Specifically, they build in several phases: power+roboports, logistics+production, trainstops+modules+aesthetics. They accomplish this by having construction trains deliver only the materials required for the current phase and don't advance phases until build-out of those items is complete.
However, when there is significant outstanding work to do from multiple blocks under construction, especially if one or more blocks has a lot of concrete ("aesthetics"), then there ore often extended periods of time where the bots are completely idle.
My analysis of the situation is that the ghosts for which no material has yet been brought in by train (e.g. concrete) are flooding the queue and pushing out those ghosts for which material is present and could be built. This remains until the next scan of the area but doesn't last long as the abundance of not-present later-phase ghosts drowns those that are ready to be placed.
Assuming my analysis is correct, would it be possible to split the build queue into two queues?
1. Items for which material is available in logistics chests.
2. Items for which no material is available.
Then, prioritize removing from the latter over the former when pruning the list to keep it within the set maximum size.
-- Brian
During the development of my self-building mega-factory blueprints (https://factorioprints.com/view/-MNZWdWosuqr3vtaC2hD), I've found an issue with the construction queue for the bots.
The linked blueprints build entire "blocks" in a deterministic order to ensure correctness. Specifically, they build in several phases: power+roboports, logistics+production, trainstops+modules+aesthetics. They accomplish this by having construction trains deliver only the materials required for the current phase and don't advance phases until build-out of those items is complete.
However, when there is significant outstanding work to do from multiple blocks under construction, especially if one or more blocks has a lot of concrete ("aesthetics"), then there ore often extended periods of time where the bots are completely idle.
My analysis of the situation is that the ghosts for which no material has yet been brought in by train (e.g. concrete) are flooding the queue and pushing out those ghosts for which material is present and could be built. This remains until the next scan of the area but doesn't last long as the abundance of not-present later-phase ghosts drowns those that are ready to be placed.
Assuming my analysis is correct, would it be possible to split the build queue into two queues?
1. Items for which material is available in logistics chests.
2. Items for which no material is available.
Then, prioritize removing from the latter over the former when pruning the list to keep it within the set maximum size.
-- Brian