Overhaul infrastructure: replace GPU model with rack-centric system
CI / build-and-push (push) Successful in 33s

Replace flat GPU buying with a realistic data center + rack pipeline:
- 4 DC tiers (small/medium/large/mega) with construction time, dual
  capacity constraints (rack slots + power budget kW), and era/research
  gating
- 10 predefined rack SKUs from consumer GPUs through custom ASICs, each
  with unique FLOPS, power draw, cost, and pipeline timings
- 6-stage procurement pipeline (order → mfg → receive → install → test
  → production) with Kanban UI, talent-influenced speed bonuses
- Test failures (5-25% base rate) reduced by cooling, ops talent, and QA
  research; auto-repair with cost and re-test cycle
- Production failures at low per-tick rate, racks sent to repair pipeline
- Cooling and redundancy upgrades per DC (reduce failure rates)
- 4 new tech tree nodes (DC Engineering II/III/IV, Quality Assurance)
- Save version bump (1→2) with migration that resets old saves
- Updated economy system to account for rack repair costs
- Redesigned Infrastructure page with pipeline Kanban, capacity bars,
  rack ordering, and DC upgrade panels

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-24 19:41:55 -04:00
parent 1af9408c87
commit 0005e580a7
14 changed files with 1051 additions and 295 deletions
+208 -3
View File
@@ -1,3 +1,5 @@
import type { DCTier, DCTierConfig, RackSkuId, RackSkuConfig } from '../types/infrastructure';
export const TICK_INTERVAL_MS = 1000;
export const MAX_OFFLINE_TICKS = 86_400;
export const OFFLINE_EFFICIENCY = 0.8;
@@ -10,7 +12,6 @@ export const MAX_REPUTATION_HISTORY = 500;
export const STARTING_MONEY = 50_000;
export const BASE_ENERGY_COST_PER_FLOP = 0.001;
export const BASE_MAINTENANCE_PER_GPU = 0.005;
export const TRAINING_BASE_TICKS = 120;
export const TRAINING_COMPUTE_MULTIPLIER = 0.8;
@@ -37,9 +38,213 @@ export const ERA_THRESHOLDS = {
agi: { revenue: 100_000_000, capability: 90, reputation: 70 },
};
export const GPU_PRICE_VOLATILITY = 0.02;
export const GPU_FAILURE_RATE_BASE = 0.0001;
// --- Data Center Tier Configs ---
export const DC_TIER_CONFIGS: Record<DCTier, DCTierConfig> = {
small: {
tier: 'small',
name: 'Small Data Center',
rackSlots: 12,
powerBudgetKW: 60,
baseCost: 10_000,
buildTimeTicks: 300,
firstBuildTimeTicks: 10,
requiredEra: 'startup',
requiredResearch: null,
baseEnergyCostPerTick: 5,
},
medium: {
tier: 'medium',
name: 'Medium Data Center',
rackSlots: 30,
powerBudgetKW: 200,
baseCost: 50_000,
buildTimeTicks: 900,
firstBuildTimeTicks: 900,
requiredEra: 'scaleup',
requiredResearch: 'dc-engineering-ii',
baseEnergyCostPerTick: 15,
},
large: {
tier: 'large',
name: 'Large Data Center',
rackSlots: 60,
powerBudgetKW: 500,
baseCost: 200_000,
buildTimeTicks: 1800,
firstBuildTimeTicks: 1800,
requiredEra: 'bigtech',
requiredResearch: 'dc-engineering-iii',
baseEnergyCostPerTick: 40,
},
mega: {
tier: 'mega',
name: 'Mega Data Center',
rackSlots: 120,
powerBudgetKW: 1200,
baseCost: 1_000_000,
buildTimeTicks: 3600,
firstBuildTimeTicks: 3600,
requiredEra: 'agi',
requiredResearch: 'dc-engineering-iv',
baseEnergyCostPerTick: 100,
},
};
// --- Rack SKU Configs ---
export const RACK_SKU_CONFIGS: Record<RackSkuId, RackSkuConfig> = {
'consumer-x4': {
id: 'consumer-x4',
name: 'Consumer GPU x4',
era: 'startup',
gpuCount: 4,
flopsPerRack: 4,
powerDrawKW: 0.4,
baseCost: 3_200,
requiredResearch: null,
pipelineTimeTicks: { manufacturing: 20, receiving: 10, installation: 15, testing: 15 },
testFailureRate: 0.05,
productionFailureRate: 0.0002,
repairCostFraction: 0.10,
},
't4-x4': {
id: 't4-x4',
name: 'NVIDIA T4 x4',
era: 'startup',
gpuCount: 4,
flopsPerRack: 32,
powerDrawKW: 1.2,
baseCost: 20_000,
requiredResearch: null,
pipelineTimeTicks: { manufacturing: 30, receiving: 15, installation: 25, testing: 20 },
testFailureRate: 0.07,
productionFailureRate: 0.0003,
repairCostFraction: 0.12,
},
't4-x8': {
id: 't4-x8',
name: 'NVIDIA T4 x8',
era: 'scaleup',
gpuCount: 8,
flopsPerRack: 64,
powerDrawKW: 2.4,
baseCost: 38_000,
requiredResearch: null,
pipelineTimeTicks: { manufacturing: 40, receiving: 20, installation: 30, testing: 30 },
testFailureRate: 0.08,
productionFailureRate: 0.0003,
repairCostFraction: 0.12,
},
'a100-x4': {
id: 'a100-x4',
name: 'NVIDIA A100 x4',
era: 'scaleup',
gpuCount: 4,
flopsPerRack: 160,
powerDrawKW: 4.0,
baseCost: 60_000,
requiredResearch: 'advanced-gpu-arch',
pipelineTimeTicks: { manufacturing: 60, receiving: 25, installation: 50, testing: 45 },
testFailureRate: 0.10,
productionFailureRate: 0.0004,
repairCostFraction: 0.15,
},
'a100-x8': {
id: 'a100-x8',
name: 'NVIDIA A100 x8',
era: 'scaleup',
gpuCount: 8,
flopsPerRack: 320,
powerDrawKW: 8.0,
baseCost: 115_000,
requiredResearch: 'advanced-gpu-arch',
pipelineTimeTicks: { manufacturing: 70, receiving: 30, installation: 55, testing: 55 },
testFailureRate: 0.12,
productionFailureRate: 0.0004,
repairCostFraction: 0.15,
},
'h100-x4': {
id: 'h100-x4',
name: 'NVIDIA H100 x4',
era: 'bigtech',
gpuCount: 4,
flopsPerRack: 480,
powerDrawKW: 5.6,
baseCost: 140_000,
requiredResearch: 'next-gen-gpu',
pipelineTimeTicks: { manufacturing: 80, receiving: 30, installation: 65, testing: 65 },
testFailureRate: 0.15,
productionFailureRate: 0.0005,
repairCostFraction: 0.18,
},
'h100-x8': {
id: 'h100-x8',
name: 'NVIDIA H100 x8',
era: 'bigtech',
gpuCount: 8,
flopsPerRack: 960,
powerDrawKW: 11.2,
baseCost: 270_000,
requiredResearch: 'next-gen-gpu',
pipelineTimeTicks: { manufacturing: 90, receiving: 35, installation: 75, testing: 80 },
testFailureRate: 0.18,
productionFailureRate: 0.0005,
repairCostFraction: 0.18,
},
'b200-x4': {
id: 'b200-x4',
name: 'NVIDIA B200 x4',
era: 'bigtech',
gpuCount: 4,
flopsPerRack: 1600,
powerDrawKW: 8.0,
baseCost: 200_000,
requiredResearch: 'frontier-compute',
pipelineTimeTicks: { manufacturing: 100, receiving: 40, installation: 80, testing: 80 },
testFailureRate: 0.20,
productionFailureRate: 0.0006,
repairCostFraction: 0.20,
},
'b200-x8': {
id: 'b200-x8',
name: 'NVIDIA B200 x8',
era: 'agi',
gpuCount: 8,
flopsPerRack: 3200,
powerDrawKW: 16.0,
baseCost: 380_000,
requiredResearch: 'frontier-compute',
pipelineTimeTicks: { manufacturing: 120, receiving: 45, installation: 95, testing: 100 },
testFailureRate: 0.22,
productionFailureRate: 0.0006,
repairCostFraction: 0.20,
},
'custom-x8': {
id: 'custom-x8',
name: 'Custom ASIC x8',
era: 'agi',
gpuCount: 8,
flopsPerRack: 6400,
powerDrawKW: 20.0,
baseCost: 640_000,
requiredResearch: 'custom-silicon',
pipelineTimeTicks: { manufacturing: 140, receiving: 50, installation: 100, testing: 110 },
testFailureRate: 0.25,
productionFailureRate: 0.0008,
repairCostFraction: 0.20,
},
};
// --- Pipeline & Infrastructure Constants ---
export const PIPELINE_ORDER_BASE_TICKS = 15;
export const RACK_REPAIR_BASE_TICKS = 30;
export const BASE_MAINTENANCE_PER_RACK = 0.02;
export const COOLING_FAILURE_REDUCTION = 0.5;
export const REDUNDANCY_FAILURE_REDUCTION = 0.5;
export const DC_UPGRADE_COST_FRACTION = 0.25;
export const DC_UPGRADE_INCREMENT = 0.1;
export const FUNDING_ROUNDS = {
seed: { amount: 100_000, dilution: 0.10, requirements: { minRevenue: 100, minUsers: 0, minReputation: 0 } },
+1 -1
View File
@@ -60,4 +60,4 @@ export const INITIAL_SETTINGS: GameSettings = {
sfxVolume: 0.7,
};
export const SAVE_VERSION = 1;
export const SAVE_VERSION = 2;
+92 -45
View File
@@ -1,33 +1,112 @@
import type { Era } from './gameState';
export interface InfrastructureState {
dataCenters: DataCenter[];
gpuMarketPrices: Record<GpuType, number>;
totalFlops: number;
totalUptime: number;
// --- Data Center ---
export type DCTier = 'small' | 'medium' | 'large' | 'mega';
export type DCStatus = 'constructing' | 'operational';
export interface DCTierConfig {
tier: DCTier;
name: string;
rackSlots: number;
powerBudgetKW: number;
baseCost: number;
buildTimeTicks: number;
firstBuildTimeTicks: number;
requiredEra: Era;
requiredResearch: string | null;
baseEnergyCostPerTick: number;
}
export interface DataCenter {
id: string;
name: string;
location: LocationId;
gpus: GpuInventory[];
maxCapacity: number;
tier: DCTier;
status: DCStatus;
constructionProgress: number;
constructionTotal: number;
racks: Rack[];
coolingLevel: number;
redundancyLevel: number;
currentUptime: number;
energyCostPerTick: number;
maintenanceCostPerTick: number;
usedSlots: number;
usedPowerKW: number;
}
export interface GpuInventory {
type: GpuType;
count: number;
healthyCount: number;
failedCount: number;
// --- Racks ---
export type RackSkuId =
| 'consumer-x4' | 't4-x4' | 't4-x8'
| 'a100-x4' | 'a100-x8'
| 'h100-x4' | 'h100-x8'
| 'b200-x4' | 'b200-x8' | 'custom-x8';
export type PipelineStage =
| 'ordered' | 'manufacturing' | 'receiving'
| 'installation' | 'testing' | 'repair';
export interface PipelineTimings {
manufacturing: number;
receiving: number;
installation: number;
testing: number;
}
export type GpuType = 'consumer' | 't4' | 'a100' | 'h100' | 'b200' | 'custom';
export interface RackSkuConfig {
id: RackSkuId;
name: string;
era: Era;
gpuCount: number;
flopsPerRack: number;
powerDrawKW: number;
baseCost: number;
requiredResearch: string | null;
pipelineTimeTicks: PipelineTimings;
testFailureRate: number;
productionFailureRate: number;
repairCostFraction: number;
}
export interface Rack {
id: string;
skuId: RackSkuId;
dataCenterId: string;
isHealthy: boolean;
}
export interface RackOrder {
id: string;
skuId: RackSkuId;
dataCenterId: string;
stage: PipelineStage;
stageProgress: number;
stageTotal: number;
totalCost: number;
repairCount: number;
}
// --- Infrastructure State ---
export interface InfrastructureState {
dataCenters: DataCenter[];
rackPipeline: RackOrder[];
totalFlops: number;
totalUptime: number;
totalRackCount: number;
}
export const INITIAL_INFRASTRUCTURE: InfrastructureState = {
dataCenters: [],
rackPipeline: [],
totalFlops: 0,
totalUptime: 1,
totalRackCount: 0,
};
// --- Locations (unchanged) ---
export type LocationId = 'us-west' | 'us-east' | 'eu-west' | 'eu-north' | 'asia-east' | 'asia-south' | 'middle-east';
@@ -41,24 +120,6 @@ export interface LocationConfig {
availableAt: Era;
}
export interface GpuConfig {
type: GpuType;
name: string;
flopsPerUnit: number;
basePowerDraw: number;
basePrice: number;
availableAt: Era;
}
export const GPU_CONFIGS: Record<GpuType, GpuConfig> = {
consumer: { type: 'consumer', name: 'Consumer GPU', flopsPerUnit: 1, basePowerDraw: 0.3, basePrice: 800, availableAt: 'startup' },
t4: { type: 't4', name: 'NVIDIA T4', flopsPerUnit: 8, basePowerDraw: 0.5, basePrice: 5_000, availableAt: 'startup' },
a100: { type: 'a100', name: 'NVIDIA A100', flopsPerUnit: 40, basePowerDraw: 1.0, basePrice: 15_000, availableAt: 'scaleup' },
h100: { type: 'h100', name: 'NVIDIA H100', flopsPerUnit: 120, basePowerDraw: 1.2, basePrice: 35_000, availableAt: 'scaleup' },
b200: { type: 'b200', name: 'NVIDIA B200', flopsPerUnit: 400, basePowerDraw: 1.5, basePrice: 50_000, availableAt: 'bigtech' },
custom: { type: 'custom', name: 'Custom ASIC', flopsPerUnit: 800, basePowerDraw: 1.0, basePrice: 80_000, availableAt: 'agi' },
};
export const LOCATION_CONFIGS: Record<LocationId, LocationConfig> = {
'us-west': { id: 'us-west', name: 'US West (Oregon)', energyCostMultiplier: 1.0, latencyTier: 1, regulatoryStrictness: 0.3, politicalStability: 0.9, availableAt: 'startup' },
'us-east': { id: 'us-east', name: 'US East (Virginia)', energyCostMultiplier: 1.1, latencyTier: 1, regulatoryStrictness: 0.3, politicalStability: 0.9, availableAt: 'startup' },
@@ -68,17 +129,3 @@ export const LOCATION_CONFIGS: Record<LocationId, LocationConfig> = {
'asia-south': { id: 'asia-south', name: 'Asia South (Mumbai)', energyCostMultiplier: 0.6, latencyTier: 3, regulatoryStrictness: 0.2, politicalStability: 0.7, availableAt: 'bigtech' },
'middle-east': { id: 'middle-east', name: 'Middle East (UAE)', energyCostMultiplier: 0.5, latencyTier: 3, regulatoryStrictness: 0.1, politicalStability: 0.6, availableAt: 'bigtech' },
};
export const INITIAL_INFRASTRUCTURE: InfrastructureState = {
dataCenters: [],
gpuMarketPrices: {
consumer: 800,
t4: 5_000,
a100: 15_000,
h100: 35_000,
b200: 50_000,
custom: 80_000,
},
totalFlops: 0,
totalUptime: 1,
};
+3 -3
View File
@@ -31,9 +31,9 @@ export interface ResearchNode {
}
export interface ResearchEffect {
type: 'unlock_gpu' | 'unlock_model_tier' | 'efficiency_boost'
| 'capability_boost' | 'cost_reduction' | 'unlock_feature'
| 'unlock_product_line' | 'safety_boost';
type: 'unlock_gpu' | 'unlock_rack' | 'unlock_dc_tier' | 'unlock_model_tier'
| 'efficiency_boost' | 'capability_boost' | 'cost_reduction'
| 'unlock_feature' | 'unlock_product_line' | 'safety_boost';
target: string;
value: number;
}