Path Finding Not Obeying Solids

0 favourites
  • 14 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • 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

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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...

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

    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

  • 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.

  • 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...

  • 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

  • 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.

  • 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

  • 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.

  • 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

  • Wrangler I just downloaded the latest, but turning on the Grid doesn't help, can you explain what your are thinking? I was expecting that if I turned on the Grid and based on what you were saying that it might show when I did preview, but no.

    Thanks

    Brett

  • I'm having a similar issue, thought maybe you had figured out what the deal was. I have a simple top down shooter and the Controlled Player moves just fine and obeys the solids. But the "Enemy" is on a Path Find and they just simply walk through all the wall "Solids". I have the path find set to solids and even had tried calling the "Make "Walls" obstacles."

    Thanks for any thoughts.

  • Anyone have a fix for this issue?

  • Ok I had the exact same problem where it would go straight through solid objects and for some reason this fixed it. I had it finding a path every tick to an object and it would fly through walls, I changed it to find a path every second and now it works perfectly. I don't know if it's the same problem you were having or not but I hope it helps

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)