[4.5] Navigation Mesh Rebuild At Runtime causing 20-40 fps loss in 4.5 only

#Final Repro Step

final step of repro is to spawn static mesh actors that have CanEverAffectNavigation to true, on same ground plane as player unit!

Here I have a Level BP that can be used to test this!

Again I used a static mesh standard cube from starter assets of third person template, and scaled it by 10 as its own blueprint, and then spawn that blueprint on key press.

My fps drops by about 30 in editor via PIE each time I press P key, until local changed component of Nav mesh gets to rebuild itself.

Please note I am using default Navigation Mesh settings, though I tried turning Voxel simplification on and off without any noticeable change in behavior.

This drop of 30fps each time I press P key is issue I had with my game that caused me to revert to 4.3, because in my game new actors that affect navigation are created relatively frequently, and I was therefore always losing 30 fps that I was not losing in 4.3

#FPS Drop At Game Start Reproed in Test Project

Each time I start game, even in PIE, fps drops by 30 for at least 10 seconds while nav mesh rebuilds (4.5 only).

This is easy to observe even without making my level BP above + static mesh actor blueprint of cube actor scaled by 10.

#:heart:

#I have a Sample Project For You &

Dear and ,

Here is a fully functional sample project of <50MB download which demonstrates issue!

#Once You Download

  • in editor PIE you can go in game, and observe fps drops by a lot while nav mesh is rebuilding, as low as 30 on first build

  • successive rebuilds at runtime averaged a loss of 30 fps for me on my computer, if your computer is super fast you may have to make nav mesh bigger.

  • You can press P key to repeatedly spawn colliding Static Mesh Actors 512 units from player unit, which on my machine cause a loss of 30fps until nav mesh finishes rebuilding

Again if your computer is really fast you may need to make my sample nav mesh bigger!

Let me know how your tests with my sample project go!

#Download Link Again, < 50 MB

Copy will tell you folder is read only, dont worry, just find download button and it should download just fine :slight_smile:

#:heart:

Thanks a lot, . Grabbing it now.

–mieszko

You’re welcome!

Let me know how it goes!

I’ve just repro’ed everything I discuss above several times, it happesn quite reliably, only variance now would be your computer’s specs vs mine, and a bigger nav mesh should resolve that.

Good luck!

#:heart:

#Before 4.6?

Oh please oh please I hope this Nav Mesh fix can make it in before 4.6, because I dont want to be stuck on 4.3 while everyone else is using 4.6

Thanks!

#:heart:

,
Unfortunately it’s non trivial to figure out what’s causing issue. We’re working on it.

–mieszko

I am wishing you best!

If I can be of any further assistance let me know!

#:heart:

Just a quick update, it seems we’ve nailed it down. Now we “just” need to find a proper fix :wink:

–mieszko

#Woohooo!

Congratulations!!

See next post!

#:heart:

2537-rainbow.jpg

#4.6?

Do you think this fix, once you’ve fully formulated it, will be available in 4.6?

I am so excited to get all benefits of 4.5 and 4.6 combined and move on from 4.3!

I hope you are having a lovely day!

#:heart:

Issue nailed down and fixed (CL#2343690). 4.6 will contain fix. Turned out to be “cosmetic” - NavmeshRenderingComponent was gathering navmesh data to be drawn over-zealously, even when navmesh was not being drawn.

Good news is this bug does not affect cooked builds at all.

A local quick-hack-fix would be to comment-out internals of UNavMeshRenderingComponent::GatherData, but that will result in disabling navmesh drawing. Alternatively you can check GIsEditor to have navmesh drawing only in editor.

Sorry it took so long!

Cheers,
–mieszko

#Thank You!

Wohoo!

Thank you!

And thank you for quick fix that I can do right now to my Github engine in 4.5!

You are a Hero!

#Your Victory Confirmed

I can confirm that fix you gave me does completely resolve 20-40fps drop I was observing in my own 4.5 project!

You did it!

Great work!

#:heart:

2537-rainbow.jpg

To be honest Łukasz Furman did heavy lifting. He’s your go-to-guy when it comes to navigation.
Glad we could help!

–mieszko

#Thank You Lukasz Furman!

#:heart:

2537-rainbow.jpg

Is there a fix that wouldn’t require hacking engine source?

fix should be in 4.6 and later builds.

How would I enable fix? Because I still see problem in 4.8

I can verify by following 's repro steps on a blank project in 4.8. And same FPS drop behavior is observed.

Hi ,

Can you open a new answerhub post on this? There have been significant changes to navigation system so bug you are seeing may be completely unrelated to this thread. In it, please describe what specific drop you are seeing is, when it is occurring, and what steps you are taking to reproduce error. Please include if it happens in a clean, blank project with no additional content. Thank you!