

We should push the ramparts out three squares from our existing structures. If our room is under attack, the refillers need to get from the spawn (outside the perimeter) to the extensions (inside the perimeter), and they are vulnerable to hostiles.Īlso, the perimeter is too close to our structures: creeps with Ranged Attack can target structures behind the ramparts. Everything inside the perimeter is protected, but we rely on refiller minions to manage the energy levels in our extensions. That’s a start, but there are some issues with this layout. Here’s an example of drawing a perimeter around our extensions field and headquarters:

I elected to take a shortcut and use the min-cut implementation by Saruss, Chobobobo, and Shibdib in screepers-snippets.

It may also include a layer of protective walls around the controller: an attacker needs to be adjacent, but your own minions can upgrade from afar, so it’s a simple protection against controller attacks. This could look like ramparts covering a bunker, a min-cut generated perimeter, or both. The purpose of walls and ramparts is to protect your core facilities until your active defenses can destroy invaders. The official Screeps docs have an introduction to defense which highlights two different modalities: passive (walls and ramparts) and active (towers and creeps). DefenseĬlausewitz’s first principle is “make your own base secure.” As a reminder, here’s what our base plan looks like. You may implement them - or implement countermeasures - as you please.

However, I will discuss many of the tactics, strategies, and other considerations here openly. To that end, I’ll be separating most of my combat code into a new closed-source package, leaving the rest of the codebase open-source. There is a taboo against providing combat code, and depending who you ask, even against discussing combat in too much detail. If you ask nicely (by submitting a PR) you can be added to the Grey Company whitelist. If you want the risk posed by other players, that’s what MMO or other public servers are for. If you want to avoid combat so you can focus on your economy, that’s fine that’s what private servers are for. Let’s talk about my philosophy of Screeps combat for just a moment. Here’s the GitHub repo if you’d like to follow along. The article below describes the AI in its current state: I’m still expanding and refining my codebase.
