This module is not bundled by webpack when using the node target and Screeps doesn’t give access to it. It requires the built in node module crypto. This highlighted an issue with SODB’s dependancy object-hash. To get SODB into screeps I need to use Webpack to build a single JS file with all my dependencies in. Can restore the JSON from screeps memory saving the need to re-query the whole game.Moves the focus to find data instead of coding a loop to search myself every time I want some information.Will reduce the load on subsequent searches in the same loop saving CPU.Lodash provides some features like this but SODB can: Single Object DataBase gives an ORM-like interface to an array of objects. I’m going to make use of an NPM package that I created quite a while ago called SODB. Roads are now built to meet my orders, not just because a creep stood on an empty tile. Once a creep has a job the old creep director will resurface running much as it did before. My focus with the new AI is too abstract the job queue away from the creeps and instead build a list of jobs that creeps then get assigned to. The old creep director is pretty good and I re-used a large part of it. It was adding them faster than I could remove them and I just gave up. With roads decaying because the tower was out of energy my AI was dropping more road sites. The depression hit again killing off my rooms and my AI hit the 100 construction sites limit. My AI was trying to get to RC3 and stay there and it just couldn’t. The one time I did dip into screeps I asked my AI to take a 4th room which has not gone well. I’ve done a lot since then, moving house etc… which has stopped me playing. So it has been a while since I seriously played Screeps. It is well worth a read as I think I had some pretty good ideas for AI improvements.
![screeps game.rooms screeps game.rooms](https://www.jonwinsley.com/assets/screeps-room-planning-3.png)
Like the last time I re-wrote my AI this post has become rather long. This is part 12 of my Screeps story, you can read the whole story here. 2017 Screeps Screeps Part 12 – Start Again