Nabu's Forum Posts

  • Great ! Thank you soooooooooooo much ! I'm very happy about this ! Thank you for your time !

  • Ashley,

    Here is another example to clearly illustrate what I would like to have in native Pathfinding behavior. It is done using the EasyStar.js porting made by Magistross, setting the diagonals to On and the behavior specific property "Corner Cutting" to Off. It is asynchronous, so has about the same performance than the native behavior, and it's cool.

    https://www.dropbox.com/s/75fa1tnmykzkbdn/PathfindingExample.capx?dl=0

  • Problem Description

    When the diagonals are enabled, there is a bug with some area configurations where you can't get out though you can get inside.

    Attach a Capx

    https://www.dropbox.com/s/qmtgtkr42mmmlbu/PathfindingBug.capx?dl=0

    Description of Capx

    A player with Pathfinding behavior, any click to find path and move. A tilemap declared as a custom obstacle for the Pathfinder. Blue dots are created to display the path nodes. Hit "space" to display the obstacle map.

    Steps to Reproduce Bug

    • Click inide the area in the middle right for the player to get in. See that it's possible.
    • Once you're there, click outside to try to get out, and see that you cannot.

    Observed Result

    The pathfinder can't find path in some situations and put path node right on top of declared obstacle.

    Expected Result

    You should not be able to get inside the area. And the pathfinder should not be able to put path node on declared obstacle.

    Affected Browsers

    • Chrome: (YES)
    • NodeWebkit: (YES)

    Operating System and Service Pack

    Windows 7 64bit SP1

    Construct 2 Version ID

    Realease beta 226

  • Thank you for reply —

    So it is impossible to get right path with pathfinding and cell size the same as tile size ? I don't really understand. In the example the tiles in diagonals in the walls are marked as obstacle, even with -1 cell border.

    Also, as you can see in the example, the pathfinder put nodes right on top of declared obstacles. I think it's actually a bug. I modified the project file in example and added a enclosed zone to the right of the layout. See that you can go in there (Pathfinder put a path node on a declared obstacle), but you cannot go out from there.

  • If some other people get stuck with the problem, I came with a backup solution. The problem is to keep objects moving in diagonal but also to not find path between two close diagonal tiles.

    Use the Pathfinding behavior with diagonals off, only to find a path and avoid setting path between two diagonal tiles. And for the movement, use another behavior and regularly test if the next node on the path is in line of sight or directly reachable via raycasting or whatever. If so, then set the object to follow on with this next node.

  • Hello,

    I found the possibility in Construct 2 to have multiple Pathfinding behaviors for the same sprite or family, and different Pathfinding behaviors with different name for different objects. This actually seems to do nothing cause there can be only one (Highlanders !!) Pathfinding behavior at a time. For example, if you use multiple behaviors and set different obstacles for each one, only the first object or family declared as obstacle will be record and apply for all objects that use a Pathfinding behavior.

    So why do we have this possibility in the editor that does nothing ? It would be really cool to have multiple pathfinding behaviors, with different obstacle maps for some projects.

    A capx that illustrates the problem :

    https://www.dropbox.com/s/rop1x9ysydnqb9c/PathfindingProblem3.capx?dl=0

    A link to a closed bug report about the same problem :

    https://www.scirra.com/forum/viewtopic.php?f=152&t=166387&p=1004339&hilit=pathfinding+different#p1004339

    I really think the Pathfinding behavior should be improved. Also there's problem with the diagonals that some other people mention in the forums. My bug report on this : https://www.scirra.com/forum/viewtopic.php?f=151&t=170406

    Ashley, please, can you do that ? It would be so great !

  • Problem Description

    Pathfinder find path where it should not, in in the diagonals.

    Even an object with a size of 1x1 could not pass and follow the returned path.

    Attach a Capx

    https://www.dropbox.com/s/ta0lowufer55sm6/PathfindingProblem2.capx?dl=0

    Description of Capx

    Here's a little capx to display a pathfinding problem. Any click to move the red sprite. Try to go left or right and see that it can pass through diagonal walls. R to retry and space to display obstacle map.

    Steps to Reproduce Bug

    Just try to go behind the walls. In theory it's impossible because there's not space between tiles. Try to go into the enclosed area on the right and see that you can pass through wall, but you cannot find out path.

    Observed Result

    Object find path through walls hen diagonal movement is enabled.

    Expected Result

    Find good path, because the pathfinder leads the object to bounce against walls if piloted by physics or other movements.

    Affected Browsers

    • Chrome: (YES)

    Operating System and Service Pack

    Windows 7 SP1

    Construct 2 Version ID

    Construct 2 Release 223

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Really ? Nobody ? I edited the link in the first post so it now displays the pathfinder nodes onscreen. This is a strange behavior.

    Please, I need help on this.

  • Hello ? Nobody ?

  • Hello,

    Here's a little capx to display a pathfinding problem. Any click to move the red sprite. Try to go left or right and see that it can pass through diagonal walls. R to retry and space to display obstacle map.

    https://www.dropbox.com/s/ta0lowufer55sm6/PathfindingProblem2.capx?dl=0

    Is this an intended behavior of the pathfinding plugin ? I use a cell border of -1 because otherwize the obstacles are way too large. And a cell size of 32, the size of the tiles. Why does the pathfinder ignore the size of the object that's moving, and make it pass through diagonals.

  • Hello MarkeGamer,

    I've never used the touch but, basicaly I think just check the direction of the touch (with somethin like touch start and touch end, I don't know) and apply an impulse with Chipmunk physics at that direction or an angle (switch to polar when setting the impulse).

  • R0J0hound,

    I didn't think of tiny tilemap, or pasting a little sprite. Thanks for the tip.

    It is a bug in your plugin using WebGL ? Or does it come from WebGL only ? It's strange.

    Thanks for your help.

  • Hey R0J0hound,

    I was using WebGL, and the problem doesn't occur anymore when I disabled it. Everything is correctly drawn without it. So you're right it's related to WebGL. So what can I do ? I used the Paster plugin because of that, in comparaison with Canvas.

  • What do you mean by orientation, scrolling ? In project properties, under Configuration Settings, you have orientations option, landscape, portrait.

  • Hello,

    Check every tick or every seconds if the object's size has reached a value, then disable the Sine behavior and set the object's size by yourself if needed (using scale object property, or dimensions directly).