Quality Gardener - Automatically use the best available quality

by raley

Bot's automatically upgrade the factory when higher quality buildings become available. Ghosts are matched to the best-available item, and destroyed buildings are replaced with best available quality.

Utilities
5 hours ago
2.1
40
Factorio: Space Age Icon Space Age Mod
Logistic network

Changelog

Version: 1.3.1
Date: 20. 08. 2026
  Bugfixes:
    - Fixed module upgrade orders sometimes being cancelled or replaced with a same-quality order
      moments after being placed. Module orders now get the Order Expiry grace period before any
      adjustment, just like building upgrades.
Version: 1.3.0
Date: 01. 08. 2026
  Features:
    - Space platform support added.  
    - New settings: Manage Space Platforms (on by default).
  Optimizations:
    - Minor UPS improvement, network and platform changes are scanned for less often.
Version: 1.2.0
Date: 30. 07. 2026
  Features:
    - Upgrade-requests are now managed. An order whose target quality is out of stock is retargeted 
      to the best stocked quality of the target item, even a lower one, so the swap happens instead of
      stalling. 
    - Settings: Manage Factory (upgrades of placed buildings
      and their modules), Manage Ghosts, and Manage Upgrade Requests - each have a runtime map
      setting, all on by default, so any combination can be enabled without a restart.
Version: 1.1.0
Date: 29. 07. 2026
  Features:
    - The mod now remembers which upgrade orders it placed and cancels them if items have been out 
      of stock for a period of time. The Order Expiry setting can be used to adjust the period of time. 
  Changes:
    - The pass now runs every tick in correspondingly smaller slices; the Entities per Pass setting
      is renamed Entities per Tick (default 1 - the same average throughput as before, delivered
      perfectly smoothly). The order ledger is swept during the rest between rounds under the same
      work budget, so nothing ever bursts.
Version: 1.0.0
Date: 28. 07. 2026
  Features:
    - Entities are marked for upgrade when higher-quality versions of them sit in the logistic
      network. Each entity is upgraded to the best quality on hand.
    - Ghost provisioning: a ghost requesting a quality the is not on hand is retargeted to
      the best quality the network has available (even if lower quality). 
    - Module provisioning: installed modules with a higher-quality version in storage are also managed.
    - Stateless by design: every round reads the world fresh, so nothing can get out of sync.
    - Smooth, constant cost: networks are visited round-robin in small slices, orders are capped
      by available construction robots, and a rest between rounds gives bots time to pick up
      ordered items.