TooAngel/screeps

How to deal with ruins

Opened this issue · 1 comments

I'm a beginner, and I found that there are some ruins in my room that are not handled well.
So may I ask which code is responsible for the ruins.

Ruins are not yet handled.
A room has two stages:

  • Before storage where creeps are moving more freely, mostly defined in prototype_creep_startup_tasks. It uses getEnergy

    Creep.prototype.getEnergy = function() {
    to decide where to get energy from.
    I would add something like getEnergyFromRuins, searching for ruins, move to them, pickup, like getDroppedEnergy. The method should consider if it makes sense to move there (low resources, low time to decay => maybe not)

  • With storage: Most of the creeps move on the precalculated paths. So ruins should be mostly on the path itself and can be picked up by the next creep passing by (no need to move there). pickupEnergy

    Creep.prototype.pickupEnergy = function() {
    is used for that, I guess withdrawContainers would be similar.

So if you like have a look, let's discuss here or send a Pull Request.