Just when you thought you'd seen it all ... just when you thought the poor old nag of a dead horse had been beaten into soap ... out pops another UNIT HURRY COST FORMULA! WOOHOO!
Everything I've done here is based on what others did before, I just made it work in a spreadsheet. How it works is that you enter the hurry cost and base production, and the spreadsheet returns 2 costs: minimum build cost & 10-surplus build cost.
Okay, so you've hit "hurry" on a unit and a cost pops up. How many minerals does that represent? We know we can look it up on the chart, but a formula would be better for a spreadsheet.
Let the full hurry Cost be "C". Inverting the famous x^2 / 20 + 2x equation means we must take the positive root of the quadratic formula:
10 * ((C / 5 + 4) - 2)
Rounded to the nearest integer, this exactly matches the chart!
The actual spreadsheet formula (where "B4" is the cell containing variable "C") looks like this:
ROUND(10 * (SQRT(B4 / 5 + 4) - 2))
Let's call that answer "M". (Mineral cost remaining.)
Now the Unit Cost = C / M, call that "U".
Let base production be "P".
Now the Exact Cost = ROUNDUP((M - P) * U)
And the 10-Over Cost = ROUNDUP((M - P + 10) * U)
The formulas I've given should be easy to plug into a spreadsheet (considering I just read them off mine to post this). Never look stuff up on tables again!
P.S. If you're under 10 stored minerals you'll have to halve the input cost and double the output cost for the formulas to work, and for prototype rush-builds you're on your own.
Everything I've done here is based on what others did before, I just made it work in a spreadsheet. How it works is that you enter the hurry cost and base production, and the spreadsheet returns 2 costs: minimum build cost & 10-surplus build cost.
Okay, so you've hit "hurry" on a unit and a cost pops up. How many minerals does that represent? We know we can look it up on the chart, but a formula would be better for a spreadsheet.
Let the full hurry Cost be "C". Inverting the famous x^2 / 20 + 2x equation means we must take the positive root of the quadratic formula:
10 * ((C / 5 + 4) - 2)
Rounded to the nearest integer, this exactly matches the chart!
The actual spreadsheet formula (where "B4" is the cell containing variable "C") looks like this:
ROUND(10 * (SQRT(B4 / 5 + 4) - 2))
Let's call that answer "M". (Mineral cost remaining.)
Now the Unit Cost = C / M, call that "U".
Let base production be "P".
Now the Exact Cost = ROUNDUP((M - P) * U)
And the 10-Over Cost = ROUNDUP((M - P + 10) * U)
The formulas I've given should be easy to plug into a spreadsheet (considering I just read them off mine to post this). Never look stuff up on tables again!
P.S. If you're under 10 stored minerals you'll have to halve the input cost and double the output cost for the formulas to work, and for prototype rush-builds you're on your own.
Comment