Path smoothing

For questions about using Classic.

Post » Tue Aug 09, 2011 11:44 am

I'm playing with a pathfinding, I have a sprite "Soldier" and a "Player". For soldier I have a custom pathfinding where a path is made of sprite objects, named "wp", aligned to a 32x32 tile grid. Each "wp" has is own PV "id", it's a number 1,2,3... up to X. Where 1 is the node closest to the Soldier, on the path to the Player and X is closest node to the Player.
It works ok, only looks robotic. I've read in an article about A* pathfinding, that I could smooth the path to make it look more natural, with the line of sight. The method should be like:
node 1 has clear view to node 3 > delete node 2....
I added LOS behavior to the "wp", but I don't know how to differentiate each node, how to pick node 1 and node 3 etc.

edit>
I thought, I could add the cap
don't mind numbers on the map, they have no purpose yet.
and the problem is in the event 14

edit2>
I think, the problem with the link is, instead "&" symbol there is %26. I've changed it back to "&", if it still doesn't work, use one of the links below.

1
http://dl.dropbox.com/u/10457408/Construct/ENG_FORUM/Help%26Support/PathSmoothing/path.cap

2
http://dl.dropbox.com/u/10457408/Construct/ENG_FORUM/Help&Support/PathSmoothing/path.cap
Noga2011-08-10 14:13:33
ImageImage
B
25
S
6
G
8
Posts: 773
Reputation: 6,643

Post » Tue Aug 09, 2011 10:13 pm

Might try using some interpolation using for each ordered on the nodes.
Also links messed up, a simple paste of the url will do.
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Wed Aug 10, 2011 2:16 pm

Link is fixed
ImageImage
B
25
S
6
G
8
Posts: 773
Reputation: 6,643

Post » Wed Aug 10, 2011 3:51 pm

Looks pretty good to me, might slow down the movement some.
As far as deleting nodes goes, that's only going to make it look more robotic. If anything you would want to add more nodes.
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249

Post » Thu Aug 11, 2011 10:31 am

I ditched that method, it was slow, but I'll probably need more help soon again.
I'm just curious, if it's possible in CC to test 2 instances of an object, like I'm trying in the event 14 or how should go about it.
ImageImage
B
25
S
6
G
8
Posts: 773
Reputation: 6,643

Post » Thu Aug 11, 2011 12:30 pm

You should be able to use a variable on the nodes to do that, or possibly the object pairer.
I would stay away from los for now. It has issues with multiple instances.
Image Image
B
161
S
48
G
89
Posts: 7,347
Reputation: 66,249


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests