Did your creeps start going into other rooms on their own ?
-
My creeps sometimes go into the next (unoccupied) room, wait at the controller, and die slowly. It was even worse when a player was still in that room, because my creeps would just get shot and it looked like an attack (if you read this, I'm sorry !).
I'm not asking you to debug any code, that would be too laborious. I'm just hoping someone had a similar problem, so that their solution will give me an idea of what's wrong.
The only reasons to go in other rooms are for the specialized creeps : capture a room (minimal body) and die, and get some energy to a designated "needy" room (massive body). But no room is designated and those going have typical bodies
I'm a fairly new player (3/3 rooms, started summer 2016 and don't play often), so there isn't that much complexity in my code, but I can't figure out why they do that ; especially since it's not always, I can't debug.
Any ideas, stories ?
-
Dear LogicalKip,
Unfortunately, there is no funny business from the server code. It is likely that the issue is isolated to your code.
Make some heavy use of console.log or creep.say and find out what happened.
Kind regards,
Your neighbor
-
If I had to guess . . .
You haven't set "maxRooms" to one in your moveTo call, so your creeps are finding paths that involve going out of the room (which is more likely to occur when their way is blocked by other creeps).
I'm also guessing you're using `creep.room` to get the target, so when it enters a new room it is also switching targets. This would explain why it goes for the new controller.
Easy fix is to set maxRooms to one on creeps that have no reason to leave the room.