This is pretty similar to the default behavior for stocking labs for reactions, but a little simpler.īoosting also requires energy, but we’ll handle that a little differently - we already have a role for filling structures with energy, so we’ll just tack the labs on to our RefillExtensions workload. When a boosting lab needs more boosts, the Scientist will fetch them from the Terminal and ferry them back to the lab. When a boosting lab has the wrong resource, the Scientist will empty it and ferry the resources back to the Terminal. This will be the Scientist’s first priority - maintaining ingredients for reactions is not time-critical. In most cases the minion should be large enough that this gives the Scientist plenty of time to empty the lab(s) and refill them. We’ll add boosts to the Scientist’s to-do list only when the minion in question is actually spawning. If there’s a boost that doesn’t have a corresponding boosting lab, we’ll set one aside. We’ll keep a separate list of boosting labs, along with the compound they are currently using, and remove them from the input/output lists accordingly.Īs part of our runLabs process, we’ll scan the list of boosts to prep. The remaining labs (if available) can keep working on reactions.Ĭurrently we have the first two labs designated as input labs and the rest as output labs. Each lab can only hold one kind of resource at a time, so if we need multiple boosts (to boost heal and attack, e.g.) we’ll need to reserve multiple labs. We need to clear out some labs for boosting. Eventually, we’ll need to do the math on which is the cheapest way to fill an order, and buy the compounds if we can get them more cheaply than making them from minerals. This gives us enough to get the labs up and running.įor now, we’re just buying the base minerals, not compounds. Surplus minerals get balanced to our offices, preferentially, and then the surplus is sold when we have no mines to supply the minerals, they are purchased from the market instead. This has no real safeguards for market swings or temporary spikes, but it works.
#Screeps minerals upgrade
We’ll start with our Paralegals, boosting them to improve upgrade speed. This is mostly the work from our previous post: the target boost quotas are hard-coded, so we’ll set each office to creating 10k units of ghodium acid (for controller upgrades).įinally, we need to use the boosts.
#Screeps minerals update
We’ll update our market code to sell surplus minerals and use the credits to buy more of whatever we need. This was tabled for Botarena, but it’s time to pick this back up and finish the work we started.įirst, we need to be able to source minerals when we don’t have a corresponding mine. In a previous article we began tackling labs, getting to the point that we could harvest minerals and run reactions to create compounds and eventually boosts. 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.