-
Notifications
You must be signed in to change notification settings - Fork 160
Description
Issue
Universal creeps get stuck in a ping-pong loop between spawn and controller due to the 1000-tick downgrade threshold triggering repeatedly.
Root Cause
In prototype_creep_resources.js:17:
if (this.room.controller && (this.room.controller.ticksToDowngrade < CONTROLLER_DOWNGRADE[this.room.controller.level] / 10 || this.room.controller.level === 1)) {
methods.push(Creep.upgradeControllerTask);
}For RCL2, threshold is 10,000 / 10 = 1,000 ticks.
Problem: upgradeControllerTask only calls upgradeController() once per execution, using minimal energy. Then creep moves to next task (transferEnergy). Before reaching spawn, downgrade < 1000 again, triggering another upgrade task.
Observed Behavior
- Creep at spawn with energy
- Controller downgrade < 1000
- Creep moves to controller
- Upgrades once (adds ~1-2 energy to controller)
- Tries to return to spawn
- Downgrade < 1000 again (because only 1-2 energy was added)
- Turns around, goes back to controller
- Loop repeats infinitely
Proposed Solution
When upgradeControllerTask is triggered by the downgrade threshold, creep should empty its entire energy store before moving to the next task.
Option 1: Loop in upgradeControllerTask:
if (range <= CONTROLLER_UPGRADE_RANGE) {
// If triggered by downgrade threshold, empty store
while (creep.carry.energy > 0) {
const returnCode = creep.upgradeController(creep.room.controller);
if (returnCode !== OK) break;
}
return true;
}Option 2: Set a flag when downgrade threshold triggers, check in upgradeControllerTask to drain store.
Option 3: Increase threshold to reduce ping-pong frequency (less ideal - doesn't fix root cause).
Impact
- Bot appears stuck/inefficient
- Very little actual progress on controller
- Energy wasted on movement
- Other tasks (construction, spawn filling) not completed
Environment
- Room: W2N3
- RCL: 2
- Creeps: 1-2 universal creeps
- Observed: 2025-11-22