Commit Graph

5 Commits

Author SHA1 Message Date
reaperrr
6ff394991d Fixed AI BaseBuilder low power check.
This was extremely borked:
The priority overrides for refinery, production and silo ignored power completely and never checked whether the structure might drive the AI into low power state; whereas the check for regular building checked whether the structure's power -exceeded- MinimumExcessPower (previously just 0). The catch is that power draw is represented by negative numbers, so the only buildings that would trigger this were - power plants.
Now it checks whether the sum of building power draw (negative) and AI's current power level are lower than MinimumExcessPower, if not, build the structure, if yes, build a power plant instead.
Additionally, this check is now performed for the early-game priority overrides as well.

Last but not least the AI would not(!) give power plants priority if it was already low on power. This has been fixed as well.
2015-07-27 13:06:18 +02:00
RoosterDragon
942ce6b5a6 Throttle the issuing of orders by the AI.
To prevent the AI generating lag spikes by issuing too many orders in a single tick, it is now limited in how many orders can be issued per tick. Extra orders are queued. This allows the performance hit of issuing multiple orders to be spread out over several ticks.
2015-07-26 12:57:19 +01:00
reaperrr
27ffd4967a AI base builder power tweaks 2015-07-07 22:22:59 +02:00
RoosterDragon
1515ac54f6 Enforce a line length limit. 2015-03-19 17:20:34 +00:00
penev92
6c6a4322ed Move the AI namespace to Mods.Common 2015-02-09 16:57:29 +02:00