
InfrastructureĪt an early level, this might be a simple minion that collects energy, moves to the controller, and deposits it. So the bottleneck will be infrastructure: moving energy from the sources to the controller.
SCREEPS ROADS UPGRADE
The room controller has no upgrade cap until RCL 8, which is far enough away that we can ignore that for now.

This is not too difficult, and can be met with a single minion with 5 WORK parts, starting at RCL 2. As noted above, 10 Energy/tick will exactly match the Source’s maximum output rate. The first step here is maximizing our inputs. Our main objective is upgrading the room controller, so we want to maximize our output (energy to the room controller). This includes Roads (to increase throughput), Extensions (to increase minion effectiveness), and Containers (to enable specialization). Once our Sources are fully tapped, we can optimize the transfer of energy from the Sources to the Controller by Building Infrastructure. If we are pulling 10 Energy/tick out of each Source, we’ve maximized our resource usage. There are a fixed number of Sources in a room, and they resupply at a fixed interval. In order to maximize that surplus, we need to Maximize our Inputs. This unlocks additional Structures (especially Containers and Extensions) that will be useful for improving energy throughput, and it’s also representative of the surplus energy our production process is generating. So, at the initial stage, the main objective is Upgrading the Room Controller. I decided to focus on economic growth before defense.

In the rest of the article, I’ll assume you’re familiar with the terminology from either the tutorial or the game documentation. This gave me enough experience to draw some patterns.

I began by playing through the tutorial and improving the sample code, until I reached RCL (room control level) 4. Your available CPU is limited, so you have to write an AI that is both powerful and efficient.
SCREEPS ROADS CODE
Screeps is an MMORTS (massively multiplayer online real-time strategy game) with a unique twist: instead of controlling your units directly, you write code in Javascript to build and manage them.
