Jump to content
shadmar

Paint area of navmesh

Recommended Posts

If I have a island with water all around, my AI would run into the ocean.

It would be great if we could restrict navmesh to the area painted on the terrain, like a color or something

Share this post


Link to post

I'd be careful with that as you might have walkable ares to another close island that has waist high water only. I understand that's probably easier for you to do but it'll limit us some and won't be as flexible for the users.

Share this post


Link to post

We can always throw more caveats at Josh but the more you throw, the less likely it will be that someone else will also come across that specific scenario. If waist high water is walkable, I'd test for water height minus the waist height instead.

Share this post


Link to post

  • Make boxes around island with nav obstacle enabled.
  • Build navmesh
  • Hide boxes.
  • ???
  • AI will not go in water because there is no navmesh.

Share this post


Link to post

Yes, reepblue that is the workaround we will be using but it's far from ideal. This is the suggestion forum.

Share this post


Link to post

Actually, Source uses brushes to prevent navmesh building I'm sure you can just make an invisible brush with no collision, and set the obstacle mode to true and it'll work that way. This way, you don't need to hide anything. Just wish the brushes didn't have to be invisible as my old solution of using a transparent texture, then making it invisible during run time conflicts with GI building.

 

But, I agree, there should be a height limit in the navmesh builder or something. So I'm not saying that this isn't a bad suggestion, but it's not like there isn't other ways around this...

Share this post


Link to post

Given we have no donut csg trying to do this with the available csg brushes we have with a circle island would be a nightmare to work with. How would you do it? About 50 boxes? Give is a donut and then we can make a giant one around the island.

Share this post


Link to post

I would recommend a tube shape, but we do literally have a CSG doughnut shape available. :)

Share this post


Link to post

Menu item Create>Compound>Torus. There's also arch and tube. I'm using the beta though so I don't know if it's in the release version.

Share this post


Link to post

I just came across this issue too and I think discarding navmesh triangles would work for me (as Josh mentioned above). Any chance someone has some code to show how this could be done?

Share this post


Link to post

You have to know where the water is to do this and since the path finding is built into the leadwerks the only way to do that is to block the water with something.

Share this post


Link to post

I had to do this do for a strategy game with multiple islands.

  1. Make 1 giant csg box at the same height of the water going all the way down
  2. Check the navmesh obstacle option

Share this post


Link to post

@jen the navigation that comes in the editor doesn't care about water height. It only cares about is the area walkable. One way would be to have very steep drop offs of terrain in the water I suppose.

Share this post


Link to post

I had to do this do for a strategy game with multiple islands.

1. Make 1 giant csg box at the same height of the water going all the way down

2. Check the navmesh obstacle option

I considered doing this too but didn't try it yet. Knowing it worked for you, I'll give it a shot.

 

Still would love to know the code Josh suggested though; how to access and properly remove navmesh triangles. And bonus points if we can put the triangles back (didn't we have an issue with dynamic door navigation that that would solve?).

Share this post


Link to post

I considered doing this too but didn't try it yet. Knowing it worked for you, I'll give it a shot.

 

Still would love to know the code Josh suggested though; how to access and properly remove navmesh triangles. And bonus points if we can put the triangles back (didn't we have an issue with dynamic door navigation that that would solve?).

A quick test reveals the following show that this trick still works.

 

1. Place a box with its bottom on the ocean line.

post-45-0-37451800-1484162370.jpg

 

2. Make the box higher than any mountain, otherwise the terrain will create a navmesh going from the terrain to the top of the box.

post-45-0-83091000-1484162365_thumb.jpg

 

 

3. Generate navmesh and tada: shoreline. note that you still have a navmesh on the ocean floor, but the agents can't reach it.

post-45-0-72669700-1484162362_thumb.jpg

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...