Navmesh of SubLevel?

I’m having a very hard time solving this (what should be) simple issues.

Problem
I have a world that looks like this

Persistant World (Main)
–Sublevel (One)
–Sublevel (Two)

I’m loading the persistant world which then loads sublevel One. Sublevel one contains a nav mesh and a simple AI character who attempts to find and move to the player.

The events are firing, but the AI can’t seem to find the navmesh or even move. It keeps telling me that the navmesh needs to be rebuild but I’ve done it a number of times. I turned on other features like : Fixed Tile Pool Size but still no luck.

I know for a fact this works because if I load up sublevel One directly and play, the AI and navmesh work.

TL : DR
How do I get navmeshes in sublevels to work properly when using a persistent world?

Hi,
To make your setup work, you will need to place Navmesh bounds volume in the Persistent level instead of sub-levels. Delete all Recast actors and navmesh bounds from sub-levels, place navmesh bounds volume in P-level and set ‘Runtime Generation’ on Recast actor to ‘Dynamic’. This way whenever you stream-in or stream-out sub-level navmesh will be regenerated.

4 Likes

Thank you ddvlost. This is the single best answer for this question I have seen! Not only does this solve the problem but explains the reasoning!

Is there a list anywhere that mentions what objects are recommended or required in the persistent world vs the sublevels?

As a side note. I noticed while playing around that it seem to work if the navmesh volumes are in sublevels so long as the recast actor is in the p-world? Is this expected?

Is there no way to stream in a pre-built NavMesh along with a level? I also have a persistent level that is almost empty, a huge world map and smaller scenes that represent locations on the world map. My plan is to stream out the world map when the player enters a location and stream in the location’s scene (and the other way around when he leaves the location). Re-building the world map’s navigation data takes minutes… is there no other way?

If I place the AI and navmesh in the persistent level it works. If I place both in a sub level, it doesnt work. If I place the AI in the sub level and the nav mesh in the persistent level, it also doesnt work.

Done

I tried to look up what a Recast actor is without much luck, could you explain? The only thing I have in the sub level is the ground and the AI character that will walk on the ground, the nav mesh is in the persistent level.

I placed the navmesh bounds volume in the persistent level.
I’m not sure what you mean by setting runtime generation on the recast actor to dynamic. I have runtime generation set to dynamic for navmesh in the project settings but it seems you mean something else.

Any help would be greatly appreciated

Hi there, it seems this is an old post but i just stumbled upon it…

I had the same problem… no matter what i did it just doesnt work my navmesh from level streaming… i put both navmesh and recast to persistent level with no luck at all, and try every single combination and still no luck… i think its just doesnt work that way…

Anyway… i found a workaround…

I dont use level streaming anymore i just open level…but still doesnt work…

If i place my navmesh in the level im loading, recastnavmesh always rebuild in persistent, this way doesnt work either, but if you place a console command “RebuildNavigation” in the level BP that you want to load it rebuild navmesh by force and make it work!!

But this comes at a cost… because you are rebuilding by force, the load time is longer…

Did you found a solution using level streaming? i really want to use level streaming instead of open level :frowning:

I ran into the same problem with my project, i tested it with a empty persistent level that only contains the navmesh volume and the recast actor.
The sublevel contained geometry and gameplay actors. After setting *Runtime Generation * to Dynamic on the recast actor, it worked fine.
You can also use navmesh modifiers or link proxy’s in the sublevel. If you then test your AI with simulate, you can see the navmesh being rebuild to fit the sublevel.

I’m faced with the same problem.
If I set Runtime Generation to Dynamic on the recast actor, it worked fine.
But I don’t want to dynamic generate nav mesh data. It requires a high cost.
Is there a another way to solve it?

Hi, that worked. After sublevel was streamed game gets frozen waiting until navmesh being built.
But how we should test sublevels now? open sublevel and create NavMeshBoundsVolume every time and don’t forget to delete it after work is done or it will not work with streaming.
You should understand this is not an option. Navigation data should be saved along with level itself.

Was having this issue in 4.18 also the fix worked for me placing everything in P-Level then setting recast to dynamic.

Having the same issue. But only happens after packaging the project it works just fine in editor. any one have a clue of what could be happening?

No one mentions this anywhere except for one obscure forum post that I just happened to find after searching for weeks: Not only do you need a master nav mesh in P and set recast to dynamic, but you also must have a nav mesh in each level you want to stream in.

, you wrote you found a real solution - would you mind sharing this with the forum?

Same here, any best-practice solution? Have the same problem with the cost. When i set recast to “Dynamic” i have 12ms more game time. My Nav Mesh is big and need to be it…

Got it:
You don’t need to set it to Dynamic, this couse a huge fps drop.
Just setup two NavMeshBounds, 1 into you Persistant Level and 1 into your Level Stream.
I do so by just copy/past my NavMesh and use STRG+M to add the copied one to my Level Stream.

Works fine for me :wink:

Okay this is just silly now…one way works! No that way don’t work…but this way works! No but this way don’t work…which is it then? I guess you just make a checklist and run down it until you find the one that works for you. Brilliant. The only one I haven’t tried yet is the way did it. Here’s hoping that’s it…

Did you change any other thing in the recast nav mesh? Did you check memory consumption as well?

Works for me too (in editor, haven’t tested on packaged game)

Just follow this answer without any dynamics and automatics.

I have two levels one is the multiplayer level where its the starting level for hosting or joining a server and there’s no content, it is just an empty level simply for generating the starting screen for my game nothing else, and the other level is the main or first level where most of the content is and all the AI bases and all that stuff. In main level I also have a navmesh. The multiplayer level or world is the first world that will open because it will open the starting screen and whenever I host a server it opens the main level. But the thing is whenever I open it it always show the navmesh error message aka “navmesh needs to be rebuilt” so basically whenever I open my main world through my first world which is empty and simply for the start screen my AI won’t move cuz of the navmesh error can someone help me with this so that my AI could move again whenever I open the main level.