Keeper Lairs and Invader Swarms Strategy
I'm interested in soliciting high level strategies for cracking keeper lair rooms.
I recently used my 3-day weekend to prepare what seems to be reliable code for cracking and harvesting from keeper lair rooms. My strategy adds 10 creeps per room to my population, and a 2-3 cpu tick average. I'm netting more energy than I spend; plus minerals. So I'm happy.
However, I'm sure there is room for improvement; so I'm curious to hear what other people's strategies are. I'm holding 2 rooms in perpetuity. If I could somehow get the efficiency up, I could probably hold 2 more. (GCL 4: Own 4 rooms, reserve 8 more, plus 2 keeper lairs. Avg 45/60 cpu, 130 population)
Also, I hope this helps someone. It took some trial and error to figure out how to crack these rooms.
2 x Miners : 8 work, 8 move (1000 Energy)
Upon entering room, locate source with lair with largest ticksToSpawn count. Link to lair. Move to node. Harvest and drop. On node empty or lair ticksToSpawn less than 20, move on to next source.
Strengths: Works well as the miners perpetually avoid the keepers and never get attacked.
Weaknesses: RunAway check only backs away 5 spaces in opposite direction of hostile. Occasionally, an invader backs a miner into corner.
2 x RangedGuards : 5 Tough, 10 Ranged, 5 Heal, 20 Move (3800 Energy)
Locate nearest hostile. Approach staying 4 spaces away (backs up in opposite direction if pursued), attacks till dead. Heals self if below max
If no hostiles, then move to lair with lowest ticksToSpawn and wait 5 spaces away.
- Strengths: Heals at a rate nearly equal to damage received if creep can avoid melee attack.
- Weakness: Backup behavior is dumb and creep can get stuck on wall or in swamp. If they engage the invaders without a MeleeGuard, they get stuck in deadlock due to healers.
1 x MeleeGuard : 5 Tough, 10 Attack, 5 Heal, 20 Move (3100 Energy)
Locate nearest hostile with no Attack parts, then engage in melee attacks. This guy exists for the periodic invader swarms and favors healers over ranged units.
He waits near the middle of the room till an invader swarm comes and does not assist with keeper control.
- Strengths: If there are only two healer creeps, he'll overpower them. Even with two ranged invaders, he heals faster than damage received.
- Weaknesses: He can't overpower three healers. They heal faster than he can damage. If the RangedGuards step in and help, it's fine. Otherwise, they get stuck in a deadlock till someone runs their ticksToLive.
- Opportunities: This guy is expensive and spends most of his time standing around. I wish I could find a way to predict incoming invaders and spawn on demand.
4 x Hauler : 10 Carry, 10 Move (1000 Energy)
Locate nearest dropped resource that is in a non hostile zone (determined as having no hostiles in 5 square radius). Pick it up till full or gone. Return to homeRoom storage.
Has basic "run away" logic if hostile enters in 5 square radius. Waits near middle of room if there are no 'safe' resources to pick up.
- Strengths: Rarely ever gets attacked, fairly cheap to spawn
- Weakness: I'm leaving a TON of unclaimed energy on the ground.
- Opportunities: I'm boosting with ZO & KH when available in home room; but availability is sporadic. (O & H is coming from my lairs)
1 x Extractor : 3 Carry, 8 Work, 11 Move (1300 Energy)
Locate mineral/extractor and move towards. If keeper near by, wait 5 squares away. Mines till full, or lair.ticksToSpawn < 10, or creep.ticksToLive < 100. Then goes home to dump in terminal (failover to storage).
- Strengths: Rarely gets attacked. Averages 3 full trips (450 mineral) per life span. No mineral waste and cheaper than buying on market.
- Weakness: Most of lifespan is wasted in transit between rooms.
Update : Invader Squads are Brutal
My above scenario does not hold up as well to invader squads as I'd hoped, particularly when I get three ranged and two healers. So a quick mod:
If no invaders: 2 miners, 1 extractor, 4 haulers, 0 meleeGuard, 2 rangedGuards
If invaders: 0 miners, 0 extractors, 0 haulers, 2 meleeGuard, 3 rangedGuards
Related: Invader squads appear more intense lately. I'm working on some more intelligent evacuation orders for reserved rooms to reduce loses.
Atavus last edited by
It is certainly impressive that you tackled SK mining so early in your fledgling screeps career.
My SK strategy is focused more on reliability then efficiency. I have a good energy/mineral surplus from my SK mining but they do put a strain on the spawning capacity of the origin room.
Each SK room I have generally has 2 guards.
A guard has the following body:
let body = _.times(30, () => RANGED_ATTACK);
body = body.concat(_.times(17, () => MOVE));
body = body.concat(_.times(3, () => HEAL));
Guards will kill any living hostile creeps first. They will maintain close formation when doing so. They will heal themselves or each other whilst fighting. They will maintain distance 3 from melee creeps and will move up close against non melee hostile creeps. When close to a damaged harvesters they will prioritize healing him.
If there is nothing to kill guards will park themselves around the source/mineral closest to the lair with the lowest spawn time.
SK harvesters/haulers behave the same as everywhere else except with adjusted bodies to tackle the extra energy.
Harvesters and haulers will keep distance 5 from any hostile creep or lair about to spawn (<4 ticksToSpawn).
The 2 guards are sufficient to handle >99% of the invasions. They do fail sometimes if the invasion ends up in a very strange terrain. Eg bottleneck + swamp + boosted range and heal invaders. The failures are usually when the two guards cannot get in range of the enemy at the same time.
I hope this perspective is useful.
I think part of my strategy is a result of my host rooms being only RCL7. Your guard body costs 6100 energy each; which I cannot yet afford. I look forward to RCL8. For now I do prefer the lower guard cost (3800) and consider the occasional invader failures cheaper than maintaining a heavier force.
I do find it curious that you stack your parts together. I tend to cascade mine (and use a custom short-hand). Example:
I think the advantage of this is that when taking damage, I don't sacrifice my most valuable parts first or the ability to move.
Now that I've been running my script for several days, I've had an opportunity to refine some of the behaviors.
- Ditched the meleeGuard all together. He really wasn't effectual against the invaders.
- 2 rangedGuards continue to manage the keepers, but when invaders spawn, they jump to the neighboring room to assist. The 4 of them are better able to tackle the invaders. They return when done.
- If there are more than one invader in range, the rangedGuards use rangedMassAttack. This turns out to be the key for the healers as they can only heal one unit at a time. The healer gets preoccupied healing itself, while you dwindle down the others.
- If a guard is engaged with a keeper, and invaders spawn, it abandons the keeper.
- When invaders spawn (in any room) units without attack parts evacuate the room. They return after the all-clear.
- Some global pathing and caching improvements have shortened travel distances some.
Also, someone on Slack pointed out that damaged parts still generate fatigue. So ignore my comment above about alternating the parts.
XyzzyPrime last edited by
On the point of alternating or grouping, there are points to either.
One thing to consider ... if you have a creep that is down to just one part (the last one before death) then what should it be? IMHO, Heal. That way it has a potential that if it was saved just at the brink of being killed, then it will heal itself back to full.
Next, what is the next to last part? IMHO, RANGED_ATTACK. If it is down to the end, it will want to go out swinging. Ranged is the only one that is guaranteed to be able to attack at any range.
So overall, start with the end and work backward to full body parts to determine best. Create the logic and then you have the order no matter the size or parts.
I have seen some Players that group parts like Tough, Ranged, Move, Heal or TRH*M* ... some have the last Heal at the end like I mention above. Some players use the mixed groups and repeat. Like your example.
Overall, your description is excellent and the other posts added great options as well.
Thanks for the post.