Chronicle of the Battle for E2S7


Years from now, veteran Screeps players in their retirement homes will still be telling the story about the Battle for E2S7. One of the most intense showdowns the Screeps world has seen to date, it involved a series of attacks that took place over several weeks. Some of these would last for days at a time. Many a bedtime would be neglected. Many a pool of yellow blood would be spilled onto the cold grey ground. Both players would be pushed to their limits.

The concentration of epicness was so high that the room could collapse into a black hole or the entire world could be broken up into shards.

We each bring a unique interpretation to some of the more ambiguous aspects to this story, which is no surprise. We’ve tried to preserve that difference because we think it will make a more interesting read.

bonzai’s story o4kapuk’s story
Even this prelude has a prelude. If the history could scroll as far as a month earlier, you would see another fierce battle raging, this one with Hernandeur as the defender. On the opposing side are myself and taiga, a fellow ThunderKitten. We were able to establish a zone of control in the room for a period but Hernandeur took a safe mode and was able to beef up the defense. Unfortunately, he quit before the true owner of the room was ever decided.

“Authorization” might be a stronger word than I would use. My reckoning was that SteeleR effectively said there was nothing he could do about it, as the portal was closed. It wasn’t big enough to make a huge fuss about (ThunderKittens are known for our practical approach to these matters, at least we like to think so).

The attack on SteeleR’s room played only a small role in the decision to attack E2S7. The bigger reason is that we had formulated a crazy plan to take that sector from these well established players, and taking a room means nothing if you are not able to hold on to the territory. We have a simple rule of thumb for deciding whether we should first try to solve a territory dispute in a diplomatic way or in a more forceful way. We assume players who have attacked us in the past prefer a less wordy approach, which we are happy to oblige.

I could see by o4kapuk’s design that he knew what he was doing. At the moment, the walls were at ~1 million hits. A vision flashed before my eyes of trying to take this room with higher walls, and I didn’t like what I saw. Unfortunately, this would prove to be prophetic. But I am getting ahead of myself. For now it was clear: E2S7 must be reconquered!

I think that story begun July the 10th when I removed TK member SteeleR from E74N27 (we at CoPS thought he’s too close to our borders). We had his authorization (at least we thought so) to clear that room, so I didn’t expect this action to trigger the war; but the next day (or so) I found bonzai’s troops demolishing E2S7, my experimental bunker room I established in the middle of June.

Having a room close to the Big Cross was always my wet dream, so when Hernandeur despawned I moved out immediately after a suitable portal appeared. My reasons to capture and hold that room were more emotional than rational, and that factor significantly affected my behavior. If that had happened anywhere else, I probably won’t have fought for my room that hard. But I see having a room in the world core as matter of  prestige, so when it comes to taking that away from me, it’s not surprising to face a fierce resistance.

The history of room’s design deserves a separate article, but here is enough to say that I took bonzai’s design and did some work to make it match my approaches better.

After having some experience in solving different issues about that design I decided to discuss some things with the author of original layout, and we had a nice talk about it. Probably attracting his attention to that room was another reason why this story happened how it happened.

First attack

bonzai’s story o4kapuk’s story

At first, the attack seemed to be going well. The main challenge to an attack on a room design like o4kapuk’s is the vicinity of the towers to all possible attack points. Eventually, you get close enough so that you are taking maximum damage from all 6 towers (3600 damage per tick).

The math involved in writing attack code that can withstand this situation deserves its own article. Here is the quick version. A creep with 12 boosted TOUGH can take 4000 damage before it really starts to hurt. Unless you have dozens of healers nearby, you need those TOUGH parts to hold. A direct hit by all towers will take out 11 TOUGH parts. On the next tick, you have far less protection. The recent change that adjusts healing mechanics has helped a great deal, but this can still be tricky. Miss a single tick due to a bug or a timeout (which are occasionally out of your control) and it is “sayonara”.

I chose to use a tunneling approach on this first attack, and that was a mistake. I believe I made it it as far as 3 positions into the interior of his base. Due to the lack of healing in the vicinity as he advanced further in, it met with a towery death. This bought o4kapuk enough time to start spawning some boosted creeps. You can probably imagine how much more complicated it gets when creep defense damage is added in.

Let’s just say the rest of the attack wasn’t pretty, at least from my side. Here I am, supposedly a capable raider, and I am foiled by walls at ~1 million hits. o4kapuk, who has only been playing since December, makes a convincing underdog in this story.

I believe I recall one player expressing a sense of schadenfreude from seeing my attack fail. Considering all the havoc I’ve caused, I think I deserved it.

I had no defense code activated those days; the only thing I had was primitive, stupid, and buggy, so I just decided to disable it for MMO world until it’s ready and tested on a private server. Worse, the room wasn’t fortified enough; as far as I recall my ramparts was around 1M hits which is nothing when you face properly coded t3-boosted attackers.

Thus it’s not surprising that I found my room partially breached (as far as I remember, bonzai managed to break through two or three layers and destroy some labs).

Fortunately, I still had enough labs to properly boost creeps; unfortunately, my defense code still was a shit. So I spawned some defenders manually using parts of my raid code and reflected the attack.

I was surprised that the room held out long enough while being not defended; I rebuilt what was destroyed and returned to debugging my defense.

We talked a little in private and in TK public slack. I was a little frustrated by military activity without any declarations (I used to have more definiteness in military conflicts) but later when bonzai’s intentions became clear I took this feud as an opportunity to finish my defense code and see bonzai’s advanced raid code in action.

We decided to limit the conflict by the E2S7 only, and I was happy with this decision because I didn’t want to put other members of CoPS under threat.

Second attack

bonzai’s story o4kapuk’s story

There is something to be said for getting it right the first time, but when that isn’t possible there is sheer stubbornness to fall back on. Although the first attack failed, it was close enough to think that it might be successful given a few adjustments and some help from my nukers.

o4kapuk and I had shared some brief communications that were generally positive. It is hard to overstate how nice this is for a game like Screeps. In other online games, most matches are over in a relatively short time. Players can trash talk all they want and forget about it. Not so in Screeps. Because of the tick times and the game mechanics, feuds can last for days or months. Like it or not, you are stuck with each other.

There’s no reason why it should necessarily be a negative interaction. In a sense, you are collaborating, each writing the testing suite for the other person’s code. I see a sort of elegance in this. One thing is for certain, both of us have improved our code as a result. So I think this perspective holds true.

Unfortunately for me, this second attack showed that my code still did not pass the test. o4kapuk successfully repaired the ramparts so that they were virtually undamaged. The ramparts were also higher, ~3m if I recall correctly.

The only thing I had going for me was the inter-nuke period. I spaced each nuke to be 248 ticks apart, which would theoretically buy me some time in between nukes to go whack a few walls.

Unfortunately, the logistics of this strategy are not always straightforward. First, you need to make sure you have creeps present when the nukes are falling. I was spawning creeps from 5 different rooms, some of them far enough away that creeps were arriving with only 500 ticks to spare.

Second, you need to have a robust evacuation plan. I have code that will start clearing the room of creeps at 80 ticks before touchdown. That might seem like an overly conservative margin, but it is often necessary. Indirect paths to the exit, swamps, and traffic control are all factors that can work against you.

I don’t recall exactly in which way my second attack failed, maybe it failed a little bit in every way. I believe some creeps did not evacuate properly and were caught in the nukes. I believe the tower code was also smarter and managed to take down a few squads.

I also believe this was the first time I saw his Ballistas, high powered ranger creeps that sit at the edge of the bunker and throw death at my creeps. Given the already insane amount of tower damage from being so close to the cluster, it was going to take something much smarter to outlive these attacks.

This was the same style of attack that had caused other defenses to crumble, but it just wasn’t going to work against o4kapuk’s bunker of pain. I was going to have to improve it!

The day after the first attack bonzai informed me that he was going to use “at least one nuke” as a part of his next attack. I had a basic code for proper fortifying nuke landing area so I didn’t worry much about this.

I started fortifying the critical structures: spawns, storage and terminal.

Soon after that I saw 3 nukes flying to my labs. A simple calculations gave me that I can’t fortify them fast enough with my usual 15/15/15 worker even with boosted WORK parts. I replaced him with full-boosted 30xWORK creep but still that wasn’t enough. To solve this, I added two more full-boosted workers and found out soon that the bunker is too narrow for them to work properly. This forced me to disable remote mining in that room to decrease traffic inside; that worked and I got landing area fortified enough to survive nukes and remain at the same level with the other ramparts which has been slightly increased to ~1.5-2M (not sure about how high they were).

I also wrote an evacuation code to keep my creeps alive so they won’t take up valuable spawn time when bonzai’s troops arrive.

Room evacuation(click to expand)

I wasn’t entirely sure about my debugged defense code, primarily because it was still primitive. I decided to babysit the defense. This is not the right way to play screeps if you ask me, but I really wanted to keep my room. So I spawned a squad and moved them to E1S7 to protect the evacuation point.

That worked well: my creeps returned to their positions and they were ready to meet the raiders.

Reflecting the second attack (click to expand)

bonzai’s offensive code was good, but not perfect at the beginning. One melee defender with a minor assistance of evacuation guard could easily kill the invaders.

There I implemented a simple code for focusing specific creep with towers – a quick and dirty solution which required manual target specifying. But hey, that worked and gave me an opportunity to make it nice in future. Crawl-walk-run was always a good strategy.

But that was just in the beginning. I suppose my opponent were also babysitting his raid and I saw several improvements in each wave. They learned how to avoid the defender and started to shoot ramparts from the safe distance.

I reacted by replacing melee defender with several rangers who did their job very well after I made them focus the same target as the towers. This way, there is no ‘safe distance’ for shooting anymore, and bonzai said that he need to think how to handle that kind of defense.

Thus ended the second attack.

Third Attack

bonzai’s story o4kapuk’s story

Over the next couple weeks I would often catch myself thinking about how to crack E2S7 and bunker rooms in general. Good ideas were not forthcoming.

I needed something that could withstand the huge amount of damage coming from the towers and the creep defense. I had another squad type that was very effective against walls at the edge of the room. It could tank large amounts of damage by fleeing onto the exit tiles when a creep had a significant risk of being killed.

Doing this in the middle of the room was going to be a lot harder. Although creeps could not flee outside of the room, they might still be able to flee backwards and get far enough out of range that they could survive.

There would also have to be smart healing, and tons of it. The new mechanics allow you to “overheal”, which has a better chance of bringing a creep back from the brink. It also has more predictable “pre-heal”. With some effective prediction, you can reduce the chance of getting hurt in the first place. I’d need to leverage both of these to the fullest.

Finally, I’d need to decide which attack parts to give my creeps. WORK parts would allow me to do the most amount of damage to the outer layer (50 per part). However, in the event that I get into a stalemate and creeps could not get near enough to the walls, these creeps would be useless. They’d also be useless if I gained the opportunity to fire on a hostile creep.

RANGED_ATTACK seemed like a nice compromise and particularly suited for a bunker attack that involves several layers of ramparts. At the edge of the wall they can do 30 damage to the first layer with rangedMassAttack (provided they are in range of at least 3 ramparts). They also provide an additional ~30 damage to the interior of the bunker.

A solid idea started to form, and I wrote the implementation. I called this unit The Sapper. After a brief test on an ally’s room, I sent them off to be tested where it actually matters.

The attack went very well and ended in a safemode, a minor victory considering how effective o4kapuk’s defense ideas were. The fleeing and healing mechanics worked the way I was hoping they would.

Although I lost a few creeps and sent a few more on suicide missions, the majority died of old age.

There was plenty of room for improvement, but I considered this first iteration a success.

I had several nukes in the air, which would land in a couple days. After the safemode ran out, I resumed my sapper attacks for the sake of adding pressure and offsetting the nuke repairs. It could run fairly well unattended. He had also improved his code during the safemode and was able to push my sappers into a stalemate. The main thing they were doing during this time was forcing him to spawn ranged attackers and use boosts.

I knew that the real test was still ahead. I prepared for our last stand.

Two weeks later bonzai came back with the strongest siege I ever experienced.

Battle Dance (click to expand)

His battle code had been greatly improved in many ways: he implemented a ‘battle dance’ to keep his troops alive and doing something useful, I also saw some advanced healing algorithms which leveraged the overhealing effect, and some other significant improvements. They still couldn’t overdamage one full-boosted worker, so I wasn’t in trouble…

(click to expand)

…until I saw the nukes.

I despaired when I realized that bonzai could maintain siege for 50k ticks. That could be quite challenging to fortify that much durability even without being permanently stomped by advanced military units, but under siege, I saw absolutely no way to do that, at least not with the code I had.

That was extremely stressful so I decided to unclaim the room to avoid pressure. It could have ended like this… but when I clicked the room controller, this is what I saw:

I activated safe mode to have 20k ticks to do something to survive. Only 20k ticks to invent a way to reflect the attack that was being prepared within two weeks.

First, I spawned as many heavy workers as I could. It appears that no more than 4 workers can do fortification without blocking each other too often. That would not be enough to fortify against 8 nukes so I improved my fortifying code to protect important structures only.

While they were fortifying I was working hard on my new defense system which supposed to analyze the entire battle field in many ways to get a better chance to take out hostile creeps.

Traffic manager in action (click to expand)

When safe mode ends I still had not enough hits on my ramparts; of course, bonzai’s troops returned as soon as possible and I still had no solution to efficiently fortify and defend the room at the same time. Then I got my shit together and implemented one of the best things I ever imagined: advanced traffic manager.

Having this code I managed to run as many creeps as I can spawn. So all of the 30k ticks between my safe mode ended and nukes landing I was fortifying like crazy while the room was under extremely heavy pressure. And then the most interesting things happened.

Last Stand

bonzai’s story o4kapuk’s story

Some battles are won before they even begin.

I woke up on the Sunday morning for which I scheduled my nukes and surveyed the situation. Much to my dismay, o4kapuk’s repair was very effective and the nukes themselves would do virtually no damage to the structure. Once again, the only thing I could rely on were the brief intervals between nukes in which I could whack away at the walls mostly uninterrupted. The typical wall height was 6m, and I would need to carve away at least a dozen before the integrity of the bunker was significantly compromised. With only a handful of nuke intervals to work with, there just wasn’t enough time.

Still, giving up now would be a terrible way to end the story. I’d rather my attack end in an impotent blaze of glory than fizzle out in a prudent surrender. o4kapuk had also done a hell of a job adapting his defense up to this point. He deserved a better ending. I went about setting up the parameters for the grand finale.

I decided not to hold anything back. I would crank-up the five rooms that were spawning my squads to full steam. That sounds like a lot of rooms, but a few of them were so far away that creeps would arrive with only 500 ticks to spare. I would have been able to put more creeps in the room with two closeby rooms, but you go to war with the army you have.

This would mean a GREAT DEAL of boosts would be required. Given the fact that I had been sending in a steady stream of creeps for the last two days, my stocks were starting to get low. Many people were wondering where all these boosts were coming from, some even speculating that I had a botnet army sending me resources. Unfortunately, reality is much more boring. My ally, SteeleR, had decided to respawn and was sending me all his leftover boosts.

With dozens of my impatient attack squads waiting outside his room, the first nuke landed. Ignoring the dangerous radiation, my squads rushed into the room.

My plan of attack was inspired by finndibaen’s attack on my own room design. The idea was to try to take out some key ramparts (shown in cyan) in the short time that I had. Those ramparts are crucial for protecting the entire corner section, since some of the other ramparts where attackers could stand rely on them for a safe path. Of course, a defense involving ranged attackers will be less susceptible. Still, it was the best plan I had, an upgrade from my usual plan of “kill all the things”.

During the barrage of the first four nukes, things went about as well as could be expected. I was able to get many creeps into the room, and also have them retreat at the right times. Some creeps stayed behind because they didn’t have enough TTL to make fleeing worthwhile.

During this time I was trying to improve my nuke-fleeing code. I accidentally recorded a gif that shows one of my frantic edits.

Despite a few creep losses here and there, it went pretty much according to plan. If I wasn’t able to take the room, at least I could be sure that I gave it my best. Finally, the last nuke landed and it was time to go full tilt. I made some quick edits to my code so that the fleeing was less conservative. If I can’t maintain a position near the walls, it was all over anyway.

There was even a glimmer of hope. I was able to weaken the wall at the critical junctures on the right side. There was one funny moment (shown in o4kapuk’s story) where about 15 ranged attackers are trying to outdamage a single boosted repair creep. They were just barely successful. I managed to wedge some squads into the critical points.

For a few hundred glorious ticks, it all went according to plan. o4kapuk had a specific lab he was using to boost ranged attackers, and they were unable to get to it without venturing into an unsafe position and being sniped by a dozen furious bonzAI creeps.

There was an obvious solution. Fill up a different lab with boosts for his ranged attackers. Would o4kapuk accommodate in time? The outer shell of his wall was failing fast, with a few ramparts only ticks away from obliteration.

And here it is folks, the critical moment. An attack that lasted several days, it all came down to this. Watch it with me and weep (or rejoice, depending on your persuasion).

Over near the terminal, you can see o4kapuk’s ranged attacker boost himself and join his already-boosted brethren at the wall. All three of them together, combined with the towers, can deliver over 9000 damage (more if they used rangedMassAttack). That’s gonna leave a mark, no matter how much healing you have available.

And like that, my creeps are sent to Valhalla, one by one. With the heavy amount of damage, even their very brazen flee parameters are not enough to keep them on the front line. Confused, they stumble around the battlefield looking for their lost parts and wondering what kind of cruel commander would lead them to such a fate. Death brings mercy and garbage collection to their memories.

I had a controller attacker about to enter the room. This creep would have been necessary to continue the fight, had it not already been decided. I kept it going just to prove that I could have attacked the controller, had the other part been successful. In these moments, you take whatever consolation you can find. However, I quickly went in my editor to change the code so that it delivered a congratulatory message rather than attack the controller.

There is a saying where I’m from. If you can’t beat ‘em, join ‘em.

The first thing worth mentioning is that bonzai blocked all the ways to evacuate population, so I disabled it for E2S7.

bonzai’s troops dismantling the ramparts between nukes
(click to expand)

The second thing is a good timing between bonzai’s nukes and an excellent synchronization between nukes and troops: ~400 ticks between bombs is not enough to recover proper room filling creeps and spawn defenders/repairers, but definitely enough for attackers to jump inside and do notable damage to ramparts.

The Second Fallout
(click to expand)

Fortunately for me, taiga’s nukes wasn’t coordinated either with bonzai’s nukes nor with each other so that was not that stressful to survive them. Nobody came in to damage my ramparts or to frustrate me.

Although extensions filling infrastructure was slightly damaged by taiga’s nukes, it was operational; I lost 8 extensions, all of my ‘caching’ containers and most of roads. I was very glad to see that despite of being damaged filling system still provides adequate filling rate; it was slower than before, of course, and my fillers literally hadn’t a single tick to smoke, but it was working good enough to handle expensive creeps spawning one by one.

Only between the nukes, when I saw which ramparts he was targeting I understood his plan: together with destroyed rampart in the epicenter these two which he was going to demolish was meant to block safe access to my lab with XKHO2 boost, a core component of my defense. Unboosted defenders could handle some attacks, but not this one. Not a bonzai’s crowd.

The plan was performed perfectly. My ranged attack boost lab was cut off completely, ramparts were melting with a frightening speed, resistance was useless, and the big picture seemed to be irremediable…

…until I remapped my labs which triggered loading of XKHO2 to a previously unused lab in a safe area.

The rest was predictable. Being properly boosted, my defenders with coordinated support of towers easily secured the whole perimeter (exactly how that was happening before), and then my workers were spawned to rebuild destroyed ramparts.

The Battle was over.


bonzai’s story o4kapuk’s story

This whole attack was one of the most rewarding experiences I’ve had in Screeps to date. There’s no shame in being beaten by the best, and I believe I was. Although I was not successful in taking the room, I believe I gained something far more valuable. I walked away with much better attack code and a new friend.

The developers have stated their intention for it to be possible to have a defense that would virtually rule out a successful attack. In my opinion, o4kapuk is the closest I’ve seen. I haven’t given up the idea of writing an attack that could take down this room. I’ll continue thinking about what I can do to improve it. But I think o4kapuk has earned the right to be accepted as a permanent owner of a E2S7.

If anyone is foolish enough to challenge that earnestly, it won’t be me.

First of all, I should thank bonzai; actually, I should thank him many times, and when I say “many”, I mean “many”:

  1. For creating his bunker-style layout which served as an excellent basis for my work
  2. For performing a proper defense test against that kind of rooms; that experience is invaluable. If you never experienced bonzai’s raid, you never played Screeps ‘the hard mode’
  3. For forcing me to code my defense system; I couldn’t feel like I’m truly mature and developed high-level player without validated defense system
  4. For being polite and positive while talking to me; that showed me what military conflicts really should be to deliver positive experience to the both sides
  5. For accepting me as a neighbor after I passed his defense test; as said before, having a room in the world core is important for me.

As for results, I think there could be many contradictory points of view about who won the Battle for E2S7 and who lost it. One could think that I won the Battle and bonzai lost it because I achieved what I wanted (to keep my room) and he hasn’t succeeded in his intention to remove me. Another one could tell that we both lost because we wasted an unimaginable amount of resources just to return to our previous state, to achieve nothing.

I think differently. I think we both won the Battle. We didn’t waste those resources, we converted them into good code and lots of ideas about our further code development. Bonzai made many improvements to his raid code and many ideas for his defense system, I achieved an adequate level of my defense, implemented an excellent traffic management (which was always wanted but always postponed), improved my extensions filling system, and got many ideas for my raid code, spawn system, boost system, mineral processing, and general economics.

In addition to all of this, we established a positive relations based on mutual respect; moreover, I gained some worldwide reputation as the first ever player (aside from SWC) who resisted the famous “Jack The Reaper” of the Screeps world, the bonzai himself.

As my final word I wish you all that your every game conflict went like the Battle for E2S7.

Peace! Or war. Your choice 🙂

Share this post

Share on facebook
Share on google
Share on twitter
Share on linkedin
Share on pinterest
Share on print
Share on email