Pathfinders chosing longer path

0 favourites
  • 11 posts
From the Asset Store
Move around the rectangular and travel as much as you can!
  • Problem Description

    When You got simple path from A to B. Pathfinders chosing longer road to target. They trying touch bottom obstacles.

    Attach a Capx

    https://files.fm/u/442s85jc

    Description of Capx

    Simple Pathfinding from C2

    Steps to Reproduce Bug

    • Trying to change Pathfinder Cell size, borders and diagonalis
    • Trying to change events for Pathfinders creating

    Observed Result

    Nothing helps

    Expected Result

    Pathfinders should chose shortest path when have simple road from A to B. In many games it's compulsory.

    Affected Browsers

    • Chrome: (YES)
    • FireFox: (YES)
    • Internet Explorer: (YES)

    Operating System and Service Pack

    Win 10

    Construct 2 Version ID

    C 255

  • The project looks like it's working correctly. What exactly were you expecting to happen instead?

  • The project looks like it's working correctly. What exactly were you expecting to happen instead?

    Ashley This is a serious problem, since he has been in C2 for many years.

    When you have a game: the ambulance must quickly reach the patient because he is dying. You collect improvement points to buy a better ambulance. In the end, you buy the best ambulance and you have an alarm that you need to get to the patient quickly.

    And here? The ambulance has a straight line from points A to point B, and goes as if point C exists. This is bug as hell.

    If there is a straight path from point A to point B, Pathfinders should follow this straight path, not longer path.

    Please, fix this error or add choice: shortest path or normal.

    Thank You!

  • The pathfinding behavior works on a grid. This means it works in terms of diagonals and straight lines. This is a fundamental aspect of its design that means it generally won't pick direct lines to the destination; it will break it up in to a series of steps along a grid.

    This is exactly how it's designed to work so closing as won't fix.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ashley

    I can not agree. Because of the demo instruction in the game "Pathfinding demo" object moves straight from point A to B. This is because it is triggered by clicking a point. It's a similar situation, but it works properly.

    It is damning that there is a bug. When nobody performs this function (as in a demo), then there is this mistake and Pathfinding chosing this longer path.

    If you disagree, please write how to make Pathfinder move as in the DEMO game. Thanks!

  • If there are no obstacles anywhere nearby (in a bounding rectangle between the start and end), then it does take a direct path. If there are any obstacles anywhere nearby, it uses the pathfinding grid. This is all by design. It cannot take a direct path when there are potentially obstacles in the way.

  • Ashley

    It's not like that

    I made a short video to explain it. This is very important, because old "Desktop Tower Defense" uses the fact that Pathfinders go the straight path. This is an old rule that is broken in C2.

    https://youtu.be/pOY0uj8n0Y0

  • It is like that. I wrote the pathfinding behavior. I'm simply describing how it works.

  • It is like that. I wrote the pathfinding behavior. I'm simply describing how it works.

    Ashley

    Ok so maybe we can ...fix, diversify this. Because we can't make simple game like Desktop Tower Defense game from 15 years ago.

    What You think?

  • The pathfinding behavior was released over 5 years ago and as far as I can remember, you're the first person to ask about this, so I'm not convinced it's a serious issue. If you want to suggest a change or new feature we have a suggestions platform here: https://construct3.ideas.aha.io/

  • Yes Ashley, I agree with you, I'm surprised that no one has ever reported it. I think that the reason is that people usually play old patterns, where Pathfinders move only on paths (to the castle).

    For me, it is similar to the "Desktop tower defense": pathfinders have an open gap. Limits only Obstacles, who are far away.

    Maybe this is not much work, it would be an option for patfinders to move like in Demo C2 (after showing them the way they go straight and do not come close to Obstacles.)

    Yes, I agree with you, I'm surprised that no one has ever reported it. I think that the reason is that people usually play old patterns, where Pathfinders move only on paths (to the castle).

    For me, it is similar to the "desktop tower defense": pathfinders have an open gap. Limits only Obstacles, who are far away.

    Maybe this is not much work, it would be an option for patfinders to move like in Demo C2 (after showing them the way they go straight and do not come close to Obstacles.) Maybe it's only 3-4 changes in the code.

    Someone did it in demo, but it does not work in case pathfinders are produced by Spawmer.

    I hope someone could help. Nobody played "Desktop Tower Defense"?

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