Pathfinding clipping objects

Discussion and feedback on Construct 2

Post » Sun Oct 18, 2015 9:16 am

Does anyone know why in this simple pathfinding demo the black square crosses over the ends of the red object when trying to move around it?

Does pathfinding not use the objects collision polygon?

https://www.dropbox.com/s/h3uamm9f9x34ydt/Pathfinding%20test.capx?dl=0
B
9
S
2
G
1
Posts: 7
Reputation: 1,631

Post » Tue Oct 20, 2015 4:17 pm

Hello;

I've noticed this kind of behavior also.

yours
Winkr7
B
34
S
8
G
3
Posts: 169
Reputation: 3,305

Post » Tue Oct 20, 2015 4:56 pm

Dru wrote:Does anyone know why in this simple pathfinding demo the black square crosses over the ends of the red object when trying to move around it?

Does pathfinding not use the objects collision polygon?

https://www.dropbox.com/s/h3uamm9f9x34ydt/Pathfinding%20test.capx?dl=0


No it doesn't. You have to write your own push out of solid. Use search on th forums, there are topics about it.
My professional Royalty Free Music at Scirra Assets Store
--------------------------------
Specs: i5 2500, 16gb of ram, gtx 770, win 7, Focusrite Scarlett 8i6, Mackie mr8mk2, Alesis 320, browsing the net on chrome.
B
92
S
30
G
22
Posts: 1,987
Reputation: 20,178

Post » Tue Oct 20, 2015 6:28 pm

Dru wrote:Does anyone know why in this simple pathfinding demo the black square crosses over the ends of the red object when trying to move around it?

Does pathfinding not use the objects collision polygon?

https://www.dropbox.com/s/h3uamm9f9x34ydt/Pathfinding%20test.capx?dl=0

You can use physic object for movement and use pathfindig for finding path
search for generals war in google play I did this in my game
like this :
1 find path
2 get first node
3 move to node with physic
4 on close to node get another node and do 1 to 4
5 every x sec find path again( for some times if object pushed away from node)
.
but you can use flowfield algorithm insted of pathfinding behavior if you want a better solution but its harder to be done !
B
16
S
6
Posts: 243
Reputation: 1,755

Post » Thu Oct 22, 2015 7:42 pm

Ah ok thanks so there are a couple of options to get around this. Either using physics or manually pushing the object out of the solid as it moves.

It seems strange that while pathfinding finds paths around solids the object you then set to move along the path completely ignores solids.
B
9
S
2
G
1
Posts: 7
Reputation: 1,631


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 10 guests