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"

Dynamic navmesh and pathfind causes incremental framerate drop

Hi there,

If I set my navmesh to "Dynamic" or "Dynamic Modifiers Only" and then put a pathfind in the event tick of a blueprint I will see an incremental performance decrease over time until it suddenly shoots up to full framerate again. Which I guess is when garbage collection occurs.

Steps to reproduce: 1. Blank project. 2. Place a standard "Floor_400x400" static mesh at -500,-500,0 and scale it to 5,5,2 3. Add a NavMeshBoundsVolume that covers the floor, and check that a RecastNavMesh is created properly. 4. Set the RecastNavMesh runtime generation to "Dynamic" or "Dynamic Modifiers Only". 5. Open the SM_Chair asset and under Navigation, set its area class to NavArea_Obstacle and check the "Is Dynamic Obstacle" box. 6. Create an Actor blueprint and add the newly modified SM_Chair asset to it. 7. Add a "AddLocalRotation" node in the Event tick of the blueprint with delta rotation 0,0,1 and hook it up to the SM_Chair static mesh component. This is to force the navmesh to be recalculated every frame. 8. Add a "FindPathToLocationSynchronously" node in the Event tick with path start set to 1300,1300,1 and path end -350,-350,1. 9. Place the actor on the floor in the level so that it affects the navmesh. 10. Hit run and use the console to show the navmesh and show the FPS. Make sure the navmesh is constantly updating and see how the framerate gradually goes down over time.

Is there any way to avoid this issue? A garbage collect seems to prevent the framerate from gradually decreasing, but it also prevents the game from running at any desired framerate. Is there a more selective garbage collect I can do, or perhaps another approach altogether?

Product Version: UE 4.17
more ▼

asked Sep 19 '17 at 10:46 AM in Bug Reports

avatar image

141 6 12 22

avatar image Xylord Nov 21 '18 at 08:40 AM

This issue still exists, did you ever figure something out?

avatar image Hejden Nov 21 '18 at 09:26 AM

I haven't touched that feature since I posted, so I don't have an update I'm afraid. But I do have some kind of faint recollection of Epic updating the garbage collect feature so that it wouldn't be spread out across multiple frames instead of just hogging the entire system all at once. But I haven't tried it and could be wrong.

But to be honest, I think the only way of dealing with this is in a satisfactory way is to go into the code and rewrite the dynamic pathfinding feature so that it clears the cache with each new pathfind (or however you want it to work).

avatar image Xylord Nov 21 '18 at 09:55 AM

Ah, that sounds like a fair bit of work. I'm getting more acceptable performance by only finding paths on a 0.5 seconds timer, so I guess this will have to do for now. I really have to commend you on answering on a year post within half an hour though, that's pretty swell of you.

avatar image Hejden Nov 21 '18 at 10:05 AM

If a pathfind once every half second works for your game, then that could be a workable solution. With a low frequency like that, I don't think the amount of paths in cache will ever reach a level that will affect performance too much before the built-in garbage collection clears it (every 90 seconds or so?).

No problem, I'm doing some pretty boring work at the moment so I jumped at the chance to do something else to be honest :)

(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