asiansa.blogg.se

Screeps error codes
Screeps error codes













screeps error codes

Recycle has an error for you not owning the target creep, but renew doesn't seem to. could one use renew to renew another player's creeps? It doesn't seem like there's a specific requirement of the creep belonging to you, it only has an error for returning when you don't own the spawn, not the creep. But could you not take a big creep with 500TTL and bring it up to 1000TTL? As I read the function, it seems that you have to have enough energy to renew all the way to 1500Ticks To Live. Specifically, having large creeps from 1 room that are working in another, they may be renewed by a spawn with a smaller total energy pool than the spawn that created them.

screeps error codes

There are still some legit reasons to do renewal It also handles the fact that the job doesn't necessarily know exactly what body is going to be spawned, so it doesn't know how long it will take. You'll also want to make sure you don't count the time a new creep is waiting on the old one to die.)Īlthough I have code for calculating how long a creep will take to spawn and now long a particular creep will take to travel to a particular location, this is just much simpler works quite well, and also takes into account any other delays. (You'll want to have a cap on the maximum pre-spawn so that if the spawns are overloaded you don't keep asking for creeps earlier and earlier, exacerbating the overload. As long as the spawns aren't completely overloaded this works quite well for getting a new harvester within a few ticks of when its needed. I have the harvester job keep an average of the last N wait times and it requests a new creep when the current one has less than that time to live. So the harvester job can see how many ticks it takes from the time it requests a creep to when a new harvester arrives at its source.

screeps error codes

Spawn requests include the tick they're created and that info is passed back to the job along with the creep when it's ready. I haven't implemented a general system for pre-spawning or renewing, but my harvesting job does implement pre-spawning in a way that seems to work quite well. So the spawning logic picks a room to spawn in and chooses a body that that room can handle, including picking whether to wait for more energy to spawn the largest body it can, or picking what can be spawned immediately when certain conditions are met. Requests can include a location where the creep is needed and a number of suitable bodies. Then the spawn queue does nothing but process whatever requests it has, and jobs are entirely responsible for figuring out what creeps they need. The system I have is that there's a representation of a "spawn request" created by jobs that need those creeps.















Screeps error codes