Pathfinding and Tilemap Collision

0 favourites
  • 7 posts
From the Asset Store
Units do not overlap each other and use different ways if there are several free ways.
  • I have a problem with Pathfinding .

    I have a Tilemap on Construct 3.

    I've set that only cells in the perimeter of the Tilemap have collisions enabled.

    When I ask the character to search for a route, sometimes the result of the destination is a block with active collisions.

    My thought is that the character when looking for the path should avoid blocks with active tilemap collisions

  • check if the properties of the object with the pathfinding are solid or custom, if solid check if the tilemap has the solid behavior, if customizable make sure to start layout add the tilemap as an obstacle and use the regenerate map action.

    PS: the re-energize obstacle map action must be used only once because it crashes the game because it is heavy.

  • Thanks for the reply.

    I'm doing some tests.

    I need to use more tilemaps inside the layout.

    for each layout I put a character that looks for the random path.

    only the character in tilemap 1 seems to recognize its collisions.

    Why'?

    maybe Construct 3 doesn't support pathfinding handling more than screen-aligned Tilemaps?

    I attach the file

    Thanks

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello, pathfinding obstacles are GLOBAL, that is, 1 object is defined as an obstacle for all pathefinding behaviors in the game (even if in different objects, such as player 1, player 2, and player 3).

    in the image of the events you sent, you are defining the obstacle several times, one for each player, you should use an event, (start layout=player1, player2, player3 or player family define obstacle)

    and the obstacle must be a family with all these tilemap inside)

    PS: an extra, the physical behavior also uses gravity in a GLOBAL way, what you define for an object will affect everyone in the same way.

  • HERE IS AN EXAMPLE TO HELP YOU.

    drive.google.com/file/d/1lxxnJgkuuBPVYT75rgoAdeh9nJwDJlzL/view

  • I think this part of the documentation explains it:

    -you need to use regenerate obstacle map after adding an obstacle

    -the obstacle map is not per instance

  • thanks to everyone

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