Pathfinding in multiple layers

0 favourites
  • 3 posts
From the Asset Store
Units do not overlap each other and use different ways if there are several free ways.
  • The pathfinding page makes no mention of how the Pathfinding behavior handles multiple layers. Does it keep a separate grid for each layer of the game?

    If I add two instances of an object with the behavior to different layers with different obstacles, how will they behave?

  • I think the layers are just the visual aspect, for having objects displayed above others. Objects can still interact with each other on other layers to my understanding.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I was under the impression that the pathfinding grid would only take the solids in the same layer into account. It would make sense from the way the manual is written that the pathfinding object takes all solids when building the grid. That will complicate things. I need the ability to have seperate pathfinding grids. Think about the different floors of a house, each can have people moving around, each with different object arrangements.

    I suppose I could create a different object with the pathfinding behavior for each floor, and give each slightly different pathfinding values so they are tracked separately. The pathing is based on a tilemap, so I could just add the tilemap for each floor as the obstacle for that floors pathfinding behavior. Add each object to the character container and pin the character to it, then just call the object that matches the floor the character is on to move the character with pathfinding specific to that floor. It should work, but will make adding single objects more complicated since there is no action to remove a specific obstacle, I guess I could keep a list of every obstacle for each floor and if one is removed, remove it from the list, wipe the pathfinding obstacles and readd them all on the list. Should be able to get away with only rebuilding the area of the grid that was effected. If its alot of objects then the removing action could start to get expensive.

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