Why is this pathfinding issue happening?

Not favoritedFavorited Favorited 0 favourites
  • 4 posts
From the Asset Store
Units do not overlap each other and use different ways if there are several free ways.
  • I'm trying to make an electrical circuit puzzle for my game. I had come up with a solution, but it used straight brute force (I literally checked the angle of every circuit to make sure they were all facing the right direction). I decided to try and make this more elegant, and ended up on a pathfinding system where the "electricity" actually has to reach the end target. However, I'm now running into an issue where obstacles apparently appear for no reason (at least according to my map), and I have no idea why or how to fix it. Any help would be much appreciated.

    A screenshot of the puzzle in-editor (the green squares are circuit spawners and the two small grey boxes on the right are the targets). The "electricity" (the pathfinding object) spawns in the upper left corner, just above the top-left circuit spawner.

    The puzzle in-game which has been partially solved (there is a clear path from the start to the first/top target)

    The same puzzle shown above, but with my obstacle map active. You can see in the upper-right corner of the puzzle, there are obstacle indicators blocking the electricity's path, even though there shouldn't be any obstacles (the gray boxes) in the way.

    Below is my code.

  • Oh also, forgot to mention, I did change the x and y values for the map creator to fit my viewport size, though I'm still experiencing the same problem.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I would try tweaking the pathfinding grid. There are pictures in the documentation explaining how it works:

    construct.net/en/make-games/manuals/construct-3/behavior-reference/pathfinding

  • Thank you, I've been tweaking it, and though it isn't perfect yet, it's getting closer!

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