pub const SPAWN_RENEW_RATIO: f32 = 1.2;
Expand description

Additional TTL bonus, and reduction in energy cost, when renewing a creep compared to spawning.

Quoting from StructureSpawn.renewCreep documentation:

Each execution increases the creep’s timer by amount of ticks according to this formula: floor(600/body_size)

Energy required for each execution is determined using this formula:

ceil(creep_cost/2.5/body_size)

600 in the TTL addition formula is calculated as SPAWN_RENEW_RATIO * CREEP_LIFE_TIME / CREEP_SPAWN_TIME, or 1.2 * 1500 / 3 == 600

2.5 in the cost formula is calculated as CREEP_SPAWN_TIME / SPAWN_RENEW_RATIO, or 3 / 1.2 == 2.5