[PLUGIN] Fast path finding (preview)

Post your completed addons to share with the community

Post » Thu Apr 12, 2012 6:13 pm

Awesome plugin, thank you!
B
38
S
8
G
3
Posts: 438
Reputation: 6,869

Post » Fri Apr 13, 2012 11:31 pm

Is it possible to loop through the found list of nodes somehow?

I'd like to start from the goal and loop back to the current node and then combine the pathfinder with line of sight to skip some "useless" nodes ;)

That would make the movement smoother (i already use the moveTo behavior) so it won't move as blocky as it moves right now... cause you can still see it uses a grid for the calculation of the path.
B
33
S
6
G
7
Posts: 338
Reputation: 7,424

Post » Sat Apr 14, 2012 9:12 am

[QUOTE=Ize] Is it possible to loop through the found list of nodes somehow?

I'd like to start from the goal and loop back to the current node and then combine the pathfinder with line of sight to skip some "useless" nodes ;)

That would make the movement smoother (i already use the moveTo behavior) so it won't move as blocky as it moves right now... cause you can still see it uses a grid for the calculation of the path.[/QUOTE]

The download section should be updated with version 0.21 of the pathfinder behavior which has PathLength expression. You can use this with "for" to have more control like above. Another thing is using Lerp, hide the pathfinder then use a second object to follow the pathfinder this time using Lerp to "smooth" the movement. Mess about! Let me know if you see any bugs or things that need adding/removing. Will be adding a few more expressions etc soon.
B
21
S
7
G
2
Posts: 185
Reputation: 3,280

Post » Sat Apr 14, 2012 9:15 am

@Ize

I would like to implement a path smoothing algorithm eventually. I made a Bresenham line algorithm plugin a while back see if I can find it.
B
21
S
7
G
2
Posts: 185
Reputation: 3,280

Post » Sat Apr 14, 2012 12:14 pm

Cool :)

I've implemented a basic LOS without looping through the array for now and it looks pretty neat actually:

http://dl.dropbox.com/u/45711709/testPath.capx

However i found that the pathfinder doesn't always find a path :(

If you click for example at the middle right and then again at the place where you started it won't find one... or if you click outside of the background sprite.

Sometimes it even moves through the set obstacle :/Ize2012-04-14 12:16:30
B
33
S
6
G
7
Posts: 338
Reputation: 7,424

Post » Sat Apr 14, 2012 6:57 pm

[QUOTE=Ize] Cool :)

I've implemented a basic LOS without looping through the array for now and it looks pretty neat actually:

http://dl.dropbox.com/u/45711709/testPath.capx

However i found that the pathfinder doesn't always find a path :(

If you click for example at the middle right and then again at the place where you started it won't find one... or if you click outside of the background sprite.

Sometimes it even moves through the set obstacle :/[/QUOTE]

See this post @Ize!
B
21
S
7
G
2
Posts: 185
Reputation: 3,280

Post » Wed Dec 12, 2012 11:17 am

The costing needs some instruction. I am trying to have the source object prefer to stay to the road, so I give the road a cost of 25 and grass (everything else except blocks)a cost of 99. It seems to prefer the road that way, but I still want the shortest route. I want it to find the shortest distance, and choose the path that travels that distance covering the most road along the way. 25/99 may go 8 blocks extra just to hit more road.

What numbers would come closest to what I am looking for? also what's the difference between the "Add" and "replace?"

edit: @00Rez Paradox2012-12-12 11:19:10
B
200
S
51
G
30
Posts: 896
Reputation: 36,494

Post » Mon Aug 12, 2013 2:33 am

hello,
sorry if this is a noobish question but how do i associate an object (sentry) with an astar object ? Whenever i try pathfinding with this behaviour it says : inst:sentry(10) is not associated with an astar object.
B
20
S
8
G
2
Posts: 122
Reputation: 3,202

Post » Mon Aug 12, 2013 7:40 pm

I'm also getting this. It's strange because the example files run fine and the code is the same.
B
37
S
19
G
18
Posts: 613
Reputation: 10,231

Post » Tue Aug 13, 2013 11:28 am

Looks like this plugin is not compatible with the latest stable version of construct. If you delete the behaviour in the examples and apply it again and resave then you get the errors.

Such a shame as the inbuilt pathfinding is no good for TBS or grid based games, it seems only geared for RTS.
B
37
S
19
G
18
Posts: 613
Reputation: 10,231

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: edisone and 4 guests