etc etc..jumbled wrote:Could you please explain the actual math behind crunching mines? I use the MS Excel spreadsheet "Complex Calculator", which works wonders for me to figure out what and how many of everything I need to make a balanced complex, but fails after crunching because ore/silicon mines get crunched sometimes to S size and lose fractions of their output along the way.
I'm also discovering a lot of "fuzzy math" in here which goes far off from your original estimates of 1 to 2 % loss.
after some extensive math and review into Gazz's code (i'm not a programmer so excuse my mistakes please) it appears the newly created Ore/Silicon factories are assumed to be Yield 13.
Each factory S therefore produces 1 ore per 43 secs (or 2 per 86secs if you want to be really pedantic)
Therefore a yield 40 L ore mine.. producing 20 ore every 60 secs (1200 per hour) should be converted to a size 14 factory (1200/3600*43)
How gazz achieved this and helped to reduce fractions was to multiply Product per cycle by 10000 and then divide it by a number (263 in the original i think) to reach his target factory size..
However.. this number is far too large.. and ends up underestimating your factory size by anywhere from 5 to 21% (in the above example you'll only get a size 12 instead of 14 factory).. and it's horrible at small yield asteroids.. i've edited the portions so that they more closely reflect the yield of the original mine.. (and also added the ability to crunch nividium mines in ashley+xtm) This could possibly be a conflict with mods or one of the mods (Ashley's XXL or XTM) changed cycle times in some way?
Edited file available on request.
Changes made plugin.gz.CmpClean.crunch:
$Mine.Fraction.Nividium added
Nividium filtering removed
Code changes to make using in game scripter easier -_-
Increased multiplier to 100000 from 10000
Ore divisor changed to 2326 instead of 263 (average of 13% increase)
Silicon divisor changed to 582 instead of 66 (another 13% increase)
Terracorp Nividium mines added to crunch list.. divisor 19
Major changes below
Code: Select all
Line 70:
$useore = $Station->uses ware {Ore} as product
$usesil = $Station->uses ware {Silicon Wafers} as product
$usenv = $Station->uses ware {Nividium 15_2} as product
if $usenv OR $useore OR $usesil
skip if $Station->get local variable: name='GZ.FACTORY.MODULE'
$Station->set local variable: name='GZ.CC.REAL.MINE' value=[TRUE]
end
Line 294:
if $Station->get local variable: name='GZ.CC.REAL.MINE'
gosub Find.Station.Size.Mine
Find.Station.Size.Mine:
$Dummy1 = $Station->get number of products per cycle
$Dummy2 = $Station->get production cycle time: account for secondary resources=null
* = cycle time in sec, even if out of resources
$Dummy3 = 0
if $Station->uses ware {Ore} as product
$Dummy3 = 2326
$Factory.size = ( $Dummy1 * 100000 ) / $Dummy2 + $Mine.Fraction.Ore
$Dummy1 = ( $Factory.size / $Dummy3 ) * $Dummy3
$Mine.Fraction.Ore = $Factory.size - $Dummy1
$Factory.size = $Factory.size / $Dummy3
else if $Station->uses ware {Silicon Wafers} as product
$Dummy3 = 582
$Factory.size = ( $Dummy1 * 100000 ) / $Dummy2 + $Mine.Fraction.Silicon
$Dummy1 = ( $Factory.size / $Dummy3 ) * $Dummy3
$Mine.Fraction.Silicon = $Factory.size - $Dummy1
$Factory.size = $Factory.size / $Dummy3
else if $Station->uses ware {Nividium 15_2} as product
$Dummy3 = 19
$Factory.size = ( $Dummy1 * 100000 ) / $Dummy2 + $Mine.Fraction.Nividium
$Dummy1 = ( $Factory.size / $Dummy3 ) * $Dummy3
$Mine.Fraction.Nividium = $Factory.size - $Dummy1
$Factory.size = $Factory.size / $Dummy3
end
endsub