1
\$\begingroup\$

For my swimming AI, I wish to use a Nav Mesh, so they may avoid obstacles and swim up and down - preferably.

I figured I should try to solve this with a nav mesh, since UE4 has kindly implemented it for us.

To avoid having the Enemy Fish stick to the "ground" of the map, I would have to increase the Query Extent, which is testable with a Navigation Testing Actor (see images below).

So what I did:

  • Add Nav Mesh Bounds volume;
  • Add AI Actor with Character Movement Component;
  • Increase Default Query Extent in Project Settings (Engine > Navigation System).
  • No Profit?

Increasing the Default Query Extent, under Agents, increases it along the positive and negative Z-Axis, which is unfortunate, since I would like the AI to prioritize the bottom Nav Mesh surface.


I have attached two screenshots showcasing the "bad" behaviour, which I would like to circumvent.

The blue Bounding Box, showcases the Extent, which is scaled in both directions, vertically. Preferably, I would like to move it down, relative to the Nav Agent.

The blue bounding box is the Extent

To hit the point home, here is what happens when the enemy swims underneath some platform (For simplicity, being the cube):

Bad behaviour of Default Query Extent

So my question to you good people is: how would I lower the Nav Mesh detection, without increasing the actor size, or something rather silly. Is there a clean way of having the "Enemy Fish" ignore the top platform as much as possible, without using a Nav Modifier Volume ?

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

Unreal allows for several Nav meshes to exist in the same space. Look into the Project Settings, to try defining a different "swimming" AI nav for each fish.

Let's say you have a mackerel and a whale - both aquatic animals, both in the same space. However the mackerel can get into smaller spaces than the whale. If you use a single navmesh for both, either the mackerel will stick to open waters or the whale will clip into places it should never reach. The solution is to define a separate nav mesh for each animal.

This is where I would begin. Additionally, ask the question "Does the nav need to be walkable or can it be a 3D space for flying?" Walkable space is effectively a planar structure (visually), whereas a flying space is a volume.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Thank you for the advice, although I am afraid UE4 doesn't support volumetric nav meshes, or rather the Bounding Box itself is volumetric, but it calculates a plane for the AI to move on. So the only sane solution is to pretend the Fishes are anchored to that plane. \$\endgroup\$
    – Byrk
    Jun 11, 2017 at 16:47
  • \$\begingroup\$ Thats right, NavMesh is not meant for flying/swimming. \$\endgroup\$ Apr 28, 2019 at 12:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .