Generating foliage with procedural foliage volume drains system memory, and takes forever

For example In our project for some procedural foliage volume took about 5 sec to generate foliage (ver. 4.13.2). After updating project to ver. 4.14.3, for same procedural foliage volume (same procedural foliage spawner) it takes about 15 min. In case of generating more than one foliage volume, editor crashes after draining all system memory (32 gb). Please fix this ASAP, because it’s a big show stopper for our project.

Hey Gamepires,

Would you mind providing me with your crash logs and ‘dxdiag’ so I can have that information when I begin investigating?

Also, how many unique foliage meshes are you spawning at any one time when you generate the foliage within the procedural volume?

Thanks,

Yes, no problem. Everything is inside zip file including screenshots.

  • World size: 12x12 km
  • 4x4 levels (3x3 km one level)
  • Every level has 48 foliage generated volumes
  • One volume has average of 4000 instances

Number of unique foliage meshes per volume is at average 10 and max at 20.

So your test case is quite extreme, and is going to be hard for me to replicate on my end from scratch. We appreciate you providing the necessary information in regards to the crash logs, but taking the time to reproduce this issue with all the parameters you’ve specified, and still potentially not get the crash would be a big time sink.

For issues like the one you are experiencing, it falls on the reporter to narrow down the test case to as minimal as possible in order for us to share that project internally and get a fix in place. It also appears that the density of your foliage has increase by a bit. Check to make sure your settings are remaining the same for your foliage instances to be populated within the volume.

Typically what you would want to do after generating your procedural foliage and you have it laid out as you would like, you then bake out the results and begin merging those meshes together to reduce draw calls and improve performance. Having all of your levels loaded and visible at once, and then procedurally generating foliage for any one volume, I would assume to be somewhat performance heavy. Not necessarily that you should be seeing a crash, just the workflow you are using sounds resource heavy to start.

Let me know if you have further questions.

Did you changed code related to foliage generation from 4.13 to 4.14? What is different? How is it possible that an identical level after conversion to 4.14 is 20 times slower generating foliage and we didn’t changed nothing on our side. This happen on every computer. On 4.13 we can select 16 generator at once and everything will be finished in one minute. Now on 4.14 when we select 2 generators it takes forever and crash editor. Again, level is the same.

I just ran a test on my end using 18 Procedural Foliage Volumes, 2 different landscapes, and about 30k instances in total to be populated all at once. When I choose the ‘Resimulate’ option, it takes some time to generate the new placement of the instances but I do not get a crash.

As mentioned earlier, your test case and set up are extreme cases and even though it might have worked fine in 4.13.2, the way you are using the Procedural Foliage Volume is not the intended functionality. Typically you use only a few of these and allow the volume to encompass the entire area you wish to populate foliage. Is there a particular reason you need to use the number of volumes and instances for your project?

In order for me to report this issue, I am going to need a way to reproduce it in a minimal test case project. A way to show that the base performance for the Procedural Volume Tool has regressed in performance. As it stands on my end, I cannot reproduce this performance issue or get a crash. If you can show me a video even of this reproducing on your end, that might be enough on grounds for reporting the issue. Our engineers need a way to break it, in order to fix it.

Let me know if you have further questions.

Thank you,

Hi Andrew

Here are the reproduction steps
On order to use the same assets on a both end, I Used “LandscapeMountains” project downloaded from Epic Store “/Learn/Landscape Mountains”

  1. Download “LandscapeMountains” project for engine version 4.13.2
  2. Download “LandscapeMountains” project for engine version 4.14.3
  3. Open “LandscapeMountains” project 4.13.2 and enable in editor settings/experimental/Procedural Folliage, Restart editor
  4. Convert/Save SM_PineTree as Foliage Typelink text
  5. Adjust setting like as on screenshot
  6. Create new Procedural Foliage Spawner, and insert only SM_PineTree_foliage type
  7. Delete existing folliage from the world
  8. Insert new foliage volume into the world, and set size X=100000.0, Y=100000.0, Z=100000.0, Location X=-20000.0 cm, Y=-80000.0 cm, Z=20000.0 cm
  9. Brows your newly created Procedural foliage spawner and Recalculate with only “Allow Landscape” flag turned on, “Tile Overlap 2000”

Result on my end is
Calculating time = 1 sec
Foliage spawned = 9.57k

(Repeat all steps in 4.14.3)

  1. Open “LandscapeMountains” project 4.14.3 and enable in editor settings/experimental/Procedural Folliage, Restart editor
  2. Convert/Save SM_PineTree as Foliage Type
  3. Adjust setting as on screenshot
  4. Create new Foliage spawner, and insert only SM_PineTree_foliage type
  5. Delete existing folliage from the world
  6. Insert new foliage volume into the world, and set size X=100000.0, Y=100000.0, Z=100000.0. Location X=-20000.0 cm, Y=-80000.0 cm, Z=20000.0 cm
  7. Brows your newly created foliage spawner and Recalculate with only “Allow Landscape” flag turned on, “Tile Overlap 2000”

Result on my end is
Calculating time = Aborted after 92 min, (Aborted after several runs longer than 30 min)

Then I tried to reduce volume to half size X=50000.0, Y=50000.0, Z=50000.0
Calculating time = 4 minutes
Foliage spawned = 2.4k

Have the same issue here, but it takes about 45 minutes instead per volume. I had to split the landscape into 2km by 2km chunks to reduce it to ‘45 minutes’… still keeps crashing from time to time. Also i noticed it tends to allocate about 49GB of RAM…

I can confirm the issue is exactly as described. My temporary solution now is to use 4.13 to generate the foliage, then import it to 4.14.

Hey ,

Thanks for the clear and precise repro steps. I was able to confirm what you are reporting and have gone ahead and entered a bug report for the issue. You can track the report following the link below on our public issues tracker.

UE-41938

Once the issue has been addressed by our engineers the ticket will be updated and reflected in the public tracker. Let me know if you have further questions or need additional assistance.

Cheers,

Awesome, thank you, Andrew…

Hi,

Just to let you know I determined the slowdown and crash are both triggered by a bug in 4.14 which we had already fixed for 4.15. If you do not wish to update to 4.15 immediately, the fix is to a single file and you can find the diff here on GitHub:

https://github.com/EpicGames/UnrealEngine/commit/efb7531aef6da5a92dfd4c73a7443b627420a9e6

Cheers
Jack