[Behavior]PathFinder

Post your completed addons to share with the community

Post » Mon Oct 24, 2011 11:09 pm

didnt see this topic before, this kicks my ass on ^^

thanks :)
B
15
S
3
G
5
Posts: 396
Reputation: 4,977

Post » Tue Nov 08, 2011 12:02 pm

Nice. Will come in handy.
B
28
S
7
G
7
Posts: 102
Reputation: 6,483

Post » Tue Nov 08, 2011 12:20 pm

I just loved it.... will be so useful.
B
203
S
37
G
13
Posts: 136
Reputation: 29,523

Post » Mon Jan 09, 2012 9:46 pm

Long time overdue, the behavior has been updated to fix the obstacles bug.
You can now use several obstacles and they get better spotted.

You can also find a new example about how to move an object with the PathFinder behavior.

Fixes and examples thanks to @Yann.

Check the first post to download everything you need.

Happy PathFinding in 2012.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Tue Jan 10, 2012 12:25 am

By the way, this latest version only worked for me when I removed line 6 (version) from edittime.js

edit: maybe it was just the missing ,Wronghands2012-01-10 00:26:50
B
47
S
3
G
5
Posts: 56
Reputation: 4,630

Post » Tue Jan 10, 2012 12:45 am

@Wronghands: thanks for the notice.
Indeed it was a last second copy/paste.

It should now be fixed in the zip.Kyatric2012-01-10 00:48:27
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Tue Jan 10, 2012 3:57 am

Excuse my constant whining but I made this badly drawn graphic to point out an unintentional behaviour. Sprite doesn't move on a straight line from A to B but rather prefers the long route I've drawn, avoiding the green obstacle by leaving a margin of 1 cell. I'm not sure if this may have anything to do with the way motion is implemented in the example or the heuristic formulas but the online demo is working as intended. Something to do with the newly modified obstacle code perhaps?

Wronghands2012-01-10 13:22:55
B
47
S
3
G
5
Posts: 56
Reputation: 4,630

Post » Tue Jan 10, 2012 3:17 pm

Also, this is how it happens vertically, from A to B and vice versa. This only happens when the sprite is on the right or below of the obstacle, never when it's to the left or above it:

Wronghands2012-01-10 15:19:21
B
47
S
3
G
5
Posts: 56
Reputation: 4,630

Post » Tue Jan 10, 2012 5:58 pm

Indeed, the fix doesn't completely fix the issues ^^

I have a pretty good working version now. It's almost done, I need to iron out one or two things before release though.
It will probably be done by a couple of days.Kyatric2012-01-10 17:59:18
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Tue Jan 10, 2012 7:34 pm

Nice, thanks :)
Meanwhile I've got another report that might help you debug it more.

In a real turn based environment, movement costs and unit movement ranges come into play and one has to calculate paths before the movement is triggered then allow it accordingly. I can easily throw in a variable and compare it to the pathlist to decide whether or not the movement is allowed however I do need to calculate paths dynamically therefore I'm running the pathcheck on every tick, with issues:

With this capx, one of these things happens:

1- Works as intended for a while eventually locks up the canvas. May occur in the path generation phase before the movement is triggered with the mouse. Just hover the mouse around any element for a while and it'll lock up.

2- Canvas is frozen upon load, elements can be seen but are locked up.

3- Canvas is filled with a solid grey color.

This behavior has great potential and I'm getting the hang of it now. It'd be a shame if it wasn't actively developed so thanks for all the effort you've been putting into it.


(edited for clarification)Wronghands2012-01-11 02:00:11
B
47
S
3
G
5
Posts: 56
Reputation: 4,630

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 0 guests