Losing alignment with pathfinding

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

    my son is doing his first steps with Construct, it is a very nice tool. He started with building a small tower defense game. At the moment we are struggeling with an unwanted effect when using pathfinding and despite reading all the docs and comparing to the turret defense template, we were not able to fix this.

    As you can see on the screenshots (it seems I am not allowed to attach the project file here), his ballons start to follow the track, but at some point they leave it. The layout is using a timemap with 64x64 tiles. The cellsize is 32. I have compared our project to the turret defense template where the enemies perfectly follow the path, but I couldn't figure out what is different in concerns to the pathfinding.

    Would be great if anyone could shed some light on what we are doing wrong.

    Thanks for your help. It is highly appreciated.

  • Here is the project file showing the problem: dropbox.com/s/i0fbnl8hnek0inv/ballons.c3p

  • Nobody able to help with this? Cannot imagine that I am the only one with this problem.

    I am out of ideas how to fix it. Even rebuilt the map with 32x32 tiles match all the sizes and settings from the turret defense template, but still the pathfinding behaves very differently.

    Wish, Construct had something like Gondor’s path tool. Would make things much easier in cases like this one.

  • I guess this can be closed now. Did not find a solution and nobody seems to able to help.

    I must confess this is quite a disappointment. Did not expect to hit such a problem with Construct so early - with no solution. Had hoped it can provide an easier access to development, but getting no help when encountering problems, well, that‘s a show stopper.

    Going ruefully back to Godot now.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • There's a few issues here. Your pathfinding grid wasn't lined up with your tilemap solids, and they were different sizes. For exact tiles, you'll want to use a -1 cell border size. Set the pathfinding cell size to 64, the same as your tilemap cell size. Make sure your tilemap origin is at 0,0, to align with the pathfinding grid.

    For moving to waypoints without cutting corners, you want to use the MoveTo behavior's 'Move along Pathfinding path' action, instead of the Pathfinder behavior's 'Move along Path' action. The pathfinder behavior will start turning right when it reaches the edge of the waypoint cell, while the moveto behavior will move to each waypoint location. The example project has a turning radius that takes exactly half a cell to turn 90 degrees at the speed it's going, which is why it works.

    There is no need to update the path for each object regularly as you had in event 2, this can also contribute to cutting corners.

    See updated example here - dropbox.com/s/e5601def28z8zeb/ballons.c3p

    Edit - It's unfortunate no one helped you for so long, these forums are usually pretty responsive. Personally I usually look for posts that don't have replies to reply to, so I might have missed it when you replied to yourself, thinking you already got an answer.

  • I thank you very much for your reply - it is highly appreciated. Will try your suggestions and have a look at your updated file.

    Would be very nice if we can make this work. We went back to Godot and rebuilt what we created in Construct, but GDScript - despite being a quite nice language - is not easy to learn for my son (11 years old). Construct would provide a much easier approach.

    Thanks!

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