Navigation

    forum

    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    1. Home
    2. DarkDestry
    • Flag Profile
    • block_user
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Groups
    • Blog

    DarkDestry

    @DarkDestry

    7
    Posts
    917
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    DarkDestry Follow

    Posts made by DarkDestry

    • RE: Creep.moveTo and Pathfinder is returning single position paths

      @mrfaul Are you sure? the flee flag works in creep.moveTo? The last time I tried it didnt work.

      posted in Technical Issues and Bugs
      DarkDestry
    • RE: Creep.moveTo and Pathfinder is returning single position paths

      @w4rl0ck Except in my case the "Correct direction" was to run into a wall.

      posted in Technical Issues and Bugs
      DarkDestry
    • RE: Creep.moveTo and Pathfinder is returning single position paths

      Something in my code was suppressing the error. It does return -2 but not every tick. How much of the Pathfinder.search() opts can be used in creep.moveTo()?

      posted in Technical Issues and Bugs
      DarkDestry
    • RE: Creep.moveTo and Pathfinder is returning single position paths

      I wasnt even trying to punish the pathfinder lol. It was using legacy creep.moveTo() code. I was wondering why it wasn't moving to the target.

      Yes. I realise that the issue can be circumvented by reducing complexity. But this is happening on 'creep.moveTo()' and there isnt an incomplete flag in that function. Neither is it returning any error codes. I was confused for a good 4 hours wondering why it was doing that. This needs to be better documented. Its just a room that any beginner can encounter and there are no indications when the path is incomplete using creep.moveTo() (Unless im missing that documentation)

      posted in Technical Issues and Bugs
      DarkDestry
    • Creep.moveTo and Pathfinder is returning single position paths

      The issue here is not whether the parameters of the pathfinder can be altered to fix the issue, but rather why the pathfinder is returning single position arrays as the incomplete path.

      I have the following code

      creep.moveTo(target.pos, {range: 1, ignoreCreeps: false, swampCost: 5, visualizePathStyle: {...}});
      

      it results in the creep pathing through the wall to 0_1556689886781_8e7712e6-007f-41d5-9632-7729ff3eae5e-image.png
      Replay link: screeps.com/s/igfwWp

      Changing the swamp cost to 4 results in the following incomplete path

      0_1556689970065_267388b7-3be5-42bd-8b0d-724e78da6552-image.png

      Verifying with Pathfinder,

      Game.rooms["E33N33"].drawPath(
          PathFinder.search(
              new RoomPosition(16,34,"E33N33"), 
              {pos: new RoomPosition(10,32,"E33N33"), range:1}, 
              {swampCost: 6}
          ).path
      )
      

      The following incomplete path is drawn with a swamp cost of 6 0_1556690590533_73bbcbf0-db14-426d-b408-2b1e8d19cfe4-image.png

      The following single RoomPosition path is returned when the swamp cost is 7

      console.log(
          JSON.stringify(
              PathFinder.search(
                  new RoomPosition(16,34,"E33N33"), 
                  {pos: new RoomPosition(10,32,"E33N33"), range:1}, 
                  {swampCost: 7}
              ).path
          )
      )
      
      [2:03:09 PM][shard3][{"x":16,"y":35,"roomName":"E33N33"}]
      
      posted in Technical Issues and Bugs
      DarkDestry
    • RE: Pathfinder flee going through structures

      @mrfaul Thanks for the suggestion. Seems to work in simulation.

      Further reading of the documentation at Pathfinder.CostMatrix does state that pathfinder only considers terrain data when finding a path. That should be further emphasized in Pathfinder docs. Reading of the sample code given at the side does show it generating a cost matrix and marking all structures as 0xff.

      Proposed solution:
      Introduce flee to creep.moveTo OR
      make all structures untraversable in the default costmatrix OR
      just make the documentation clear on that part.

      posted in Technical Issues and Bugs
      DarkDestry
    • Pathfinder flee going through structures

      I have the following code

          //If there is literally no more construction targets, Hide somewhere away from everything
          if (!target) {
              var path = PathFinder.search(creep.pos, creep.room.find(FIND_STRUCTURES).map(s => {return{pos:s.pos, range:5}}) , {flee:true, ignoreRoads: false} ).path
              creep.moveByPath(path)
              creep.room.drawPath(path) // My own function to visualize the path
              return;
          }
      

      I get the following result

      0_1556258127479_7cc3f836-41c9-4051-bd76-845e27bab355-image.png

      Am I doing something wrong? Why is it pathing through solid structures?

      posted in Technical Issues and Bugs
      DarkDestry