Issues with Pathfinder

0 favourites
  • 11 posts
  • Hi guys.

    I'm having this very odd issue with the pathfinder behaviour and its breaking my balls.

    First to mention: I have rotation disabled and a very fast rotation speed set despite that so the lag which is normally filled by rotating the sprite is minimal - I am aware of that bug so the problem does not concern it.

    So here's the thing, I have a layout set up, pathfinder works works great, goes where it has to, always finds shortest route, its fast enough. But then I add an object with the Solid behavior, only one, and the pathfinder freaks out. Several things begin to happen.

    a) every time I try to send the pathfinder object someplace, I have to click twice with the mouse, as the first time nothing happnes (almost every time),...and I'm not talking about delay, just nothing happens (mind you this happens only after I've introduced an object which the pathfinder has to aknowledge - and it is small and the pathfinder cell size is small enough)

    b) the path is veeery chaotic...sometimes it goes in the right direction...slows down, accelerates again, sometimes it would make very odd curves as if going arround some invisible object...and there is nothing there Im certain.

    c) it generally starts to feel buggy, now, I've tried out the pathfinder demo that goes with construct and there it works fine,...I can't put my finger on what im doing wrong. If someone has experienced something of the sort, I would immensly apprciate you sharing how you fixed this.


  • Can you provide a simple capx where you reproduce the problem?

  • im making game using pathfinder maybe i can help.

    upload a capx or link to game

  • Hey, sorry for delay, had to get back home so I can muster up a quick example project.

    Don't mind the snapping at the end of the path that sometimes snaps to the wrong tile object.

    To get an idea of my issue, please click around on the green tiles and get a feel of two things:

    a) that not every click responds - actually every other does

    b) click longer destinations and see that sometimes the pathfinder decides on some pretty weird paths while it doesn't even go close to the sole obstacle in the middle

    After you try this, just delete the instance of the obstacle object and try the same again to see how much more fluid and responsive it is.

    I've tried this on at least three different machines and it acts the same - albeit all of them were on Chrome.

    Any help or insight would be hugely appreciated, thanks in advance!


  • Halfway following a path, it finds a new path and follows that. This is what you see.


    condition 'on path found'

    action move along path

    Maybe follow this tut once.

  • I don't get it. This tut is for stuff after the guy has arrived at the end of his Path, my issues are that I don't detect every click to find a new path when there are solids on the map, and that the pathfinder sometimes chooses to act awkwardly.

  • Yeah. So.

    Halfway following a path, it finds a new path and follows that. This is what you see.


    condition 'on path found'

    action move along path

    Maybe follow this tut once.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ok, so i guess i get your idea, i find a new path on every tile passed which does work. The path is no longer awkward, thanks! Still, the unresponsiveness is an issue...why doesn't it respond to mouse clicks as well when obstacles are present...

  • Did you really made a top level condtion (as explained in every tutorial) ...

    Sprite > pathfinding> 'on path found'

    Followed by the action Sprite > pathfinding> move along path


    As you can see in the tutorial on event 2 :

  • Allow me to explain it this way.

    CoolBlue dileverd us a MathTeacher. The manual says we have 2 actions and 1 condition.

    Action 1 = Ask the dude to solve some mathproblem. ('Ask')

    Action 2 = Tell us the solution. ('Tell')

    Condition = On the moment that he knows the solution. ('On known')

    Manual also states that he takes some time to find the solution.

    So what we do ?

    We start with the action 'Ask'

    Then we make a top-level condition

    'On known' paired with the action 'Tell'.

    Now we do other stuff, like watching tv, and change some pampers, and wait till the dude is ready.

    All this time we make sure that we and no one else feeds the dude a new mathproblem, got to wait till he is ready. Else he will go crazy. And we lose the warranty.

    When the dude is ready, the 'On known' triggers, and the dude tells us the solution.

    What did you do ?

    You start with 'Ask' followed by 'Tell', under a trigger !

    But the dude is not ready yet, so he cant tell yet.

    So when he's ready he's holding his breath, eager to tell. But he cant, the actiont to 'Tell' is caged under that trigger.

    So the next time you use 'Ask' followed by 'Tell' that fast, the pure dude is stuck on what to do.

  • Er...sure, thanks I guess. Much appreciated.


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