pub const CONTROLLER_DOWNGRADE_SAFEMODE_THRESHOLD: u32 = 5000;
Expand description

Ticks under 50% of controller_downgrade max that safe mode becomes unavailable.

Once the StructureController::ticks_to_downgrade timer is reduced to a certain level by Creep::attack_controller or lack of Creep::upgrade_controller activity, safe mode cannot be activated.

The point at which this occurs is half of the controller_downgrade total for the current level, minus this amount. Note that because a room’s StructureController::ticks_to_downgrade is placed at exactly 50% after an upgrade or downgrade.

Quoting from the 3.2.0 patch notes:

  • When the controller gains or loses one level, its downgrade timer is set to 50% instead of 100%.
  • Safe mode activation unavailable period starts from this 50% point minus 5000 ticks.

For example, a newly upgraded RCL7 room will have 75_000 ticks to downgrade out of its 150_000 maximum, and safe mode becomes unavailable if the timer falls below 70_000 ticks.