Search code examples
javascriptscreeps

Does moveTo consider public ramparts walkable?


Does Creep.moveTo or Room.findPath consider public Ramparts as walkable?


Solution

  • Please note - I've only looked at the code branches dealing with the new pathfinder. So here are my findings:

    creep.MoveTo uses pos.findPathTo to generate a path, which in turn uses room.FindPath.

    room.FindPath calls a private function, _findPath2 which, using getPathfindingGrid2 and makePathfindingGrid2, obtains a cost matrix for the room. In line 176 of rooms.js ramparts that are not public have their cost set to 0xFF, rendering them unwalkable for the purposes of path finding.

    So it seems that public ramparts are walkable.