

Every find (aside from range based finds) are now done by the room object with most being cached. The core of this new AI is the new room object. There is now a formula to decide how many creeps are needed.| How it all Works

|Hard coded number of creeps|Creeps are spawned to meet numbers not needs.|The creep director spawns a new creep to satisfy the number of jobs. This could mean the upgraders not getting their delivery just to re-supply spawn slightly faster.|Once the Creep Director has given a creep a job they stick with it until its finished.| |Creeps change target mid-journey|A creep could be right there ready to finish a job only for something they consider more important to pop up. Instead, I only spawn enough builders for the sites. |Same as above for builders|Same problem, no need to walk all that way only to turn back after doing nothing.|This doesn’t have the same catch. Even if it won’t take all the energy the hauler has it still sends it.| They will both do a u-turn once the extension is full and head back to some container somewhere else.|When the Creep Director assigns a delivery it checks that the the hauler’s energy will be needed to finish filling it. |2+ haulers see an empty extension on the far side of the map and both go to fill it.|1 Hauler contains more than enough energy to refill an extension. So to re-iterate the end of part 6 let us list the problems with my current AI and give the solution. These objects would store a fair bit of data in memory removing the need to find everything every tick. The basic principle of my re-write is to introduce my own objects to contain rooms, creeps, structures and sources. This post has smashed that but its worth it. I normally aim for 1000 words and cut off when I reach it. 2016 Screeps Screeps Part 7 – A complete Re Writeįor Screeps Part 7 I have something a little different planned, a complete re-write of my code from the ground up.
