(How to) exclude any room at multiroom path serach?


  • SUN

    Does anyone know if it is possible to exclude a room from multiroom path find (using .findPath/.findPathTo)?

    It seems that 'avoid:' param doesn't work with rooms array (as it is documented) at all.

    Once it does - is there a way to exclude a room I have no presence at (when Game.rooms[roomName2exclude] is unavailable) ?


  • Dev Team

    You have probably misread the documentation. It says:

    An array of the room's objects or RoomPosition objects which should be treated as obstacles during the search.

    This parameter can be used to avoid "room's objects", not "room objects", i.e. this is an array of either objects in the room or their positions.

    Currently, there is no way to search for a map route excluding the specified room, but we are working on that.



  • Has there been any update on this? I'm not really sure at the moment how to avoid a room of another player for example, except to do a wall of flags which are to be avoided or something.

     

    Cheers,

    Carl


  • Culture

    There are a few ways-

    1) Have your costCallback function return false for the rooms you don't want to go into,

    2) Have your costmatrix set all exit squares that lead to a prohibited room to 255 so creeps can't cross them

    👍


  • This post is deleted!