upgradeController keeps getting cancelled?



  • When I transferEnergy to a spawn the creep continues transferring until it's done, but when I use upgradeController the creep deposits 1-2 energy and then it gets cancelled to go do something else.

    Why does transferEnergy block and upgradeController not block?



  • What do you mean? TransferEnergy can transfer the full capacity of the creep at once, if enough energy is available. UpgradeController uses 1 energy per work part to upgrade the controller. It is not an instantanious upgrade.



  • @needz upgradeController is in the same category like build, harvest and repair... they are WORK tasks and consume a certain amount of energy to generate a certain progress.

    The constant UPGRADE_CONTROLLER_POWER shows you, how much "upgrade" you get per WORK part and how much energy it costs. At the moment this is 1, which means, your creep consumes #WORKparts x 1 energy and generates the same amount of controller progress.



  • It seems like there are some errors in logic of your Upgrader-creep. If you check amount of energy every tick and order your creep to go harvest missing amount, creep will finish upgrade until its done even after the first tick, because he already wasted 1-2 energy for upgrading.