I’m currently working on a project that involves making AI characters for underwater creatures or flying creatures(as it works pretty much the same). I’m facing some challenges with setting up a 3D NavMesh to enable navigation in these environments.
Specifically, I’m looking for help on how to create a NavMesh that allows AI characters to navigate freely in 3D space, either underwater or in the air. While the default NavMesh works well for ground-based navigation, I’m struggling to extend it to 3d movement requirements of swimming or flying AI characters.
Here are some specifics:
How can I configure the NavMesh to cover the water volume for swimming AI characters? I want them to be able to navigate from the ocean floor to the water surface.
What modifications should I make to the NavMesh generation settings to account for swimming or flying movement? Are there specific properties or parameters I should adjust to ensure accurate navigation in 3D space?
Are there any additional steps or considerations for implementing obstacle avoidance within the 3D NavMesh? I want to ensure that the AI characters can detect and navigate around obstacles in the water or the air.
Are there any recommended best practices or resources for implementing custom movement logic for swimming AI characters within the NavMesh system?
I would greatly appreciate any tips, or help that you can share to help me with these challenges.
Instead of relying on a navmesh I’d just work the AI directly.
Have the actors check 1m sized cubes for accessibility all around them in an Octree fashion.
Base / or change their move to from the results.
For things that go fast, you don’t check 1m ahead but speed ahead, so you can code in object avoidance, turns, etc.
The premise of any AI system is the base action. what are these actors doing in the first place?
Chasing a player? You already have the initial move-to, you just need to avoid obstacles.
This process can get problematic when you deal with infinite options.
For instance, do you go up or down when you come to a cliff’s face?
To evaluate it you can do several things;
Assuming the AI entity “knows” you can just pick the right way for them (this is normally predicated on the player’s movement that occurred beforehand. You just follow the same points he did).
If the AI cannot know but you want it to know you just test and keep testing anvolume in blocks around them to get the first avaliable path returned.
The AI entity might have to sit there waiting for an answer when you query a cliff face that’s 1000m but by that time as you’d get an answer most decent AIs will have changed behaviour anyway…
(Consider this as 9 cubes of a 1m^3 size that cover the immidiate front of the character. If you pan those checks up or down in 3m increments you get a fairly decent idea of what the geometry in front of the AI is doing)