bencbartlett / Overmind

AI for Screeps, a multiplayer programming strategy game
MIT License
552 stars 158 forks source link

Pioneers not being properly reassigned to worker roles #71

Open bencbartlett opened 5 years ago

bencbartlett commented 5 years ago

In colonize.ts -> run(), pioneers are correctly reassigned to miningOverlords but are not correctly reassigned to worker overlords. Unsure as to why at this time.

ahmedcharles commented 5 years ago

I noticed this and the strange thing is that the pioneer's C memory key was the name of the colony that spawned the pioneer and not the name of the new colony. This seemed to result in it not being part of this.overlords.pioneer.pioneers. This could be the result of the original reassign going wrong (I didn't add debugging until after) or it could be that the pioneers were assigned to the wrong room to begin with, though that would suggest that reassigning to mining wouldn't work either. I didn't see that work, I just noticed that there was a pioneer doing nothing.

ahmedcharles commented 5 years ago

Based on the logging I added in #109, it's obvious that reassignment works for both miners and workers, some of the time. I think the edge case may be pioneers that aren't yet assigned to this colony, i.e. pioneers that are being spawned or are on their way to the room. Does that seem like a probable cause?