![screeps basic scripts screeps basic scripts](https://blog.screeps.com/2019/08/ide/screeps-ide.gif)
You could spend days thinking about it, designing bases, figuring out how well they work and looking for issues. At least, I don’t want to finalize automated base design & construction right now.
![screeps basic scripts screeps basic scripts](https://www.ls2015.com/wp-content/uploads/2016/05/Pronar-T0263.jpg)
I don’t want to plan out the entire base. For now, I’m going to ignore the possibility of “competing” structures, such as containers left over by previous inhabitants (or even your old code). What’s his body look like? What’s his logic? We can work off a task queue, but who puts the task together? That’s the purpose of the Room module: it needs to notice that we’re at RC2, and then decide what it wants to build, where, and in what order. Likewise, the upgraders won’t necessarily have a container right next to them, so they’ll either need to go get their own energy or coordinate with carry creeps to be supplied.
#Screeps basic scripts plus
So our “dedicated miners” will need Carry parts until both the five extensions AND the source’s container are built, plus we’ll need up to three miners per Source. We won’t have the energy to spawn a 5-work harvester until late, and we won’t have a container there for at least 1000 ticks. Next, note that everything we want to do here won’t be completed until the end of the RC. Or, maybe, have someone bring him energy. Spending 5 energy per tick suggests a builder could get 40,000 or 45,000 of work done, but remember that that dude has to pick up energy, too not just spend it. That’s optimal, so we’ll probably be somewhere between 8k and 9k ticks. Six work parts upgrading means 6 energy per tick, or around 7500 ticks.
#Screeps basic scripts upgrade
So we really only need one work part doing building, which means one builder creep but we might want six work parts upgrading, such that we hit our 45k upgrade goal around the same time the builder creep is done with his work. We can build max 5 extensions, so that’s 15k, giving us a total of 35k. If we build four containers (one at the spawn, one at each source, and one at the controller), that’s 20k (assuming two Sources only 15k for a room with one Source). Extensions cost 3k each, and containers cost 5k.
![screeps basic scripts screeps basic scripts](https://user-images.githubusercontent.com/35989354/131599788-c5a5e061-6456-42ab-972d-0a5665c62bea.png)
Looking at those numbers, it seems fair to split our budget roughly 50/50. Each source provides 10 energy per tick upgrading processes one energy per tick per work part and each work part for building spends 5 energy. To get through RC2, we need to push 45,000 energy to the Controller. Upgrading consumes one energy per tick per part, so we’ll probably need a few upgraders we expect to max out at 550 energy, so upgraders will range from MWWC to MAnd once the container is there, this can drop down to MPlus I’m cheating a bit, knowing the conclusions from the next paragraph. Unlike the harvester, this guy needs a CARRY part – but he only needs one. Of course this also suggests a dedicated Upgrader creep. So we’ll need logic to get them to find energy to pick up, and then to choose a place to put it. The carry creeps don’t need any work parts just MOVE and CARRY.
![screeps basic scripts screeps basic scripts](https://owebdesigns.com/wp-content/uploads/2020/11/multiply-matrix-768x500.png)
I call this guy a Carry creep, cuz, you know, CARRY. We have a specialized harvester, and so we need a specialized hauler. That also means we’ll need a creep to do the hauling for us. You’ll be able to extract every unit of energy that source produces with a minimum of energy wasted on parts that creeps never use. So we have a possible strategy here: build a container right next to a Source, then build a creep with 5 work parts, no carry, and one move, and then move it on top of the container. If a creep harvests energy but has no carry parts, they’ll drop it if they’re standing on a container, the energy goes directly into the container. We can also create containers (in fact, we could have done that at RC1 if we had wanted to). The max number of extensions in RC2 is five - and with each holding 50 energy, that gives us up to 550 energy to spawn creeps. The major difference is extensions, which means we can start building larger creeps. So here in RC2 we have more stuff to play with, but not everything. Bases start becoming interesting (and defensible) once you’ve got towers, containers, and extensions. One of the reasons to rush to RC2 is that we’re very limited in RC1: only 300 energy for creeps, and limited structures. Just get 200 energy to your Controller and you can start upgrading. We’re also adding a Builder creep, to construct the containers and extensions we’ll need. We’ll cover dedicated creep roles, splitting our “Boot” creep into three parts: harvesting, carrying, and upgrading. RC2 doesn’t so much add a bunch of features as it adds features that suggest a dramatic increase in the complexity of code.