r119 Pathfinding odd behavior

  • Link to .capx file (required!):

    https://dl.dropbox.com/u/666516/rightTurnclydepathfinding.capx

    Steps to reproduce:

    1. Run preview

    Observed result:

    The green square will turn to its right slightly on the first movement

    Expected result:

    There are no obstacles within the path, and the ending xy should be within grid coords so the object shouldn't need to turn

    Browsers affected:

    Chrome: dunno

    Firefox: yes

    Internet Explorer: dunno, duncare

    Widows 7 & service pack: blah

    Construct 2 version:

    119

    Thanks

  • The destination object is a solid so it's not a clear path, and as far as I can tell it's working correctly since it's finding a lower path given the obstacle ahead. Closing as not a bug. If you think there is still an issue, try to reproduce it in one of the pathfinding demo projects, since those have options to display the nodes and pathfinding obstacle map and that can make it a lot clearer what's going on.

  • There is no destination object. The path is self.x+64, and self.y.

    There is only one solid object on the map. The turning happens even if you remove the solid behavior from that object.

    I've added a loop to generate nodes. If you want to take a look at it again.

    Since the path at first has no object in its path the loop should only make two nodes, the start, and the end, however it seems to be setting the first node at 0,0 for some reason.

    No idea if that has anything to do with the turning.

  • Well, the nodes are always aligned to the pathfinding grid. That's by design.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Alright that makes sense. I adjusted the initial xy with an offset for half the cell size, and there was no turning.

    I would be a little worried about that node at 0,0 though.

    Thanks

  • newt - that's because you loop up to the size of the array, where you should loop to size - 1.

  • Ah, ok I was expecting node(0) to be at sprite's xy at the time the find path was called.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)