Invader creeps are showing up in Game.creeps



  • I'm seeing a lot of errors similar to this:

    ERROR WHEN PROCESSING CREEPS: TypeError: Cannot read property 'debug' of undefined
    Creep.isDebug (proto.Creep:121:23)

    Checking the method, the only thing being referenced is this:

    Creep.prototype.isDebug = function() {
    return this.memory.debug ? true : false;
    };

    I added some debug statements and found out Invader creeps are showing up in Game.creeps:

    ERR/WARN, CREEP HAS NO MEMORY, DUMP: {
    "room":{"name":"W22S12","mode":"world","energyAvailable":0,"energyCapacityAvailable":0},
    "pos":{"x":33,"y":30,"roomName":"W22S12"},
    "id":"5790d314645979b31d5e7c37",
    "body":[<...removed...>],
    "my":false,
    "owner":{"username":"Invader"},
    "ticksToLive":1367,
    "carryCapacity":0,"carry":{"energy":0},
    "fatigue":0,"hits":1000,"hitsMax":1000}

    This has resulted in many breakages, and I can confirm I have seen this issue intermittently for 2-3 days prior to now.


  • Dev Team

    Please check now, is it resolved?



  • I did not see it just now and invaders just spawned.  I know that the creep that caused it was in a remote mining room, though I'm not sure if that makes a difference.  I'l keep an eye on things and see if the issue pops up again.



  • A quick update - I checked some other error messages I have gotten recently and I believe there have been invalid entries on Game.flags and Game.spawns as well.  I see the same type of error in some of my flag management code, and I believe it is very likely to be related to the issue above.


  • Dev Team

    Any concrete examples?



  • I have this error message from my email history:

    ERROR WHEN PROCESSING CREEPS: TypeError: Cannot read property 'spawntick' of undefined
       at FlagManager:490:32
       at arrayFilter (/opt/engine/node_modules/lodash/index.js:1384:13)
       at Function.filter (/opt/engine/node_modules/lodash/index.js:6309:14)
       at Object.FlagManager.getRawCollectorDemandFlags (FlagManager:478:18)```
     

    The line used to be this:
    if(flag.memory.spawntick && flag.memory.spawntick == Game.time) return false;
    i had to change it to this:
     
    if(!f.memory || f.memory.spawntick && f.memory.spawntick == Game.time) return false;

    The code is iterating through flags obtained via Game.flags.  Is that enough information?  I don't have a way to reproduce at the moment.


  • Dev Team

    This seems to be a different unrelated issue, and I'm not yet sure it's an issue with the server at all. Game.flags cannot contain other players' flags, they are simply not fetched by your runtime process.



  • Ok, thanks.  I've added extra instrumentation to my code, I'll update this post or create a new one when I have more info.