Schoolie440 / ScreepsCoop

Brian, Joe, and Ben's Coop Screeps Repo
0 stars 1 forks source link

Spawn logic could be improved when recovering from an economic crisis :) #29

Closed schoolie closed 6 years ago

schoolie commented 6 years ago

Current spawn logic always tries to build the biggest creeps the room can handle, unless there are no creeps left at all, then it spawns a tiny one.

Schoolie440 commented 6 years ago

Yeah, I did a little bit with this a while back and scrapped it. I guess I was planning on avoiding genocide for the most part ;) With all the modifications being added, though, I think it would be a good idea. I think bodyPartCap or whatever it was could be modified by a creep count check before the .push methods create the bodyParts array. If 0 creeps make 300 cost creep, if < 3 creeps maybe a 2,2,2 creep, and so on.

On Thu, Aug 23, 2018, 4:11 PM Brian Schoolcraft notifications@github.com wrote:

Current spawn logic always tries to build the biggest creeps the room can handle, unless there are no creeps left at all, then it spawns a tiny one.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/schoolie3344/ScreepsCoop/issues/29, or mute the thread https://github.com/notifications/unsubscribe-auth/AGh19LTJyPBNHHSVQURAb1Z3ZXzg89Heks5uTwyKgaJpZM4WKRXn .

schoolie commented 6 years ago

One idea: Determine the max energy harvest rate based on the number of WORK parts on creeps in the room. Base the size of new creeps on that number, targeting the ability be spawning creeps X% of the time (25% ?) based on how fast the existing creeps can refill the stores.

schoolie commented 6 years ago

Meeting in the middle between your idea and mine:

Rather than counting creeps, count WORK parts. 0-2 WORK parts: bodyPartCap = 3 3-5 WORK parts: bodyPartCap = 6 etc...

Schoolie440 commented 6 years ago

Yeah, sounds good.

On Thu, Aug 23, 2018, 4:18 PM Brian Schoolcraft notifications@github.com wrote:

Meeting in the middle between your idea and mine:

Rather than counting creeps, count WORK parts. 0-2 WORK parts: bodyPartCap = 3 3-5 WORK parts: bop etc...

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/schoolie3344/ScreepsCoop/issues/29#issuecomment-415557602, or mute the thread https://github.com/notifications/unsubscribe-auth/AGh19Ju0GGoqE8zSGQMXb3oU3TaarunDks5uTw4EgaJpZM4WKRXn .

Schoolie440 commented 6 years ago

Added it. Feel free to tweak the numbers if you feel you can make it more effective. Pretty much slung potatoes at the wall on it. 72d7cc3639398aba6e7b8831736ff4f4d0650c9b d9b9ef136a5672e9d47f371c2fe4af8c19e2f2aa