Home Forums General Discussion Is there any way to manipulate NavMeshes?

Tagged: 

This topic contains 4 replies, has 3 voices, and was last updated by  prime 5 days, 1 hour ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #6642

    Neji107
    Participant

    Let’s say I didn’t like some areas of how my NavMesh came out. What options do I have? Is there any way to edit or remove particular areas of the NavMesh?

    Also, let’s say before the NavMesh calculation that I decide to exclude a certain area of the map (i.e. a pond that the AI should avoid walking into). How would I go about making sure this area is excluded? I have tried this:
    - Putting placeholder giant Cubes in the pond area with a collider so that it is treated as an “obstacle” in the NavMesh. However, the NavMesh will generate walkable areas on top of the Cube and sometimes hanging off it to the ground, which is a bit funny. Adding the Cube’s tag to the NavMesh “Unwalkable tags” seems to have no effect. Is there a way to prevent the NavMesh from generating on top of an object, but still treat it as a general “obstacle”?

    #6648

    prime
    Keymaster

    We have plans to add support for manual navmesh editing, but it isn’t there yet. Usually you can correct issues either by changing your navmesh parameters or by adding/modding the colliders in that area.

    You can exclude areas using tags to mark the areas you want to have ignored, then add those tags to the unwalkable list on the navmesh. The placeholder cubes you are using should be working as you expect - you mentioned this isn’t working for you so I’ll go check it later today and make sure we didn’t introduce a bug in a recent build.

    Sounds like you are on the right track though. I’ll follow up in a bit.

    #6651

    Iuxeayor
    Participant

    I wonder if there is an actual problem with there being a “walkable” area on top of the Cubes. Are you worried that the AI might try to reach the top and then walk around? Perhaps dropping the height of the NavMesh generation area below the top of the Cubes might help. Unless, of course, there is more terrain that needs to be included and is much taller than the Cubes.

    • This reply was modified 5 days, 16 hours ago by  Iuxeayor. Reason: Clarification
    #6658

    Neji107
    Participant

    Thank for the replies! Btw I have the latest version 2.0.9. I will double-check but here’s what I have found, in response to prime and luxeayor:

    prime: When you say mark the areas “ignored”, do you mean uncheck those layers from the NavMesh? Or mark their tags as both in the Ignored Tags list and the Unwalkable Tags list? I believe I tried both these approaches but no luck.

    luxeayor: Yes, generally that is the case I am worried about. I am wondering in the tutorial example where we have the soldier wandering to randomly generated places, what happens if his target is in a place he cannot reach? Secondly, it seems that a NavMesh will be generated over any object that is even partially contained in the NavMesh boundaries. I extended these placeholder cubes to be far over the height, but it still generated walkable areas on it.

    #6663

    prime
    Keymaster

    I just mean that the places you don’t want walkable can be excluded by adding their tags to the unwalkable list. Don’t add them to the ignored tags list - just to the unwalkable list.

    - As for the soldier wandering to places he can’t reach - the latest tutorial file should be doing a check to make sure there is a valid graph connecting the ai to the target position. This doesn’t do a path check though, just a check for a shared graph.

    - Correct, the recast bounding box does not clip colliders that overlap in the y axis, even if they extend well outside (above or below) the recast area. Your approach of making these colliders unwalkable should do what you want though.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.