Calculating Ware And Factory Details from X3 File Values OK, here's what I found, I'm sure you already know a lot of it: The game files have 4 relevent values for both wares and factories: Production RelVal (NPC) = NRV Production RelVal (player) = PRV Price modifier (1) = PM1 Price modifier (2) = PM2 and SIZE (factories only) Ware Details: Files are : Factor Factor1 TWareE.txt = 'Energy' - 4 TWareB.txt = 'Basic' 0 5.25 TWareM.txt = 'Mines' 0 5.25 TWareF.txt = 'Food' 1 12.140625 TWareT.txt = 'Tech' 2 28.07519531 TMissiles.txt 2 28.07519531 TLaser.txt 3 64.92388916 Factor1 = 5.25 * 2.3125 ^ Factor except EnergyCells where Factor1 = 4 The average price stated by X3 in-game, in the factory details window: AveragePrice = FLOOR(Factor1 * NRV, 4) The price range available to set in the same window: PriceRange = AveragePrice * PM1 / 100 MinPrice = CEILING(AveragePrice - PriceRange, 1) MaxPrice = FLOOR(AveragePrice + PriceRange, 1) note: AveragePrice is not always equal to (MinPrice + MaxPrice) / 2 Factory Details: For each factory, an S sized factory of that type has a calculated production per cycle, SMadePerCycle, using this, and the product-ware's PRV (ProdPRV), the CycleTime is calculated. For S-sized SolarPowerPlants these are fixed at: SMadePerCycle = 276 CycleTime = 118 (and ResourceUsedPerCycle (crystals) = 2) For all others: Mines: You worked the formulae for these out yourself previously, it's the same calc. for Ore (BaseFactor 600) & Silicon (BaseFactor 2400), as for Nividium (BaseFactor 76800). 1 BaseCycleTime = FLOOR(BaseFactor / (nAsteroidYield + 1) + 1, 1) 2 SMadePerCycle (your 'Multiplier) = FLOOR(59.9 / BaseCycleTime + 1, 1) 3 CycleTime = BaseCycleTime * SMadePerCycle 4 SResourceUsedPerCycle [Energy Cells] = SMadePerCycle * ProdPRV / ResNRV [4] Non-Mines: 1 Initially SMadePerCycle is set to = CEILING(60 / ProdPRV, 1) 2 SResourceUsedPerCycle = SMadePerCycle * ProdPRV / ResNRV The ResourceUsedPerCycle are calculated for each resource, but if any of these are not integers, the SMadePerCycle is incremented, until they all are. An example of a lot of increments is with QuantumTube fabs, initial value 1 made/cycle gets incremented to 24 made/cycle, since with 1/cycle the silicon usage/cycle is 1*100/96 = 1 & 1/24, at 24 made/cycle usage is 25 silicon/cycle. 3 CycleTime (for all sizes of factories with this product, for a given race) = ProdPRV * SMadePerCycle (seconds) Then for both Mines & Non-Mines: SProductStock = FLOOR(20000 / ProdNRV, 2) but minimum of 8 ProductStock = SIZE * SProductStock; MadePerCycle = SIZE * SMadePerCycle ResourceUsedPerCycle = SIZE * SResourceUsedPerCycle Resource Stock: BaseStock = SProductStock for factory with a product of this Resource Adjust = CEILING(MadePerCycle * ProdNRV / 10000, 1) that was the tricky bit to find ResourceStock = SIZE * BaseStock * Adjust Actually it's probable that mines use the same formulae as non-mines for SMadePerCycle, SResourceUsedPerCycle & CycleTime, since if you substitute the mine BaseCycleTime for ProdPRV in the line '1 Initially SMadePerCycle is set to = CEILING(60 / ProdPRV, 1)' above (& only in this line), then you don't need the lines 2,3 and 4 in the Mines section, & I pretty sure you get the same result. But in coding terms (in my prog. at least), it's easier to use your mine-formulae, due to asteroid yield being a user-interactive value (ie I cannot pre-setup mines in a S-sized factory list). That Adjust variable above, gives rise to the higher resource stocking levels seen in gPPC, 10GJ shield etc, it's even more extreme for a CIG-Forge, where an XXL size factory has an ECell stock of 8,400,000, ie 84 times the 100,000 that would have been calculated with simple scaling (20 * 5000). There's a slight problem though, for the latter factory, the factor of 84 (Adjust), gives a Cahoona resource stock level of 84 * 66640 = 5,597,760 whereas in-game this number is 5,600,000 (84 * 66,666.666etc), which leads me to conclude that I should store a non-rounded S-sized factory product stock-level value, and only round at present-to-user time. Finally: FactoryPrice = Factory NRV * N, where N is 64.92388916 (ie the same factor as used in Laser ware-type prices)