Path Finding Not Obeying Solids

Get help using Construct 2

Post » Thu Mar 28, 2013 4:05 am

Hello, I have a simple point and click top down RPG that using Pathfinding on the Hero and for some odd reason the Hero is not avoiding Solids. I have the Hero PFinding Obstacles:Solids and I have a Solid Wall with that behavior, but Hero insists he is Casper the Ghost. Any thought would be appreciated. Thanks

Brett
B
21
S
7
G
1
Posts: 128
Reputation: 3,076

Post » Thu Mar 28, 2013 4:15 am

Can you post a capx with a repro of the behavior you are seeing? That way we can take a look and see if it is an issue with objects or events...
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,418

Post » Thu Mar 28, 2013 4:37 am

Yes, Sir, see below, if you cant access it, please coach me on posting Dropbox URLs. Thanks.

https://www.dropbox.com/s/l5q4ucxt7rqh4sx/MiniAdventure.capx

Basic click/touch to move, you will notice when you are inside that moving around the Hero goes through solids.

Brett
B
21
S
7
G
1
Posts: 128
Reputation: 3,076

Post » Thu Mar 28, 2013 8:23 am

When I click on the wall blocks, etc... that the player passes through, I see that they do not have the solid behavior assigned to them. All the objects that block the player show solid, but the others (walls mainly) simply have the destroy outside of layout option. Which is also weird because unless the walls can move and walk out of your layout, they don't need that behavior. Just add solid to them.
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,418

Post » Thu Mar 28, 2013 8:30 am

Though the pathfinding does indeed seem to ignore the tables, etc... but the player you are controlling with the arrows does respect solids... Sorry at first I was confused as there are two players, one controlled by the arrows and one controlled via pathfinding...
B
49
S
11
G
10
Posts: 1,833
Reputation: 14,418

Post » Thu Mar 28, 2013 3:38 pm

thank you BluePhase, I will be able to recheck the code later tonight. I am certain I have solid on the blocks/walls, but maybe I don't, I was up from 9pm till Midnight working on it. The walls don't move but if you noticed I have a make-shift tile Editor that I used to Duplicate and place quickly. I have Destroy outside so those are not calculated while the game runs. thank you.

Brett
B
21
S
7
G
1
Posts: 128
Reputation: 3,076

Post » Thu Mar 28, 2013 4:04 pm

@jbmoyer Change the 'Cell Size' property of the pathfinding behaviour to 32. It's set to 20 right now, and that's why your character is clipping through objects I think.
slap it onto the flappy bird template...
bang it on google play with all the other shovelware...
sorted...
B
36
S
7
G
4
Posts: 322
Reputation: 8,170

Post » Thu Mar 28, 2013 4:07 pm

hmmm I was tweaking that value, but its hard to tell how going up or down affects movement, I wish we could SEE the cells. thank you will look at this as well.

Brett
B
21
S
7
G
1
Posts: 128
Reputation: 3,076

Post » Thu Mar 28, 2013 4:10 pm

If you're using the latest beta build of Construct 2 you can turn the grid on, that can help you puzzle out the right size for the pathfinding grid.
slap it onto the flappy bird template...
bang it on google play with all the other shovelware...
sorted...
B
36
S
7
G
4
Posts: 322
Reputation: 8,170

Post » Thu Mar 28, 2013 9:16 pm

BluePhase, so yes you are correct the walls do not have the Solid Behavior, which I need to fix. But I did create a Sprite and gave it Solid and threw it on top of the bottom wall, that big yellow rectangle you probably saw it. Any idea why the Hero still walks through that?

Thanks
Brett
B
21
S
7
G
1
Posts: 128
Reputation: 3,076

Next

Return to How do I....?

Who is online

Users browsing this forum: Timedoor Indones and 30 guests