Skip to content

Feature: Smart Scaling - Auto-generate manifold infrastructure when scaling production buildings #255

@majormer

Description

@majormer

Summary

When scaling production buildings (Constructors, Assemblers, Manufacturers, etc.), Smart! could automatically generate the complete manifold infrastructure needed to support them - splitters/mergers, belts, power poles, and wiring - with all settings (recipe, clock speed, shards, sloops) copied to each child.

Origin

This concept emerged from donor feedback analysis. Users want a "zero-brain" experience where scaling a production building results in a fully-connected, ready-to-use manifold setup without manual wiring.

Proposed Behavior

When enabled via config setting, scaling a production building would:

  1. Auto-spawn splitters/mergers - One per input/output, positioned to form a manifold
  2. Auto-spawn belts - Connect each machine to its splitter/merger
  3. Auto-spawn power poles - Shared or per-machine power infrastructure
  4. Auto-wire power - Connect all machines to the power grid
  5. Copy settings - Recipe, clock speed, shards, sloops applied to all children
  6. Chain manifold lanes - Connect distributors to form proper input/output manifolds

How This Differs from Existing Features

Feature What It Does Limitation
Scaling (current) Spawns N copies of a building in a grid No logistics, no power, no connections
Auto-Connect (current) Connects distributors to nearby buildings Only works for distributors, not factories
EXTEND (current) Clones existing infrastructure Requires existing infrastructure to clone
Smart Scaling (proposed) Generates complete manifold infrastructure Solves the "kickstart" problem

Existing Code to Leverage

  • Distributor spawning: SFManifoldJSON.cpp already spawns splitters/mergers as children
  • Belt spawning: SFConveyorBeltHologram handles belt child holograms
  • Power wiring: SFPowerAutoConnectManager manages power connections
  • Recipe copying: SFRecipeManagementService copies recipes to children
  • Building size lookup: SFBuildableSizeRegistry knows dimensions for spacing
  • Connector discovery: SFAutoConnectService finds compatible connectors

Open Questions

  • Where should distributors be placed? (Behind machine? To the side? Configurable?)
  • Belt tier selection? (Config setting? Auto-detect from recipe throughput?)
  • Power pole placement strategy? (One per machine? Shared pole for row?)
  • Pipe support? (Same logic for junctions + pipelines for fluid machines?)
  • Visual preview of manifold before building?

Dependencies

This feature sits on top of the Scaling system and should be implemented after the Scaling Refactor (#225) is complete. The refactor addresses fundamental issues with how Scaling uses "lock" children holograms, which would affect how Smart Scaling spawns and manages its additional child holograms.

Blocked by:

Related issues:

Priority

Medium - This is a significant quality-of-life enhancement but requires foundational work first.

Labels

enhancement, scaling, future-feature

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions