Supply Chain Blueprints & Generator

v2.8.0
by bishopxo (Centerpoint AI)

Supply Chain Blueprints & Generator (v2.8.0) An instant in-game Supply Chain Calculator and automated East-to-West 3D factory blueprint generator for Captain of Industry.

Beta 5 hours ago MIT No source
Source code
No source provided
Tags
Quality of Life Tweaks UI

Key Features

  • Master-Detail Supply Chain Studio (F8 / Ctrl+Shift+B):
    • Searchable, category-filtered product catalog (All, Units, Loose, Fluids, Molten) on the left.
    • Instant solver (~7 ms) with upstream depth control (1–5), alternative recipe/machine cycling, and raw-import overrides (Import Raw / + Produce).
    • Live KPI strip showing stages/machines, East/West edge I/O, routed footprint + packing density, and belt/ramp/lift/balancer counts.
    • Color-coded StatusDisplay progress updates with background async 3D routing (zero UI freeze).

image.png

  • Three Layout Modes:
    • Compact Box (default): Tight 3D footprint with folded machine columns, stacked 1x1 MiniZipper spines (Z = 0..3), Z = 4..5 roof overpasses, and perimeter storages.
    • Scalable Bus (Prefix): Deterministic column alignment and unobstructed North (+Y) expansion edge for clean 1x -> 2x paste-over scaling.
    • Tileable Slice: Repeatable horizontal strips that stack edge-to-edge vertically (dy = FootprintHeight) with 0 seam collisions — defaults to 1x1 BUS IN: / BUS OUT: headers with an optional +Inline Storages toggle.

image.png

  • Smart Logistics & Auto-Tiering:
    • Strict East -> West (-X) Flow with sloped conveyor ramps prioritized ahead of Up-Lifters, mirrored 1:2 smelter-caster coupling, and direct flush SmokeStack / Flare exhaust vents.
    • Auto Steam Boilers: Automatically expands Steam (high), Steam (super-high), and Steam (depleted) even at Depth = 1, with instant Coal / Electric / Gas boiler cycling.
    • Dynamic Auto Tiers: Automatically sizes main trunks (Belt T1–T3, Pipe T1–T4, Storage T1–T4) and steps down branch taps to match machine demand.
    • Smart Truck I/O Toggle: Pre-configures storages for product filters and balanced truck import/export limits, or toggle Smart Trucks off for pure belt/pipe mode.
  • 37 Pre-Built Presets Across 7 Catalog Folders:
    • Automatically populates [Supply Chain Modules] (01 through 07 - Scalable & Tileable Slices) and updates mod-owned scbm: blueprints cleanly in-place (no Recycle Bin clutter when paired with Kayser's Blueprint Designer's Toolkit).
  • Vanilla B... Export & Console Commands:
    • Copy B... String button in the UI (and scb_export console command) generates vanilla B... blueprint strings to your clipboard and %APPDATA%\Captain of Industry\Mods\SupplyChainBlueprintsMod\exports\.
    • Also includes console commands scb_rebuild_catalog and scb_generate.

image.png

Note:

Complex designs need time to calculate and may not be perfect. Smaller designs are more accurate

No announcements yet.

v2.8.0

Latest
Game version
0.8.8 - 0.8.8d
Released
Nov 27, 2026
File size
175.3 KB
License
MIT
Save-game: Add · Remove
Loading forum…

# Supply Chain Blueprints & Generator — Changelog

## v2.8.0 (2026-11-25)
- **Aggressive 3D Footprint Compaction (`ModularBlueprintBuilder`)**: Tightened Pass-0 corridor budgeting for co-axial `1x1` `MiniZipper` spines (`9–14` tiles vs `20–40+` tiles on large chains), raised folding threshold (`>= 8..10`) with compact `7–11`-tile internal alleys, enabled `Z=4..5` roof-clearance overpasses over low machines/storages, and cut Pass-0 `innerMarginY` to `2–6` tiles.
- **Scalable & Tileable Blueprint Modes (`BlueprintLayoutMode`)**: Added **`Scalable Bus`** (deterministic bottom-anchored `Y` origins, invariant column corridor X spacing, and unobstructed `+Y` growth edge for clean `1x -> 2x -> N×` paste-over expansion) and **`Tileable Slice`** (bus-ready `1x1` East `BUS IN:` / West `BUS OUT:` headers with tight `Y` envelopes and native `OverlapDeltaY` for edge-to-edge stacking).
- **07 - Scalable & Tileable Slices Catalog Folder (`v=17`)**: Added 7 repeatable `1x` `Tileable Slice` presets (Iron, Copper, Steel, Concrete, CP1, CP2, Electronics I) alongside all 30 upgraded `Compact Box` presets.
- **Kayser BDT Closed-Loop Compatibility & Exporter**: Switched catalog upgrades to in-place `Blueprint` replacement (preventing BDT Recycle Bin spam on rebuilds), added canonical symmetric connector orientation (`NormalizeSymmetricTransform`), added `scb_export` vanilla `B...` blueprint string export, and added Layout Mode controls + packing density telemetry in the Calculator UI (`F8`).
- **Master-Detail Split Studio UI Revamp (`1180x760`)**: Rebuilt `SupplyChainCalculatorWindow` with a categorized left product sidebar (`SearchField`, `Units`/`Loose`/`Fluids`/`Molten` filters, `ButtonIconText` rows), live 4-card KPI strip (`CHAIN`, `EDGE I/O`, `FOOTPRINT`, `ROUTING`), unified Layout/Toggles/Tiers toolbar, tabbed `Stages` / `Inputs & Outputs` / `Catalog & Tools` workspace, native `StatusDisplay`, and one-click `Copy B... String` export.
- **Clean COI Hub Release Packaging**: Removed unused `0Harmony.dll` from `primary_dlls` and added an MIT `LICENSE` + automated Desktop release packager (`scripts/package_desktop_release.ps1`).

## v2.7.0 (2026-11-21)
- **Strict East-to-West (`Right -> Left`, `-X`) + North/South Flow & Self-Contained Stage Modules**: Placed upstream stages on the East (`+X`) flowing Westward (`-X`) into downstream stages and West output storages; enforced strict `dX <= 0` flow checks across fast-paths, ramps, and 3D A* routing so belts/pipes never double back West-to-East; aligned raw/byproduct N/S bays to each stage's East/West face.
- **Auto Steam Boiler Expansion (`SupplyChainRecipeSolver`)**: Automatically appends a Steam Boiler stage whenever non-storable boiler steam (`SteamHi` / `SteamSp`) is required (bypassing `maxDepth` since Steam cannot go in storage tanks), defaulting to standard `BoilerCoal :: SteamGenerationCoal` with `SmokeStack` exhaust flush-docking and recipe cycling to Electric/Gas Boilers.
- **Dynamic Trunk + Branch Auto-Tiering (`Belts = Auto`, `Pipes = Auto`)**: Main spines and trunk ports scale dynamically to carry full stage demand (`T1 <= 60`, `T2 <= 200`, `T3 <= 450/60s` belts; `T1..T4` up to `900/60s` pipes), while individual machine branches and drained spine tails dynamically step down (`T3 -> T2 -> T1`) to match exact consumer rates.
- **Prefer Sloped Ramps (`Z=1..3`) & Eliminate Dead-Ends (`PruneAndValidateNoDeadEnds`)**: Added 3D sloped ramp A* (`Z=0..3`), `Z=1..3` ramp bridges, multi-lane ramp probing, transactional rollback for partial balancers/trees, disabled fake `Zipper` steam buffers, and post-build validation rejecting any dead-end balancer/lift (`in == 0 || out == 0`) or dangling trajectory.
- **Catalog Version Bump (`v=16`)**: Bumped `CurrentCatalogVersion` to `16` (`scbm:id=<id>;v=16`) and mod version to `2.7.0`.

## v2.6.0 (2026-11-21)
- **Exact `OccupiedTileRelative` Bounds (`OccupiedGrid3D.GetOccupiedBounds2i`)**: Fixed Mafi `GetBoundingBox2i` `+1` off-by-one inflation across every machine, storage, lift, and `MiniZipper` (`Storage` `5x5` vs `6x6`, `AssemblyManual` `6x5` vs `7x6`, `LiftProto` `2x1` vs `3x2`, `MiniZipperProto` `1x1` vs `2x2`), enabling exact `0`-gap vertical machine pitch (`5`-tile centers on Assemblers, `6`-tile centers on BricksMakers/Furnaces) and `5`-tile North/South-first storage row packing.
- **Co-Axial `1x1` `MiniZipperProto` Spines & `2`-Tile Output Collectors (`TryWireCoAxialMiniZipperManifold`, `TryWireMiniZipperCollectorManifold`)**: Integrated unpowered `1x1` `MiniZipperProto` connectors (`Z=[z..z+1)`, zero ground pillar!) stacked along a single `X = minDstConnX - 2` column at `Z = 0, 1, 2, 3` with `0`-tile flush `LiftProto` drops, `1`-pivot (`pivs.Length >= 1`) trajectories, and `2`-tile East output collector spines (including `Z=1` flush-lift Slag bypasses over East molten channels).
- **Coupled `1 Smelter -> 2 Mirrored Casters` & Mirrored Lifts (`TileTransform` `flip: true`)**: Added mirrored (`90° reflected` + `90°`) `Caster` pairs aligned directly to `SmeltingFurnace` molten output ports (`0` bends, `0` molten balancers) plus `flip: true/false` candidate probing across `TryRouteSingleLiftTransition` and `TryRouteWithLiftPair`.
- **One-Way Sloped Conveyor Ramps (`TryRouteSingleRampTransition`) & Stacked `ZipperProto` Support**: Added direct and perimeter `0 <-> Z` sloped conveyor ramps before `LiftProto` towers, and allowed stacked `Z > 0` `ZipperProto`s directly atop aligned lower `ZipperProto` pillars.
- **Catalog Version Bump (`v=15`)**: Bumped `CurrentCatalogVersion` to `15` (`scbm:id=<id>;v=15`) and mod version to `2.6.0`.

## v2.5.0 (2026-11-20)
- **Never Enforce Even Inputs or Outputs (`ForceEvenInputs = false`, `ForceEvenOutputs = false`)**: Disabled input/output even-enforcement across all `ZipperProto` splitters, trunks, mergers, and column manifolds so asymmetric belt distances and full branches never stall active consumers, while retaining non-blocking `PrioritizedPorts` on manifold taps.
- **Multi-Level `Z`-Sorted Main Lines & Single-Lift Drops (`TryRouteSingleLiftTransition`, `OccupiedGrid3D`)**: Grouped co-destination flows converging on shared machine columns onto distinct elevated conveyor (`Z=0/1/2/3`) and pipe (`Z=2..4`) levels with elevated trunk/manifold placement, pillar column `[0..toExclZ)` collision reservation, reciprocal flush-lift claim detection, and `1x Lift` (`0 <-> Z`) transitions instead of redundant `2x Lift` detours.
- **Turn & Footprint Reduction**: Added 1-bend L-shapes before `midX` dog-legs in `TryRouteFastPath`, collinear straight conveyor ramp bridges, higher 3D A* turn penalty (`34`), `2..6` source collector manifolds, Z-difference rescue penalties, pre-prune capacity rebalancing, and tighter Pass-0 corridors & folded alleys.
- **Catalog Version Bump (`v=14`)**: Bumped `CurrentCatalogVersion` to `14` (`scbm:id=<id>;v=14`) and mod version to `2.5.0`.

## v2.4.0 (2026-11-20)
- **Causal Stage Netting & Steam Generator Water Input Fix**: Fixed global netting where downstream co-product `Product_Water` (e.g. Sour Water Stripping) canceled upstream `BoilerElectric` `Product_Water` input. `IN: Water` storages are now placed and wired separately from downstream `BYPRODUCT: Water` storages, and single-output intermediate boilers no longer vent live `Steam (high)` to smokestacks.
- **Storage Size Selector (`Auto` / `T1`..`T4`)**: Added Storage Tier selection (`Auto` size-by-rate, `T1` 200, `T2` 500, `T3` 3k / 11x11 4-port, `T4` 6k / 11x11 4-port) while excluding non-standard storages (`RainwaterHarvester`, `CargoDepotModule*`, `FuelStation*`, `Settlement*`).
- **Auto Throughput-Optimized Belts & Pipes**: Added `Auto` mode for both Belts (`T1` <= 60, `T2` <= 200, `T3` <= 450) and Pipes (`T1` <= 60, `T2` <= 200, `T3` <= 450, `T4` > 450) alongside fixed tier locks, with multi-trunk anti-bottleneck protection on high-flow pipes.
- **Calculator UI Overhaul (`1080x800`)**: Widened layout with 4-column product grid, dedicated `Belts / Pipes / Storage` tier bar, `480/m` rate preset, depth indicator badge, decoupled endpoint route badges, and live endpoint sizing hints prior to 3D routing.

## v2.3.0 (2026-11-20)
- **Pre-Configured Storages, Role-Based Truck Rules & No-Truck Machines (`ModularBlueprintBuilder.cs`, `SupplyChainCalculatorWindow.cs`):**
- Switched storage product assignment from `AssignedProducts` (vehicle-only field) to `StorageConfigExtensions.SetStorageStoredProduct(...)` so every `IN:`, `BYPRODUCT:`, and `OUT:` storage automatically spawns pre-configured with its exact product.
- Configured every production `MachineProto` (`SmeltingFurnace`, `Caster`, `BricksMaker`, `Assembler`, `SmokeStack`, `Flare`, etc.) with `LogisticsInputMode = Off` and `LogisticsOutputMode = Off` (`IsLogisticsInputDisabled = true`, `IsLogisticsOutputDisabled = true`) so trucks never bypass factory belts.
- Added smart role-based truck rules + Calculator UI toggle **`Trucks: Smart I/O`** / **`Trucks: OFF`** (`StorageTrucksEnabled`): raw `IN:` storages import up to `75%`, `BYPRODUCT:` storages export from `25%` (keeping furnaces clear), and `OUT:` storages export from `0%`, or toggle all storages to truck-free belt mode.
- **2D Parallel Sub-Chain Lanes & `2xN` Double-Column Stage Folding:**
- Grouped stages by longest downstream DAG distance (`col = maxDist - distToFinal`) so parallel sub-chains (e.g., `Construction Parts I`, `Electronics`, and `Steel` feeding `Construction Parts II`) pack vertically in parallel lanes directly adjacent to their consumer column, eliminating 150-tile cross-factory wrap-around belts.
- Folded stages with `6+` machines into compact `2 x ceil(N/2)` double-column blocks with an explicit clear internal alley (accounting for East-mounted flush `SmokeStack`s).
- **Truck-Clear Outer Storage Perimeter Ring (`0` Belts Outside Storages):**
- Placed all `IN:`, `BYPRODUCT:`, and `OUT:` storages around the outer West, North, South, and East perimeter (ports facing inward) and enforced hard inner-ring bounds across fast-paths, 3D A\*, balancers, lifts, and rescue steps so zero belts or pipes ever obstruct truck access.
- **Hybrid Balancer Trunks + Prioritized Column Manifold Spines (`ZipperConfigExtensions`):**
- Balanced multi-belt trunks and equal-demand splits with `ForceEvenInputs = true` / `ForceEvenOutputs = true` trunk balancers, feeding compact daisy-chained `2x2` `ZipperProto` column manifolds (`PrioritizedPorts` set on each machine tap port so Machine #1 runs immediately, plus collector mergers on multi-machine outputs), with clean transactional fallback to balancer trees for 100% connectivity.
- **Catalog Version Bump (`v=12`):**
- Bumped `CurrentCatalogVersion` to `12` (`scbm:id=<id>;v=12`) and mod version to `2.3.0`.

## v2.2.0 (2026-11-19)
- **Direct Flush `SmokeStack` / `Flare` Exhaust Docking (`0` Pipes, `0` Supports, `0` Pipe Balancers):**
- Automatically docks `2x2` `SmokeStack` / `Flare` vents directly flush onto each machine's exhaust port (`smokePort.Position == exhaustPort.ConnectedTile`) whenever exhaust gas is vented rather than consumed internally, eliminating long elevated exhaust pipes, steel truss pillars, and `PipeBalancer`s across Blast Furnaces, Arc Furnaces, Bricks Makers, Rotary Kilns, Oxygen Furnaces, Gold Furnaces, Boilers, and Distillers.
- **40%–68% Smaller Blueprint Footprints (`ModularBlueprintBuilder.cs`):**
- Replaced global `totalHeight` outer-bay offsets with **stage-hugging rotated local North/South bays** (`4` tiles above/below each stage's actual machines, with storage ports rotated to face directly into the corridor), enabled local stage bays on all `2+`-stage chains, tightened machine vertical spacing (`1–2` tiles for West/East-only machines), compacted Pass-0 corridor gaps, and derived routing bounds directly from placed entity bounds.
- **Throughput-Sized Storages, Dual-Port Direct Wiring & Uncrossed Port-Y Alignment:**
- Sized input/output storages by actual per-minute throughput (`2` ports per `6x6` storage = `120/60s` at T1, `400/60s` at T2) instead of `machineCount / 3`, eliminating redundant duplicate warehouses (`1` East warehouse instead of `4` on `60–120/60s` Construction Parts).
- Exposed both ports on `StorageBaseProto` for `2`-machine fan-out/fan-in (`0` `ZipperProto` balancers needed) and aligned West/East storages to target machine port `Y` coordinates so adjacent ore/coal belts run straight without crossing.
- **Ground-First Pipes & Unpowered Sloped Conveyor Ramps Before `LiftProto` Towers:**
- Prioritized flat `Z=0` pipe routing first (hopping `Z=1/2` only over crossing belts) and added `TryRouteConveyorRampBridge` (`Z=1`/`Z=2` native sloped conveyor bridges) before falling back to powered `ConveyorLift` towers.
- **Catalog Version Bump (`v=11`):**
- Bumped `CurrentCatalogVersion` to `11` (`scbm:id=<id>;v=11`) and mod version to `2.2.0`.

## v2.1.0 (2026-11-19)
- **O(delta) Undo-Logged 3D Grid & Zero-Allocation A* Buffers (`OccupiedGrid3D.cs`, `ModularBlueprintBuilder.cs`):**
- Replaced full-dictionary `GridSnapshot` deep-cloning (`CreateSnapshot` / `RestoreSnapshot`) with **`O(delta)` undo-logged `GridCheckpoint`** (`CreateCheckpoint` / `RollbackToCheckpoint`), eliminating thousands of per-rollback dictionary/list allocations across candidate balancers.
- Replaced per-call `int[]` array allocations (`new int[stateCount]`) in `TryRoute3DAStar` with generation-stamped reusable buffers (`_aStarBestG`, `_aStarParentIdx`, `_aStarVisitGen`, `_aStarClosedGen`), cutting preview/build times by **10x–40x** on complex multi-stage custom blueprints.
- **Fixed High-Connection Custom Blueprint Completeness (`ModularBlueprintBuilder.cs`, `SupplyChainRecipeSolver.cs`):**
- **Multi-Consumer Intermediate Demand Aggregation**: Added reverse-topological demand aggregation (`RecomputeAggregatedMultiStageCounts`) so shared intermediates (e.g., `Copper` feeding both `Electronics` and `PCB`, or `ConstructionParts` feeding `CP2` + `CP3`) size accurately across all downstream stages, plus automatic `+1` smelting expansion for non-storable `MoltenProductProto` intermediates so molten metals never stop at storage boxes.
- **Flat Proportional Balancer Partitioning & `<= 6`-Port Cap**: Lowered single 2x2 `ZipperProto` usage to `M + N <= 6` (leaving `>= 2` spare approach ports out of 8), replaced exponential recursive binary splitting with flat proportional `(sSlice, dSlice)` bucket partitioning (`RouteSubBucket`), and added direct `1-to-1` parallel routing for `N == N` arrays.
- **Direct 1-Tile Lift Docking & Perimeter Bus Fast-Paths**: Aligned `LiftProto` rotations (`upRots`/`downRots`) to each port's outward normal, added `fwd = 1` zero-bend direct port-to-lift docking for 3-input assemblers (`AssemblyRoboticT1` middle port), added North/South local stage-bay I/O storages for `4+`-stage chains, and added `O(1)` North/South perimeter bus fast-paths (`Z=0..5`) plus `RescueUnclaimedEndpoints` endpoint/storage-port tapping.
- **Non-Blocking Async 3D Preview & Blueprint Generation (`SupplyChainCalculatorWindow.cs`, `SupplyChainHudHostMb.cs`):**
- Offloaded `PlanBlueprintLayout` onto a background thread (`Task.Run`) with thread-safe `_builderSync` locking and live pass progress updates (`PollAsyncRouting` in `SupplyChainHudHostMb.Update`), committing `AddBlueprint` strictly on the Unity main thread (`CommitPlannedLayoutToLibrary`) so custom mega-blueprints never freeze the game UI.
- **Catalog Version Bump (`v=10`):**
- Bumped `CurrentCatalogVersion` to `10` (`scbm:id=<id>;v=10`) and mod version to `2.1.0`.

## v2.0.0 (2026-11-19)
- **Zero-Overhead Game Load (`SupplyChainMod.cs`, `SupplyChainHudHostMb.cs`, `SupplyChainConsoleCommands.cs`):**
- Removed all automatic 30-chain 3D A* catalog generation from `SupplyChainMod.Initialize`, `SupplyChainConsoleCommands` constructor, and `SupplyChainHudHostMb.Update` so save/new-game load overhead drops from 30–60s to `0.00s`.
- The 30 pre-packaged chains (`scbm:id=<id>;v=9`) now build strictly on-demand via the **"Rebuild 30 Preset Chains (v2.0)"** button or `scb_rebuild_catalog`.
- **Instant Sub-Millisecond Calculator UI & Fixed Recipe/Toggle State (`SupplyChainCalculatorWindow.cs`):**
- Decoupled fast math solving (`BuildPlanByRate`, `< 1 ms`) from heavy 3D A* layout routing (`PlanBlueprintLayout`), eliminating 15–30s main-thread freezes when clicking products, rates, transport tiers, or stage buttons.
- Fixed the `Recipe (k/N)`, `To Input Storage`, and `+ Produce Internally` handlers (which previously wiped `_previewPlan = null` without re-solving, blanking the stage breakdown) and added `_suppressUiCallbacks` guards so programmatic `_rateTextField` updates never trigger recursive resets.
- Added explicit **"Preview Routing"** and **"Byproducts: ON/OFF"** controls, caching layouts by deterministic `PlanSignature` + transport tiers so **"Create Optimal Supply Chain Blueprint in Library"** reuses previewed layouts with zero duplicate work.
- **Full Byproduct & SmokeStack Exhaust Routing (`SupplyChainRecipeSolver.cs`, `ModularBlueprintBuilder.cs`):**
- Preserved physical `IsPollution` pipe outputs (`Product_Exhaust` on Blast Furnaces, Boilers, Distilleries, etc.) in `ComputeNetFlows` and `RegisterMachineRecipePorts` while keeping pollution excluded from `BuildProducerIndex`.
- Automatically places and wires `SmokeStack` (`Recipe: SmokeStackExhaust` / `SmokeStackCarbonDioxide` / steam vents) on the East column for non-storable exhaust/vent gases, and routes solid/liquid co-products (`Slag`, `WasteWater`, `SourWater`, etc.) to internal consumers first or dedicated East-edge Byproduct Storages.
- **Turn-Penalized Admissible 3D A* & 100% Connectivity Across All 30 Presets (`ModularBlueprintBuilder.cs`):**
- Upgraded `TryRoute3DAStar` with turn-penalized costs (`step=10, turn=18, offPreferredZ=4, zStep=45, nearStub=30`), preserved heading across Z-risers, admissible Manhattan+Z heuristic, and self-intersection checks in `TryValidateCandidatePivots`.
- Expanded `TryRouteWithLiftPair` search candidates/expansions and increased selective corridor-widening retries up to 5 passes, achieving **100% branch connectivity (`30/30 PASS`)** across all 30 preset chains and complex 6-stage chains (`Construction Parts`).

## v1.7.0 (2026-11-17)
- **Multi-Height Elevated Belt Highways (`Z=1..3` `LiftProto` + `Z=1..4` Pipe Racks):**
- Expanded `TryRouteWithLiftPair` to cycle across `LiftProto` heights (`Z+2`, `Z+3`, `Z+1`), expanded `dx`/`dy` lift bay offsets, enabled vertical (`Deg90`/`Deg270`) lift pair fallback on all corridors, and added early `noEndpointSpace` exit so blocked endpoints don't waste search budget.
- Raised pipe A* `maxZ` to `4` (`Z=1..4`) while keeping primary pipe racks on `Z=1..3`.
- **Balancer Manifold Staggering & Transactional Tree Fallback (`WireCompleteProductNetwork`, `BuildMergerTree`, `BuildSplitterTree`):**
- Added `Deg0`/`Deg90` rotation probing in `extraOffsets`, compact bus-margin manifold slots (`minY+2..maxY-7`), `candMinX` West fallback when destination corridors are full, and `zoneSlot` staggering across both `BuildMergerTree` and recursive `BuildSplitterTree` calls (`4+4` split on 8-machine arrays).
- Added transactional rollback from incomplete `M+N <= 8` single balancers (`M+N >= 4`) to `WireMergerSplitterTree`, keeping whichever topology wires more branches.
- **Fast Weighted 3D A* & Stub Early-Out (`TryRoute3DAStar`):**
- Added immediate early-out when `!isPipe` endpoint approach stubs are blocked, weighted A* heuristic (`1.25x`), and `8000`/`12000` expansion caps.
- Headless `ProtosDb` connectivity improved from `20/30` to **`26/30 FullOK`** (`0` regressions; newly `FullOK`: `CP1 2x`, `CP4 2x`, `VP2 2x`, `Electronics III 2x`, `Household Goods 2x`, `Medical Supplies 2x`).
- **Catalog Auto-Upgrade (`v=8`):**
- Bumped preset catalog ownership tag to `v=8` (`scbm:id=<id>;v=8`) and UI header to `v1.7.0`.

## v1.6.0 (2026-11-17)
- **Port Approach Stub Reservations (`OccupiedGrid3D.ReservePortStub`):**
- Reserved the mandatory 1-tile outward approach stub (`ConnectedTile + OutwardNormal`) for every active machine and storage port so unrelated belts, balancers, or lifts can never wall off adjacent ports in tight corridors.
- **Transactional Balancer Rollback & Diverse Repositioning (`BuilderTransaction`, `FindBalancerCandidates`):**
- Added full `OccupiedGrid3D.GridSnapshot` + entity/port-claim rollback across `WireSingleMultiportBalancer`, `BuildMergerTree`, and `BuildSplitterTree`. When a balancer placement leaves any branch unwired, it rolls back cleanly and retries stepped-back (lift-ready), above-column, and below-column manifold positions.
- **Structured COI Hub Main-Bus & Pipe Manifold Separation (`TryPlanWithCorridors`, `TryRouteWithLiftPair`):**
- Moved `Pipe` balancers above/below machine columns so `Z=0` belt corridors stay clear, placed long-span splitters locally in destination corridors (`dstCorrMinX`-clamped), added an aligned 3-tile `Z=0` central pass-through avenue on dense `5+` machine columns, scaled top/bottom bus margins to skip-stage flow count, and added vertical (`Deg90`/`Deg270`) `LiftProto` pair fallback.
- Selective corridor widening (`+2` / `+4` only on corridors with failed flows) keeps footprints compact (`Concrete Slab 2x: 82x27 -> 66x30`, `Glass 2x: 79x27 -> 61x27`, `Rubber 2x: 76x27 -> 60x30`, `Plastic 2x: 92x34 -> 76x37`, `Graphite 2x: 79x27 -> 63x33`, `Mech Parts 2x: 16/16`, `Silicon 2x: 23/23`).
- **Catalog Auto-Upgrade (`v=7`):**
- Bumped preset catalog ownership tag to `v=7` (`scbm:id=<id>;v=7`) and UI header to `v1.6.0`.

## v1.5.0 (2026-11-17)
- **Fixed Storage 4-Port Over-Registration (`RegisterSingleFactoryFacingPort`, `TryPlanWithCorridors`):**
- West Input Storages and East Output Storages (`StorageUnit`, `StorageLoose`, `StorageFluid`) have 4 `IoPortType.Any` ports; previously all 4 were registered as required endpoints, inflating connection counts 4x and forcing unnecessary balancer trees. Now only the single factory-facing port (`OutwardNormal.X > 0` for West inputs, `< 0` for East outputs) is registered and reserved.
- **Fixed Molten/Belt/Pipe Flow Priority & Exact Endpoint Accounting (`ModularBlueprintBuilder.cs`):**
- Sorted flow routing so `MoltenMetalChannel` (`ZStepLength == int.MaxValue`, strictly `Z=0`) routes first, followed by short-span conveyors, then elevated `Pipe` racks (`Z=1..3`).
- Expanded single 2x2 `ZipperProto` balancers to handle all `M + N <= 8` topologies with nearest-port + facing-bonus assignment, collapsed singleton `N == 1` outputs to direct edges (eliminating redundant splitter balancers), and tracked exact `m + n` endpoint connectivity (`BranchesConnected / BranchesRequired`).
- **Corridor-Clamped Binary-Heap 3D A*, Exact Port Reservations & Flexible Lift Pairs (`TryRoute3DAStar`, `TryRouteWithLiftPair`, `OccupiedGrid3D`):**
- Fixed `OccupiedGrid3D.IsReservedPortConflict` so trajectories only pass through the exact `startTile` and `endTile` (never through unused ports on the same entity).
- Replaced linear-scan A* with a binary min-heap (`15,000` max expansions) and clamped X search bounds to the active corridor (`±6` tiles) so belts cannot wander into downstream corridors and block unrelated machine ports.
- Upgraded `TryRouteWithLiftPair` to resolve `LiftProto` input/output ports by `IoPortType`, search multiple nearby `(up, down)` candidate placements, route the elevated `Z=2` bridge with 3D A*, and atomically commit both lifts and all 3 trajectory legs.
- **Compact Footprints & Catalog Upgrade (`v=6`):**
- Reduced corridor-widening step from `+3` to `+2` tiles (`4–10` tile starting corridors), cutting blueprint widths by 20–40% across verified presets (`Steel 2x: 90x20 -> 67x20`, `Diesel 2x: 104x41 -> 72x41`, `Plastic 2x: 117x34 -> 92x34`, `Iron 2x: 66x20 -> 55x20`).
- Bumped preset catalog ownership tag to `v=6` (`scbm:id=<id>;v=6`) and UI labels to `v1.5.0` so all 30 preset blueprints auto-upgrade on load.

## v1.4.0 (2026-11-17)
- **Compact Hub-Style Footprint & Rotated Bounds (`ModularBlueprintBuilder.cs`):**
- Replaced square `max(X, Y)` bounding assumptions with exact rotated `EntityLayout.GetBoundingBox2i(transform)` placement (`minXY - bb.Origin`) so rectangular and rotated machines pack tightly without shifting into neighbors.
- Tightened vertical spacing (`storageGapY = 1`, `machineGapY = 1` for W/E-ported machines and `2` when N/S ports are active) and replaced the global 12–20 tile `columnGapX` with per-corridor minimal widths (`5–12` tiles) plus automatic `+3`-tile corridor retry only when needed.
- **Complete M-to-N Balancer/Splitter/Merger Topology (`ModularBlueprintBuilder.cs`):**
- Fixed `1 -> N` multi-group balancer starvation (previously `sources[0].IsClaimed` left group 1+ balancers with 0 inputs) by building a proper **Splitter Tree** (`BuildSplitterTree`).
- Fixed `M -> 1` disconnected machine outputs (previously `needBalancer = false` dropped `M - 1` sources) by building a **Merger Tree** (`BuildMergerTree`).
- Fixed `M -> N` flows by supporting single 8-port Balancers up to `3 -> 4` (`M + N <= 7`) and **Merger-to-Splitter Trees** for larger arrays, plus collision-free spiral placement (`TryPlaceBalancerNear`) so different products never overlap balancers.
- **Exact 3D Spatial Occupancy Grid & Orthogonal A* Router (`OccupiedGrid3D`, `TryRoute3DAStar`):**
- Added `OccupiedGrid3D` tracking half-open Z height spans `[FromZ, ToExclZ)` from `EntityLayout.GetOccupiedTilesRelative` and `TransportTrajectory.OccupiedTiles`, plus port-approach reservations.
- Replaced blind `p1/p2/p3` routing with fast-path orthogonal routing + bounded **3D Orthogonal A* (`Z=0..3`)** that routes around buildings, balancers, and other transports, with collision-checked `LiftProto` pairs (`TryRouteWithLiftPair`, >=2-tile approaches) when needed.
- Bumped preset catalog ownership tag to `v=5` (`scbm:id=<id>;v=5`) so all 30 preset blueprints automatically upgrade on load.

## v1.3.0 (2026-11-17)
- **Fixed Pipe Tier Resolution & Added Independent Conveyor/Pipe Tier Controls (`ModularBlueprintBuilder.cs`, `SupplyChainGeneratorWindow.cs`):**
- Fixed pipe prototype lookup where `tier == 1` previously used an empty suffix (`""`), missing `PipeT1` and falling through to `PipeT4`.
- Implemented exact prototype resolution across all transport families:
- Flat Conveyors: `FlatConveyorT1` (T1, 60/60s), `FlatConveyorT2` (T2, 200/60s), `FlatConveyorT3` (T3, 450/60s).
- U-Shape Loose Conveyors: `LooseMaterialConveyor` (T1, 60/60s), `LooseMaterialConveyorT2` (T2, 200/60s), `LooseMaterialConveyorT3` (T3, 450/60s).
- Pipes: `PipeT1` (T1, 60/60s), `PipeT2` (T2, 200/60s), `PipeT3` (T3, 450/60s), `PipeT4` (T4, 900/60s).
- Molten Channels: `MoltenMetalChannel` (120/60s).
- Replaced the single shared tier selector with separate **Conveyors (`T1 | T2 | T3`)** and **Pipes (`T1 | T2 | T3 | T4`)** selectors in the UI.
- **Fixed Port Direction Polarity & Single-Claim Port Allocation (`ModularBlueprintBuilder.cs`):**
- Verified against `Mafi.Core.Ports.Io.IoPort.IsCompatibleWith` and `Mafi.Core.Factory.Transports.Transport.buildPorts` that `Transport.StartInputPort` is created with `Direction = Trajectory.StartDirection` and `Transport.EndOutputPort` is created with `Direction = Trajectory.EndDirection`. Both must equal `-port.OutwardNormal` so every belt and pipe snaps into its building port at 100% compatibility.
- Replaced modulo port sharing (`sourceList[dIdx % sourceList.Count]`) with single-claim `PortSlot` tracking (`IsClaimed`) so no two trajectories ever share the same physical port tile.
- Added distinct per-ingredient machine port allocation (`RegisterMachineRecipePorts`) so multi-input/multi-output recipes never bind two products to the same physical port.
- Fixed Tier 1 storage scoring (`ScoreStorageProto`) so `StorageUnit`, `StorageLoose`, and `StorageFluid` (which have no `"T1"` suffix in `Mafi.Base`) are selected ahead of `Storage*T2`.
- **Optimal Manifold Routing with Balancers (`ZipperProto`), Lifts (`LiftProto`), and 3D Pipe/Belt Z-Levels (`Z0 - Z3`):**
- Places 2x2 **Balancers (`Zipper_IoPortShape_FlatConveyor`, `Zipper_IoPortShape_LooseMaterialConveyor`, `Zipper_IoPortShape_Pipe`, `Zipper_IoPortShape_MoltenMetalChannel`)** in the inter-stage corridor whenever a flow fans out (`1 -> N`) or balances multiple machines (`M -> N`), giving every branch its own dedicated port.
- Routes **Pipes** on elevated 3D pipe racks (`Z0 -> Z1/Z2/Z3 -> Z0`, leveraging `Pipe.ZStepLength == 0` vertical riser segments) so pipes never collide with ground-level conveyors.
- Places **Conveyor Lifts (`LiftIoPortShape_*_2` / `LiftIoPortShape_*__2`)** and elevated `Z2` bridges (or conveyor ramps) when secondary conveyor buses cross in the manifold corridor.
- **UI Scaling & Explicit Pipe/Belt Level Badges (`SupplyChainGeneratorWindow.cs`):**
- Expanded window size to `940 x 750` (`Px(940), Px(750)`) and widened stage/storage label columns so all controls and badges fit cleanly without clipping.
- Added live **Transport Tier, Elevation Level (`Z0 -> Z1 -> Z0`), Balancer, and Lift badges** (e.g., `[Pipe T1 (60/60s) @ Z0 -> Z1 -> Z0 | + Pipe Balancer]`) to every Stage and Storage row, plus live footprint (`WxH tiles`) and branch connection counts in the header summary.
- Bumped preset catalog ownership tag to `v=4` (`scbm:id=<id>;v=4`) so all 30 preset blueprints automatically upgrade on load.

## v1.2.0 (2026-11-17)
- **Fixed Belt & Pipe Connections (`ModularBlueprintBuilder.cs`):**
- Replaced manual `pos + port.RelativePosition` math with `IoPortTemplate.GetExpectedConnectedPortPosition(proto.Layout, transform)` and `IoPortTemplate.GetDirection(transform)` so belt and pipe endpoints snap to the exact world tile and direction of each storage and machine port.
- Added automatic building orientation (`ChooseStorageRotation` & `ChooseMachineRotation`) so West Input Storages orient their Output ports East (`+X`), Production Stage Machines orient their Input ports West (`-X`) and Output ports East (`+X`), and East Output Storages orient their Input ports West (`-X`).
- Replaced diagonal fallback pivots (which `TransportTrajectory.tryCreateCurveFromPivots` rejected) with a multi-candidate orthogonal router (`CleanOrthogonalPivots` + `TransportTrajectory.OptimizePivots`) that guarantees strictly orthogonal segments (`dX == 0` or `dY == 0`).
- Left `EntityConfigData.Transform = null` on `TransportProto` entries (setting only `Trajectory`), matching native `EntitiesCloneConfigHelper.CreateConfigFrom`.
- Updated storage resolution to prioritize Tier 1 (`T1`) storages for early-game compatibility.
- Bumped preset catalog tag to `v=3` (`scbm:id=<id>;v=3`) so all 30 preset blueprints automatically upgrade with full belt/pipe wiring.
- **Refined Native UI Interface (`SupplyChainGeneratorWindow.cs`):**
- Organized window into 3 native `PanelWithHeader` sections (`1. Select Target Product & Output Rate (/ 60s)`, `2. Production Chain Stages`, `3. Edge Storages`).
- Added real in-game `Icon` components (`Mafi.Unity.UiToolkit.Library.Icon`) for every product, machine, stage row, and storage row (supporting hover tooltips and right-click Codex).
- Applied `.Selected(isSelected)` and `.Compact()` styling to product, tier, and rate preset buttons.

## v1.1.0 (2026-11-17)
- **Native Default Window & Click-Through Fix:**
- Migrated from legacy Unity `IMGUI` (`OnGUI`) to `Mafi.Unity.UiToolkit.Library.Window` mounted on `UiRoot`, matching default Captain of Industry window styling and blocking all world click-through.
- **Top-Right HUD Bar Icon:**
- Moved the generator button off the top-right date display and attached a native `ButtonIconGlow` (`Blueprints.svg`) into `HudController`'s `m_calendarControls` icon bar right below the date alongside other mods.
- **COI Calculator-Style Rate & Stage Controls:**
- Added adjustable Target Output (`/ 60s`) controls (`-12`, `-6`, `+6`, `+12`, direct text input, and `12/m`–`240/m` presets).
- Added per-stage recipe switching (`Recipe (k/N)`) and one-click toggling between internal stage production (`+ Produce Internally`) and West-edge raw input storages (`To Input Storage`).
- **Compact Layout & Raw Ingredient Storages:**
- Reduced inter-stage and vertical spacing and vertically centered all columns.
- Guaranteed `FluidStorageProto`, `LooseStorageProto`, and `UnitStorageProto` for raw ingredient inputs.

## v1.0.0 (2026-11-17)
- Initial release of `SupplyChainBlueprintsMod` for Captain of Industry v0.8.8 (Update 4.3).
- Added 30 pre-packaged supply chain blueprints across 5 progression folders in `[Supply Chain Modules]`.
- Added in-game Supply Chain Blueprint Generator and console commands (`scb_rebuild_catalog`, `scb_generate`).
This mod depends on

This mod has no dependencies.

Mods that depend on this

No other mods depend on this mod yet.

Loading statistics…