Jump to content

#21
jen

jen
  • Members
  • 229 posts
can't you program the ai to not go into the water.

#22
Rick

Rick
  • Members
  • 7,040 posts
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.

#23
jen

jen
  • Members
  • 229 posts
you can detect water height, it's the same value around the island.

#24
AggrorJorn

AggrorJorn
  • Members
  • 3,669 posts
I had to do this do for a strategy game with multiple islands.
  • Make 1 giant csg box at the same height of the water going all the way down
  • Check the navmesh obstacle option


#25
Rick

Rick
  • Members
  • 7,040 posts
@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.

#26
gamecreator

gamecreator
  • Members
  • 1,875 posts

View PostAggrorJorn, on 11 January 2017 - 02:22 PM, said:

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?).

#27
AggrorJorn

AggrorJorn
  • Members
  • 3,669 posts

View Postgamecreator, on 11 January 2017 - 05:48 PM, said:

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.
Attached File  save1.JPG   18.27K   0 downloads

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.
Attached File  save2.JPG   25.74K   0 downloads


3. Generate navmesh and tada: shoreline. note that you still have a navmesh on the ocean floor, but the agents can't reach it.
Attached File  save3.JPG   63.32K   0 downloads

#28
jen

jen
  • Members
  • 229 posts
you can program the ai to stop walking or turn around when it reaches a point below a certain height.

Posted Image