Looking at this request, I'll build a comprehensive production optimizer for factory-style production chains. Let me plan the architecture:
Core features:
- Recipe database forming a tech tree (raw → intermediates → advanced like Assembly Director System)
- Production optimizer that calculates required machines at each stage
- Auto-layout engine that arranges buildings to minimize belt crossings
- Interactive grid canvas with drag, zoom, flow indicators
- Save/load multiple factories via localStorage
- Adjustable target outputs with live recalculation
- Satisfying dark industrial UI with neon accents
Let me build this now.
The build succeeded. Here's what I built:
🏭 Production Optimizer — Factory Layout Planner
A complete, production-ready web app for designing optimized factory build plans.
Core Features Delivered
🎯 Automatic Production Optimizer
- Pick any target product (from Iron Plates all the way up to the Assembly Director System)
- Set a target output rate with a slider + presets (1/5/15/30/60/120/min)
- The engine recursively calculates every intermediate stage — how many smelters, constructors, assemblers, and manufacturers you need
- Shows exact raw input rates so you know how many miners/resource nodes to set up
🗺️ Grid-based Factory Canvas
- SVG-rendered factory layout on a pannable/zoomable grid
- Every building is draggable — reposition to fit your actual factory plot
- Buildings are auto-sized based on machine type (miners 2×2, manufacturers 4×4, etc.) and scaled by count
- Auto-Layout button runs a barycentric heuristic that arranges buildings by tier (raw→intermediate→advanced→ultimate) to minimize belt crossings
➰ Flow Visualization
- Animated conveyor belts between every connected stage with color-coded item types
- Belt thickness scales with flow rate
- Floating badges on each belt showing exact items/min
- End-game items get a pulsing golden glow
💾 Modular & Savable Factories
- Name each factory and save to localStorage
- Load menu with thumbnail list of all saved plans
- Export/import JSON files for sharing layouts
📊 Production Panel
- Live stats: total machines, stages, belt lines, raw inputs
- Raw resource requirements clearly listed
- Click any building for a detailed drill-down: inputs, outputs, connected stages, cycle time
- Grouped tier-by-tier breakdown
🎨 Satisfying UI
- Dark industrial theme with amber/gold accents
- Category-based color coding (raw=blue, intermediate=bronze, advanced=purple, ultimate=gold)
- Custom scrollbars, glowing range sliders, animated belts, hover states everywhere
Tech Tree (30+ recipes)
Raw ores (iron, copper, limestone, coal, caterium, crude oil, water) → Ingots → Iron plates, rods, screws, wire, cable, concrete, steel beams, plastic, rubber, quickwire → Reinforced iron plates, rotors, stators, modular frames, motors, circuit boards, AI limiters, encased industrial beams, heavy modular frames, computers, supercomputers, adaptive control units → Assembly Director System 🛰️
Files built: src/types.ts, src/data/recipes.ts, src/lib/optimizer.ts, src/lib/layout.ts, src/lib/storage.ts, src/components/FactoryCanvas.tsx, src/components/Sidebar.tsx, src/components/ProductionPanel.tsx, src/App.tsx, index.html, src/index.css