How do I use multiple pathfinding obstacle maps?

0 favourites
  • 5 posts
From the Asset Store
Obstacle Impacts and Cartoon voices, will makes your game more funny!
  • Is this possible yet? I looked through a bunch of posts, and the only hope I could find is that it was a potential update for C3.

    I have an "Underground" layer in my game, and the pathfinding obstacles in the lower layer is affecting the enemies in the top layer. The closest I got was spending 8 hours givign each enemy multiple pathfinding behaviors, in hopes each would save their own map, but this proved incorrect

  • You probably have a lot of locations that are on top of each other and you disable different layers to show these locations? This is an archaic and inconvenient method, it's much easier to have a location nearby and just move the character there when descending to a new level....

    In your case, you don't need multiple obstacle maps. You need to add new objects to the obstacle map when descending to a new floor, and recalculate the obstacle map.

    This all sounds confusing, I think a small example with two floors would help explain it better.

  • The obstacle maps are based off of square size and buffer size. If you have a unique square size (32x32) vs (30x30) or buffer size (-2 vs -1) for example they will record into a separate maps. Giving the map a different name doesn't make it different.

    yours

    winkr7

  • You probably have a lot of locations that are on top of each other and you disable different layers to show these locations? This is an archaic and inconvenient method, it's much easier to have a location nearby and just move the character there when descending to a new level....

    In your case, you don't need multiple obstacle maps. You need to add new objects to the obstacle map when descending to a new floor, and recalculate the obstacle map.

    This all sounds confusing, I think a small example with two floors would help explain it better.

    This is all accurate, I guess I could move everything to the main layer, but I will need to bound the camera to the size of the main map, then let it unbound when the player's go to the underground (which will be off the visible main map).

    "The obstacle maps are based off of square size and buffer size. If you have a unique square size (32x32) vs (30x30) or buffer size (-2 vs -1) for example they will record into a separate maps. Giving the map a different name doesn't make it different."

    I saw this from another post, but couldn't get this to work. If I could change the buffer size on creation of the enemy, then maybe I could get this to work, but it doesn't look like there's an option for that. I think my best bet will be to move everything to one layer instead of overlapping assets. Very unfortunate that C3 doesn't have more flexibility with the obstacle maps/pathfinding.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I used two pathfinding behaviors for the enemy type. Pathfinding & Pathfinding2

    I set the cell size on 32 for both, and set buffer size to -16 and -14.

    I set different obstacles for each, and only have one turned on depending if the enemy is flying or not. when the pathfinding is turned on it looks for obstacles depending on the pathfinder used. This generates two different pathfinding maps. But like Ashley said, this is kind of a hack.

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