Issues with Pathfinder

Discussion and feedback on Construct 2

Post » Fri Jul 29, 2016 10:33 am

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.

Cheers!
B
18
S
3
Posts: 65
Reputation: 994

Post » Fri Jul 29, 2016 12:35 pm

Can you provide a simple capx where you reproduce the problem?
B
137
S
33
G
17
Posts: 1,560
Reputation: 20,797

Post » Fri Jul 29, 2016 4:06 pm

im making game using pathfinder maybe i can help.
upload a capx or link to game
B
113
S
28
G
48
Posts: 1,882
Reputation: 36,478

Post » Fri Jul 29, 2016 7:40 pm

Message: TheWindmiller can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Hey, sorry for delay, had to get back home so I can muster up a quick example project.

https://www.dropbox.com/s/ahqhj1dv3mrj444/PathfinderIssue.capx?dl=0

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!

CHeers!
B
18
S
3
Posts: 65
Reputation: 994

Post » Fri Jul 29, 2016 9:31 pm

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

Use
condition 'on path found'
action move along path

Maybe follow this tut once.
https://www.scirra.com/tutorials/1118/path-finding
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Fri Jul 29, 2016 9:43 pm

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.
B
18
S
3
Posts: 65
Reputation: 994

Post » Fri Jul 29, 2016 9:46 pm

Yeah. So.

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

Use
condition 'on path found'
action move along path

Maybe follow this tut once.
https://www.scirra.com/tutorials/1118/path-finding
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Fri Jul 29, 2016 10:49 pm

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...
B
18
S
3
Posts: 65
Reputation: 994

Post » Sat Jul 30, 2016 9:42 am

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 :
Image
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Sat Jul 30, 2016 10:04 am

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.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 1 guest