PathFinding behaviors issue

0 favourites
  • 11 posts
From the Asset Store
Units do not overlap each other and use different ways if there are several free ways.
  • Hi there,

    I have several questions about this behavior. I would like to make it work on a grid and only with horizontal and vertical movements. But it seems that is not possible ?

    Also, my grid is 22x22, when I have wall like this :

    111111111

    100000001

    100000001

    111101111

    The number "1" represents walls and "0" holes, that are 22x22 each. This is a closed square but on the bottom , as you can see, there is a hole that is 22x22 too. If I put a sprite in the "square", it is not be able to find a way to get out of there.

    I try to use the "border cell" function with -1. That works, but my sprite move on the borders of the walls :( and not with horizontal or vertical movement (it has diagonal movement too).

    Normaly it should be find the hole and go down but....no.

    Is there something that I missed ?

    Thank you in advance :)

  • The next build has an option to turn diagonals off!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That's cool :) Do you think, with this new feature, my "path finding" problem should be resolved ?

    As you can see in my sample above, at the same as there is a holes 22x22, the sripte doesn't find the way to go. The fact is that when I turn the border option on with -1 the sprite finds the way but it doesn't respect obstacles (it "walks" on the border of obstacles, instead of walk throught the holes).

  • Can you share a .capx? Setting a border of -1 shouldn't do that.

  • Sure,

    http://db.tt/Ilbm6M7p

    Look at this sample : it's worse :)

    In this sample, I have walls that have 22x22 and two sprites with the same dimensions.

    The red sprite is not be able to find a way to go to the blue sprite, at the same as I put -1 in the border property.

    It's "only work" if I change the hot point to top left for each element (walls and sprite), and it "works" but it's weird, because the sprite runs on the border of walls instead of take a "linear" path.

    The aim of this sample is to make a maze style, with "cell by cell" movement (like a pacman). The holes in this game have the same dimension that a sprite (22x22), the sprite should be able to pass throught theses holes, but it seems that the behavior is not be able to find a path.

  • Re Hi,

    I tried with the last beta version (120) and the problem is the same :(

  • Hello

    Ashley do you have some news about this ? have tested the capx ?

    Thank you.

  • It's just because the origins are in the centers of the object. That means every tile overlaps 4 cells in the pathfinding grid, blocking off all the paths. Putting the origin in the top-left aligns the cells with the pathfinding grid so it works.

  • waow, it's weird because I put them in center because at the top left, nothing works...at the same I had a value of -1. Have you got an exemple that works, like a capx may be I will make something wrong (other than the origin) ?

  • waow, it's weird because I put them in center because at the top left, nothing works...at the same I had a value of -1. Have you got an exemple that works, like a capx may be I will make something wrong (other than the origin) ?

    That sample file of the sample standard install folder (what come with C2 when you install it) may help?

  • No, in fact I would like an example that show that my problem in fact is not a problem to see what is my mistakes. I'm not be able to use this pathfinding in a laby pacman style with wall and holes that are 22x22 px.

    But thank you to try to help me ^^

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