From wiki, my bad for not researching first:
"Shard 3
Launched in November 2018, Shard 3 was billed as a 'non-subscription' shard. All players on this shard are limited to a max of 20 CPU (regardless of GCL/Sub/unlock status), which slightly evens the playing field for older players vs new ones. This shard again had a 60 day cooldown where travelers could not come from other shards, you could only respawn or spawn onto the shard."
@virus_377b2d
I agree with the points left by @Bazsi1224 . I am in a similar spot with my code. I was able to pretty easily add the profiler linked on the "Third Party Tools" part of the documentation site. It's a quick setup and can point you in the direction of function calls that are eating up larger portions of your CPU. Hope this helps.
So I ran the profiler and I find the result quite interesting. Most of the CPU usage is indeed pathfinding and creep.moveTo(). Seems I will start working on caching paths in memory now. Thanks for the help!
It seems I found a solution. Now I am just directly accessing memory at a specific index. It's possible to simply write memory.roomData[index] = some_data; and it will create a new object index at that position.
You may want to join the discord server https://discord.gg/screeps and ask for help in the #world-help channel. There people can provide in-depth help easily
Anyways to give you a brief answer, you'll want to use FIND_TOMBSTONES instead of FIND_DROPPED_RESOURCES. Then filter tombstones with store.* values matching what resources you want. https://docs.screeps.com/api/#Room.find
let me make sure. Is your problem that you want to fill extension first ?
If yes, i suggest your change your find targets code, a simple change is
const target = targets[targets.length - 1]; // take the last target, it must not be spawn
and then
if (creep.transfer(target, RESOURCE_ENERGY) === ERR_NOT_IN_RANGE) {
creep.moveTo(target);
}
I don't suggest you transfer energy from spawn to controller, because your spawn maybe has not enough energy to respawn died creeps.
For beginners , The tutorial role.upgrader code is the best code to upgrade controller, if it doesn't meet your needs, it's time to rebuild your code .