Skip to content

Universal creeps ping-pong between spawn and controller at RCL2 #751

@TooAngel

Description

@TooAngel

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

  1. Creep at spawn with energy
  2. Controller downgrade < 1000
  3. Creep moves to controller
  4. Upgrades once (adds ~1-2 energy to controller)
  5. Tries to return to spawn
  6. Downgrade < 1000 again (because only 1-2 energy was added)
  7. Turns around, goes back to controller
  8. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions