How to generate HLOD for landscape tiles without affecting already created HLOD?

Hi guys. I am trying to generate a HLOD of landscape tiles so that the objects of the world can be seen in the distance, but the attempt ends in failure. As you can see from the screenshot, not all HLOD tiles were created and they are all of different sizes and a grid with a different number of polygons. Naturally, it was created for about an hour and it was created quite crookedly. If you create an HLOD for one tile of the world, then everything is fine with the dimensions and polygons in it, but if you do this for the entire landscape, then everything turns out crooked. Is it possible to fix this and how to generate in the “World Partition” HLOD for each tile separately without affecting the already created HLODs?
If there is no such possibility, then it is very strange that the developers did not do it, because it only loads the system and fills all the RAM during the subsequent HLOD assembly of the entire landscape.
Let’s say you made changes in one place on the map and you don’t need to generate all the HLOD maps and spend a lot of time on it. It would be cool to somehow freeze previously created HLODs with their components and actors inside that you don’t need, and generate those HLODS that you need, this would unload the system at the next assembly of other fragments of the HLOD landscape and the actors included in them.
I heard that this can be done somehow using "Hierarchical LODVolume and “Hierarchical LOD Outliner”, but in the “World Partition” mode, the “Hierarchical LOD Outliner” item is not active.
Please tell me if anyone has any thoughts on this?

The different resolution HLOD meshes is different resolutions based on the decimation of the Landscape Streaming Proxy.
So the more complex elevation variations of the heightmap will result in higher resolution meshes in those sections.
You can usually get rid of this and make all sections use the same resolution by using a larger “LOD 0 Screen Size” value such as 2.0, 2.5, 3.0 etc.
I have found that you have to try different values to see what works best on each terrain layout.

However, I have never seen an HLOD build that has empty sections like your screenshot, and I have done a lot of them.
So I have no idea what is going on there.
I would check your Task Manager Memory and see how much Commit you are using while building the HLODs, you could have a memory issue, as it usually requires a lot of RAM and Page File to build.
The fact that it is taking an hour suggests that you are hitting the Page File which is really slow.

Regarding building the HLODs in multiple batches, I haven’t seen anything on that myself.

1 Like

Yes, that’s what I did, I set the value of “LOD 0 Screen Size” to a maximum of 10, but everything is exactly the grid turned out to be uneven. The fact that HLOD turned out in chunks is due to lack of RAM, after which the creation of HLOD was interrupted and what you saw turned out. The problem is that in order to finish creating the missing HLOD tiles, I will lose the ones already created, since they will be erased when clicking the “Build HLOD” button if you remove the HLOD Layer from the parameters of these tiles. So the question arose how to save these grids by creating those that were not created due to lack of memory?

If you ran out of memory which resulted in the missing HLODs on the Landscape, then your only choice to fix that is to get more memory or build HLODs on a computer with more memory.

I even tried the “HLOD.Include Actor in HLOD” checkbox property on each Landscape Streaming Proxy actor.
According to the tooltip help, that option is whether the actor should be considered for LOD generation, in other words, whether or not it is built when you do an HLOD Build.
But building the HLODs with some LSPs checked and other unchecked always deletes the existing ones, so that won’t work.

Since an HLOD Build deletes all existing LSP HLODs, then you are out of luck, you will require a computer with more memory to successfully build the full Landscape.

My experience with HLOD Building is that it is terrible unoptimized, I did a build on a 16321x16321 Landscape with my workstation at Screen Size of 1.0, and it required a commit of 730GB (500GB of RAM and 230GB of Page file).

The other HLOD control features such as the HLOD Volume is only for grouping actors, it is not for controlling Landscape LSPs.

1 Like

It’s a pity, but I don’t have such capacities. It is very strange that HLOD was created to optimize upov, and its construction was done so unoptimized.

How much RAM memory do you have in your computer, what size is your Windows OS drive, and what size is your Landscape?

If you are running Windows 10/11, the Page File in “Windows Managed” mode will typically only go up to 4x RAM memory.
Then any calls to malloc to allocate memory after that size is filled, will just return an error.
So if you have 64GB of memory, your Page File in Windows Managed mode will go up to 256GB max, for a total of 320GB of commit (RAM+Page) before Unreal Engine gets a malloc error.
UE5 HLOD Build uses Page File virtual memory, but it requires a lot of it.

What I would try doing, is changing your Page File from Windows Managed to Custom, and set your Maximum Size to 8x your RAM or more, assuming that you have sufficient OS drive space.
You should be able to set the Custom Maximum to at least 16777216 MB (16TB) before getting an error in the Windows Page File setting dialog, but you probably don’t have that much drive space.
So, if you are for example, running a 1TB NVMe for a Windows OS drive, and you have 64GB of RAM memory, try setting the Custom Maximum size to 524288 MB (512GB).
Assuming that you have at least 512GB free on the OS drive.
Chances are you won’t use the full 512GB of Page File for the build, if you are lucky.
Or use whatever value is 8x your RAM, if you have the drive space.
That will give Unreal Engine 5 twice as much commit (8x) before the malloc returns an out of memory error.

Note that your HLOD Build will be really slow and take a lot of time to complete.
This is because of the disk speed, for example a SATA SSD is 40 times slower than DDR4-2133.
So what takes 1 minute in memory will take 40 minutes when paged out to virtual.

Let me know what happens…

The Page File settings in Windows 10 are in System, Advanced System Settings link, Advanced tab, Performance Settings, Advanced, Virtual Memory.
The dialog looks like this:

Note that you should preferably have the Page File on a NVMe or SSD drive.
If you put it onto a standard Hard Drive it will be really slow.

Also note that you can set the Custom Initial Size to 1024 MB or whatever you want.
That way the Page File will pre-allocate itself to 1024MB, then grow up to 512GB, for example.

1 Like

My system:
Windows 10
DDR4 2667MHz 64 GB RAM
SSD 1Tb
Geforce Nvidia RTX3060 12GB
I generated different worlds ranging in size from 64000x64000 meters to 14000x14000 meters in order to determine the resolution of the map on which I will make my game, but I haven’t decided yet, because when calculating, I need to make a RAM reserve for other objects and needs of the game.
And I’ve already done all this with the swap files, although I didn’t allocate as much as you indicated, I didn’t think it was so critical, but thank you exactly.
Maybe there is an opportunity to somehow contact the developers of Unreal Engine and give them an idea about how they would implement the ability to create HLOD separately for each object without affecting the already created ones, but not in one pass, spending huge system resources on it?

If you are getting an error such as the malloc failed, the log file will tell you what the used memory and page file amounts are, so that you can tell how much you are using.
You would have to keep bumping up the Page File size from there until you stop getting the memory allocation error.

A 64000x64000 meter landscape is huge, not a recommended size, and you must be using World Composition, since World Partition max’es out at 16384?

Naturally, when creating the 64000x64000 meters world, I received crashes from the program, so I lowered it to 16000x16000 meters, but it’s not even that, but that you can do huge maps with my system configuration, but the HLOD assembly crashes.

By the way, I accidentally found your video, but it turned out I subscribed to your channel, you outlined the problem of building HLOD very well there UE5 World Partition Part 13 HLOD Part 1 - YouTube

when creating the 64000x64000 meters world, I received crashes from the program

You should have no problem doing this size with World Composition.
In WC a 2017x2017 30x30 tile set will get you 60481x60481 size, and a 4033x4033 15x15 tile set will also get you 60481x60481 size.
World Partition is currently limited to a maximum 2D Texture size, so its largest valid WP size is 16321x16321.
UE5.3 is supposed to be increasing the size of the maximum WP landscape possible, but as of 5.3 Preview I have not seen this feature in the engine yet.

so I lowered it to 16000x16000 meters

If you are using World Partition, the valid size nearest that is 16321x16321.
If you use 16000x16000 you will end up with a stretched and padded landscape out to the valid size.
You can calculate the proper WP size with the formula (511 x N) - (N - 1).
Where N is the number of components you want.

but the HLOD assembly crashes

I was able to create the HLOD for a 16321x16321 WP Landscape and it only used 50GB of memory, with a LOD 0 Screen Size of 5.0.
So since you have 64GB of memory you should be able to do that no problem.

I would have to see the ending error portion of the log to know for sure.

You should just be able to increase your Page File to a really large size.
Or you could get the engine source, and in the Build HLOD function, change the code so that if the LandscapeStreamingProxy “Include actor in HLOD” is disabled, it doesn’t delete the current HLOD, that way it keeps your current HLODs.
Those are the only way that I can see to fix the issue.

1 Like

Thanks for being a subscriber.

I have more HLOD videos coming for the channel as well.
I have more tests to perform and more information to gather on the HLOD system.
Then I will be making videos on how foliage and meshes affect HLOD as well.

1 Like

That’s exactly what I would like to do, although I have programming skills, but only in PHP and JS languages, and I’m afraid I won’t find the part of the code that is responsible for this, because reverse engineering is not such an easy job and it is very difficult to understand someone else’s code.
I’m not quite sure that the programmers of the unreal engine itself understand how their code works and where exactly errors occur, given the many bugs of the engine, and if I get there, I’m afraid the engine will stop working altogether. One thing confuses me, if the programmers themselves did not implement such a function that I want, and which obviously could give a good optimization when building HLOD on weak computers, maybe it is simply impossible from a technical point of view and the whole basis of building HLOD is to create them for the first time by deleting others, not is it really that difficult and you can’t do it manually one by one?
Of course, I will download their source code of the engine, try to do something, but I’m not sure that I will succeed.

Each HLOD for each LandscapeStreamingProxy will be one or more uasset files, so it should be possible to create them in batches, without deleting all files and starting over from zero.
I honestly don’t understand why Epic does so many things in such a difficult manner.