Announcement

Collapse
No announcement yet.

Pathfinding / NavMesh problems

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Pathfinding / NavMesh problems

    Don't know if this is the right sub-forum, but I couldn't find a more fitting one :/

    I've got some question about NavMeshes:


    1. Is it possible to give areas a cost-multiplier that can vary from agent to agent?

    For example: There's a bandit camp. The camp itself is not an actual obstacle, but moving through it is risky and should only be attempted when the way around is much, much longer. That means I don't want an all-or-nothing decision like "only go there when there is NO other way at all", but an economical decision like "only go there when the time saved justifies the risk". And I also need the area-cost to be selectively applicable, because a bandit doesn't care if he has to cross his own camp.


    2. A recast-NavMesh updates in the background without slowing down the simulation. But is it possible to change this behavior and make the NavMesh do all necessary updates at once, freezing the simulation in the meantime? This would be very useful after procedurally placing large objects in a level, or even building a level procedurally from nothing.


    3. I have read that NavMeshes for moving geomtry like platforms was high on the priority list (link). So, is it possible now? I can't find a way to prevent the NavMesh from constantly updating when objects are moving.

    #2
    I need answers

    Is this the wrong forum maybe?...

    Comment


      #3
      What if I have some sort of fire elemental that is immune to fire and a lava surface that should be marked as an obstacle for most units but not for the fire elemental? Is that possible at least?

      Comment


        #4
        You will have more luck on the C++ forums for implementation specifics like this.

        As for your question number 1. You can tag areas as "unfavorable" to navigate through. To do this, make a actor blueprint with just a box volume and add a "NavModifier" component. In there you can configure how agents would consider/assign cost to the area while navigating. For any actor with a NavModifier, the navigation mesh will construct a bounding box around it. That box is the affected area. I'm pretty sure you can make some nav modifiers only affect some agents but I'm not sure of the specifics.
        Journeyman's Minimap - Available on Marketplace - Forum topic - Video

        Comment


          #5
          Originally posted by Zhi Kang Shao View Post
          You will have more luck on the C++ forums for implementation specifics like this.

          As for your question number 1. You can tag areas as "unfavorable" to navigate through. To do this, make a actor blueprint with just a box volume and add a "NavModifier" component. In there you can configure how agents would consider/assign cost to the area while navigating. For any actor with a NavModifier, the navigation mesh will construct a bounding box around it. That box is the affected area. I'm pretty sure you can make some nav modifiers only affect some agents but I'm not sure of the specifics.
          How do I have agents consider area cost? All I see is 4 types of NavMesh modifiers to choose from and none of them is described as having a "cost". The closest thing is the obstacle-modifier, but since it only gets traversed when there is no other way, it doesn't help me in the scenario I described.

          Comment


            #6
            Basic example for the bandit camp:

            1. Create a new bp from class "NavArea", call it "navArea_banditCamp" for example
            -> inside the blueprint set the travel costs to higher than 0 ( play with the values to see what works best for you )
            ( alternative you can also override the travel costs in the nav query filter )

            2. Create a new bp from class "NavigationQueryFilter" call it "navQuery_avoidBanditCamp"
            -> inside the bp add 3 Areas: "Default", "Null" and "navArea_banditCamp" for "NavArea_Null set "is excluded" to true ( to completely disable navigation in that area )

            3. Place your NavModifier for the bandit camp in the level and under default set the "Area Class" to "navArea_banditCamp"

            4. Now when you call "Move To Location" or "Move To Actor" to tell your non-bandits where to move select "navQuery_avoidBanditCamp" as the filter class and they will avoid all areas that are marked as "navArea_banditCamp"

            Comment


              #7
              Originally posted by entart3t View Post
              Basic example for the bandit camp:

              1. Create a new bp from class "NavArea", call it "navArea_banditCamp" for example
              -> inside the blueprint set the travel costs to higher than 0 ( play with the values to see what works best for you )
              ( alternative you can also override the travel costs in the nav query filter )

              2. Create a new bp from class "NavigationQueryFilter" call it "navQuery_avoidBanditCamp"
              -> inside the bp add 3 Areas: "Default", "Null" and "navArea_banditCamp" for "NavArea_Null set "is excluded" to true ( to completely disable navigation in that area )

              3. Place your NavModifier for the bandit camp in the level and under default set the "Area Class" to "navArea_banditCamp"

              4. Now when you call "Move To Location" or "Move To Actor" to tell your non-bandits where to move select "navQuery_avoidBanditCamp" as the filter class and they will avoid all areas that are marked as "navArea_banditCamp"

              Thank you for that detailed answer! And by "avoid areas" you mean they will consider the cost, I suppose? I'm gonna try that soon.

              Comment

              Working...
              X