x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Dynamic NavMesh Generation not working in Packaged Project

Hello everyone!

I have come upon a rather frustrating problem which I am almost certain might be a bug. However I'd like to confirm that I didn't screw up somewhere along the way.

I have been generating NavMeshes on Runtime for a procedural dungeon. For this purpose, The runtime navmesh generation inside the project settings is set to "dynamic".

Upon spawning a room, the following code is executed :

 if (m_bNavigationNeedsRebuild) {
         // Build navigation
         FActorSpawnParameters SpawnInfo;
 
         FVector location = m_boxVolume->GetComponentTransform().GetLocation();
         FRotator rotation = m_boxVolume->GetComponentRotation();
         FVector scale = m_boxVolume->GetScaledBoxExtent();
         m_currentNavMeshBoundsVolume = Cast<ANavMeshBoundsVolume>(GetWorld()->SpawnActor(ANavMeshBoundsVolume::StaticClass(), &location, &rotation, SpawnInfo));
 
         UBrushComponent* Brush = m_currentNavMeshBoundsVolume->GetBrushComponent();
 
         Brush->Bounds = FBox(location - FVector(scale.X, scale.Y, scale.Z), location + FVector(scale.X, scale.Y, scale.Z));
         
         GetWorld()->GetNavigationSystem()->OnNavigationBoundsUpdated(m_currentNavMeshBoundsVolume);
         
         m_bNavigationNeedsRebuild = false;
     }

The rescaling of the brush happens in order to adapt the size of the navmesh to it's parent blueprint. This method works very reliably inside the UE 4.16.1 Editor. However, as soon as I package the game (Win 64x) all my AI Agents refuse to walk around. Typing "show Naviation" into the console reveals that there is no nav mesh, and "Rebuild Navigation" doesn't have any effect whatsoever.

Is there any possibility that maybe unreal ignores the RuntimeGeneration: Dynamic flag when packaging?

Best regards and thanks in advance for any ideas you might have.

Product Version: UE 4.16
Tags:
more ▼

asked Jul 07 '17 at 10:19 AM in Packaging & Deployment

avatar image

HppyDedPxl
6 1 3 5

avatar image DavidM Feb 14 '18 at 04:56 PM

Found a solution to this?

avatar image HppyDedPxl Feb 14 '18 at 05:24 PM

I found a workaround for it. It appears that if the packages scene contains at least one navmeshbounds actor that is not dynamically spawned it works. Also, the above code will invalidate any navmesh outside of the brushes boundaries so watch out for that, otherwise some ai‘s might get stuck when creating new nav meshed areas. I was lucky in that I only needed the nav mesh to work within the room the player was currently in, if you are dealing with bigger areas where traversal between dynamically generated chunks is wanted you will have to work from a single bounds object and change its size instead of spawning new bounds for each chunk. Hope that helps

avatar image DavidM Feb 14 '18 at 05:37 PM

Thanks! The moment I deleted a bunch of nav meshes they started building again - before that they just didn't do anything unless I moved them, but then only this one mesh built its paths and all the others didn't. Now I just cover large areas with one mesh instead of lots of little ones and it works. Strange though.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question