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 usesgetEnergy
screeps/src/prototype_creep_resources.js
Line 652 in 2c32500
I would add something likegetEnergyFromRuins
, searching for ruins, move to them, pickup, likegetDroppedEnergy
. 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
screeps/src/prototype_creep_resources.js
Line 347 in 2c32500
withdrawContainers
would be similar.
So if you like have a look, let's discuss here or send a Pull Request.