Flag 'ignoreRoads' set to true prevent pathfinding on roaded wall

    • Shard: shard 3, but should not be shard-specific
    • What happened: when Creep::moveTo used with ignoreRoads: true, pathfinding does not 'see' roaded wall as walkable. This prevent creep from navigating through such roads. This might be intentional, but not documented.
    • What should have happened: roaded wall should be considered walkable even when ignoreRoads is true. Or ignoreRoads whould have documented side effect (I can do docs and pull request if needed).
    • To reproduce: use Creep::moveTo to position that is only accessible via roaded wall, and try different flag values.

    Here is a reply of my miner struggling to get to source: https://screeps.com/a/#!/history/shard3/E39N2?t=5889387 As soon as I changed the flag source was successfully navigated to 😎

    And code snippet, source is a placeholder for actual Source object

    const rc = creep.moveTo(source, { ignoreRoads: true, maxRooms: 1, range: 1 });

  • Interestingly creeps can 'hop off' such obstacles if adjacent tiles are walkable.

    Here is a sim picture with example setup: 0_1555056546808_ignoreRoads.png

    Pathfinding has no problem to go from roaded wall to plains.

    So as workaround I now set flag to 'false' only when going to harvesting. Maybe this is interesting for someone.

  • It's always been like this, because roads modify the CostMatrix for the pathfinder from default terrain values. They also make swamps more easy to cross too. Ignoring roads will return swamps to their "hard to navigate" state as well (could be added to the documents, though).

    Now, the question is, why are you ignoring the roads? From my experience there is absolutely no benefit from that outside of making sure they don't wear down as fast.

    If you're trying to make your creeps treat the roads equally to normal plains, you can achieve so by setting plainCost to 1 and swampCost to 5 in the moveTo parameters, this will make roads equal in weight to plains, and creeps will choose the shorter path, however, creeps would still choose to take roads over swamps and walls.

  • @orlet Idea of ignoring roads was to try and tweak everything 😃

    I disliked how they jigsawed around trying to be on the road more, especially when I specifically designed most of them to have same number of legs as other bodyparts. Idea with plainCost == 1 is more logical step, yes.

    As for documentation, well, it is not even a side effect, just a long train of thoughts. Solved I guess 8).

  • @elynx don't forget to also set swampCost if you're setting plainCost, to keep them at the proper proportion.

  • Dev Team

    A tunnel is a road through the wall, and if you're asking pathfinder to ignore roads, it does ignore all roads, including those that are in walls. Actually, it would be quite weird to expect otherwise. If you want a complex logic like 'ignore this road, but not that one', I'd say it's time to use CostMatrix-es.

    Not a bug/As designed/Won't fix 🙂