Page 2 of 2

Posted: 01 Dec 2005, 20:55
by Veylon
Sure, it's literal, and sometimes metal is wasted when a new energy storage is built (energy takes a while to climb to 50%, so no units get built). I do need to fix the factory algorithm.

I suppose the "don't build what can't be afforded" sounded like stockpile, but income/expenditure is checked by using the following logic in pseudocode:

Code: Select all

TimeToBuild = BuildTime / BuilderTime;
EnergyPerSecond = EnergyCost / TimeToBuild;
IF EnergyPerSecond > (EnergyIncome - EnergyExpense) - EnergyStockpile / BuildTime 
    TooExpensive
ELSE
    NotTooExpensive
And the same is checked for the metal.
Yes, I know that it assumes the whole stockpile is available for the project, but it usually works out OK anyway.