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

Dear Friends at Epic

When I upgraded to 4.5 I noticed I was getting a loss of 20 frames per second over how my game played in 4.3

I narrowed it down to Rebuild at Runtime for Navigation Mesh!

In 4.3 my game runs at a solid 90

in 4.5, any time nav mesh rebuilds, my fps varies from 80 down to 70s, or lower if many new actors are spawned frequently

#Rebuild At Runtime is Killing Performance in 4.5

Please address this.

#Clarity

I am indeed stating that just by upgrading from 4.3 to 4.5 I have lost 20fps on average, only because of Rebuild at Runtime feature of Navigation meshes.

This feature worked great in 4.3

Please figure out what changed!

I’ve done what I can by narrowing down loss of fps for you, please take it from here.

#This is going to Hurt Everyone and also Fortnite

Any game that needs to rebuild nav mesh at runtime is going to lose 20 fps or more (in my experience it is way more as more actors are rapidly spawned) !

#This must be fixed!

Thanks!

#Repro

  • Make a large level with a very large nav mesh
  • project settings-> nav mesh → rebuild at runtime

Reload editor, and make sure the “building navigation” message lasts at least 10 seconds

  • construct a reasonably complex scene that takes fps below max on your machine

  • do this in 4.3 and in 4.5

  • observe difference in FPS while nav mesh is rebuilding itself in 4.3 vs 4.5

  • create some actors during runtime via key press, in 4.3 and 4.5, that have CanEverAffectNavigation set to true

Result = endless loss of FPS in 4.5 as long as you keep triggering navigation mesh to rebuild

So what this means for me is

#I have to revert to 4.3 until this issue is fixed

I can’t test actual fps drop of other game mechanics until this issue is fixed, and so I must revert to 4.3, because AI is stage of development I am most focused on right now.

#Urgent, I cant Use Future UE4 Versions Till This is Fixed

I had to revert from 4.5 because changes made to nav mesh system cause a 20-40 fps drop when nav mesh is rebuilding at runtime, a loss that does not occur in 4.4 or 4.3

I cannot use 4.6 either until this issue is fully resolved!

Most of projects I am working on require Rebuild At Runtime to be as optimized as it was before 4.5, I cannot admit a drop of 20-40fps due resulting limitations on rest of what I can do while keeping a decent FPS.

All I did was upgrade my project and I am consistently losing 20-40 fps when nav mesh rebuilds that I was never losing in my prior engine version which was 4.3 for project in question. I also tested 4.4 and did not encounter fps drop there either. It was mentioned in release notes that a lot of Fortnite navigation code got added in 4.5, and I can only presume that integration has something do with this sudden problem with Rebuild at Runtime.

I am bereft of all future UE4 updates until this Rebuild at Runtime issue is fixed, I simply cannot deal with resultant performance loss!

#I can absolutely verify that:

  • it was just upgrading to 4.5 that is causing fps loss,

  • and that it is indeed Rebuild at Runtime feature of navigation mesh system that is causing fps loss (turning Rebuild At Runtime off makes 4.5 fps loss go away.

  • even in 4.5, fps loss goes away once runtime rebuild finishes, but my game is constantly triggering rebuilds as new dynamically spawned colliding geometry gets added, and this was never an issue in 4.3-4.4

  • I can also verify that Rebuild at Runtime does not cause this FPS loss in 4.3 and in 4.4, even while rebuilding itself!

  • In 4.3/4.4 Rebuild at runtime feature performs perfectly, enabling my AI to navigate dynamically spawned colliding geometry immediately without any noticeable delay.

#Summary

In 4.5 only, Rebuild at runtime incurs a 20-40 fps loss that it does not incur in 4.3 or 4.4, and without any noticeable or necessary improvement to its functionality as compared with this additional performance cost.

Curious if this is only in editor, or if it is in a cooked build as well. Only other thing I can think to try, is doing an instrumented profile (Visual 's would be sufficient) on both and see where problem may lie.

Thanks for reporting this, . I’ll have our QA generate profile info for both engine versions and we’ll get down to fixing it.

Thanks!

–mieszko

Okay great, thanks!

Let me know how it goes!

And if you need any more info let me know any time!

:heart:

I was always test game from commandline and issue happens with editor closed, as far as packaging goes that is irrelevant to me because I need same high performance I had in 4.3 and 4.4 so I can test my game’s various features for performance issues while I am developing them :slight_smile:

Any update on this matter yet?

Not yet, sorry. Bumping priority on it now.

Thank you for super-fast reply!

#:heart:

Hi ,

I’ve been having a look into your Navmesh bug and came across something interesting. If you can, please open up a blank level on both 4.3.1 and 4.5 and press “Show FPS”. Are you seeing FPS drop you mentioned there? I believe this may be a general editor drop but if this is not FPS drop you are seeing please let me know so I can continue to try and repro it on my end. Thank you!

Dear ,

Great to hear from you!

I have indeed noticed general editor FPS drop in 4.5, however that is not test I am doing!

I am running my game from commandline, editor is closed!

Everything I have reported to you in this thread is only from perspective of a game run from commandline, and I have additional FPS issues in 4.5 in editor that take my FPS down to 30s in a very simple scene.

But please, let’s focus on Nav Mesh right now.

Please do my repro in a project that you run from commandline.

Here is a sample of the .bat file I use to test my project with editor closed:

"C:\Program Files\Unreal Engine\4.5\Engine\Binaries\Win64\UE4Editor.exe" "%CD%\JoyShapes.uproject" JoyShapes -game  -ResX=1280 -ResY=960 -WinX=0 -WinY=30 -Fullscreen=false -NoVSync -log

Note that %CD% makes this commandline work wherever you are running your test project from :slight_smile:

Hi ,

I tried as you suggested, however I received a 30 FPS drop (from 90 in editor to 60 through commandline) in every circumstance that I attempted. states I tried were:

  1. With Navmesh (Rebuild at runtime set to true).
  2. With Navmesh (Rebuild at runtime set to false).
  3. Without Navmesh.

There is a discrepency in FPS of about 30 FPS in every situation that does not appear in 4.3. Is this what you are seeing? If not, do you have a stripped down project that I can see error occurring?

Dear ,

commandline version of game is usually locked to 60 fps, so what you are seeing may just be default frame rate cap

If you go into

Project Settings->General Settings-> and look for frame rate cap, what is yours set to?

I only experience an FPS drop while nav mesh is rebuilding in 4.5 so we have to now figure out what you are experiencing :slight_smile:

Hi ,

You were correct on fps cap. I upped it to a max of 200 and did not experience any FPS drop when running commandline second time! However, I’m still not certain why I am not seeing an FPS drop and you are. How large is level you are working with that is causing error? Are you using bsp, static mesh, landscape (any combination?) that could be assisting in drop?

You need to use a very large nav mesh :slight_smile:

Anyone else reading this might think “oh but of course large nav meshes take FPS down,”

but my point is that this drop NEVER happened in 4.3 or 4.4, even for large nav meshes! And my AI still performed perfectly while new nav mesh was being generated!

So yes you need a large nav mesh, like 10-15 times size of third person starter level.

As far as scene itself, I just use static mesh actors, no BSP or landscapes

You could construct a reasonably complex scene with this large nav mesh I am describing and see what happens!

As I mentioned in my Repro, it should take your computer at least 10 seconds to rebuild nav mesh when you load editor, you want a nav mesh that causes that long of a rebuild.

Is my repro making more sense now?

Let me know if this helps and let me know what happens once you construct a scene with a nav mesh that takes at least 10 seconds to rebuild itself once you shut down editor and re-open level, with rebuild at runtime active

Thanks!

PS: remember this a serious problem, I reverted to 4.3 from 4.5 because of this issue, please understand I need a real solution for this issue which never happened in 4.3 or 4.4 and it directly affects fortnite and any game that uses rebuild at runtime.

#I just Reproed In New Project

Dear Everyone,

I just reproduced FPS loss in 4.5 in a brand new BP-only project.

#How to Quantify “Large” Nav Mesh, Repro

  • make a new third person project
  • I took out all BSP and used large static mesh floor pieces
  • I made a 3x4 grid of them

Each floor piece is scaled by 10 in all dimensions, and I am talking about starter static mesh asset called “floor_400x400”

  • Drag in a nav mesh bounds

  • Make sure to not scale it using widgets!

  • Instead highlight it and press F4 to see details panel, and change bounds to 70000.0 x 70000.0 x 70000.0

  • make sure your project is using rebuild at runtime!

#In 4.3

In 4.3 I do not get any fps loss when I rebuild at runtime with a nav mesh of this size

#in 4.5

In 4.5 I lose 20-40 fps while nav mesh is rebuilding for a nav mesh of this size

#Please Find Solution

Please find a way to avoid having this FPS loss happen for nav meshes of 70000 cubed, because my game very much depends on it!

Remember I reverted to 4.3 because of this issue, and any game with a reasonably large nav mesh is going to have this problem!

70,000 cubed is really not that big for any real level!

#:heart:

Best possible repro, . Thanks!

–mieszko

You’re welcome!

And here is a pic I just took showing results!

This is all in editor actually.

I ended up adding more than 3x4 of floor pieces, and I also have various capsules and pyramid static meshes on each floor piece, ended up with approxmately 30 floor pieces.

Here’s a pic of fps at game start, and then after nav mesh rebuilds