ONE MILLION TREES

I’ve started on a quest to tests the limits of uefn for big worlds and I was really surprised how well this works even with the current limitation. There were a lot of challenges and optimization made, even a secret unreal technique HISMs and I managed to make a huge map, around 10x BR size, with lots of trees on it, no hlods, no spatialization, everything loaded in and visible from anywhere.

Here is what I’ve learned from this:

  • HLODS should be used carefully, they can still take up lots of space and memory
  • Landscapes don’t benefit much from HLODS since they can adjust automatically
  • Foliage tool for some reason creates lots of actors which is bad for performance/memory
  • The unreal secret sauce for things like trees are HISMs, they perform way better than ISMs in this case

This map was mostly a test for the World of Trucks map that I’ve being working when I find time, so right now is doesn’t have much, but I’m planning to start making cities and stuff. If you want to play it you can find it here fortnite.com/@redcubex/4472-6632-4931

4 Likes

So what about 100 cities?

small

Apparently, my GTX 1080 was kinda struggling with rendering 1 million trees at the same time when looking at the world from above, so it was time for some more optimizations.

I set a new goal for this project: make a huge world bigger than the skybox, with over 1 million trees, over 100 cities connected by roads, and have it optimized enough to run even on mobile :slight_smile:

Here is the result so far: https://www.fortnite.com/@redcubex/4662-3510-3563

This was possible using UE5 tools that aren’t available in UEFN yet, so it required a lot of UE5 - UEFN migration and some custom UEFN Python tools.

Here is a quick rundown of the pipeline:

The terrain

The landscape is made using Mesh Terrain, which allows me to easily partition the world and add detail only where it’s needed.

For example, I can easily flatten the areas where the cities are, even after changing their size or location.

The downside is that Mesh Terrain is still experimental, and some features, like Spline Remesh, which I wanted to use for the roads, are still a bit buggy, so I couldn’t really use them.

The landscape is around 81 km². Initially it was 100 km², but that was kinda big. It’s split into a 5×5 grid of meshes, with only around 3k triangles each right now, so I can load the entire terrain at the same time without much memory usage.

Cities and roads

The cities, roads, and trees are all placed using PCG. This took me some time to figure out, but PCG has been a lot of fun to learn and use.

The cities are quite simple right now, mostly some blocks with roads. This is pretty easy to do with the PCGEx plugin. I even found another plugin called Watabou that can generate some cool cities, although I didn’t end up using it.

Unfortunately, PCGEx has some issues right now where some of the end connections don’t work properly. The engine seems to treat them as start connections, which means you can’t connect them normally. With some workarounds, though, I managed to get the cities and roads working.

The roads are still my biggest issue. Since the terrain is uneven and I want to create intersections, different road widths, and other variations, I’m still trying to figure out the right solution for this part.

One million trees

Now, this was probably the biggest optimization challenge.

Initially, I managed to get all 1 million trees loaded and fit them within the memory limits, but the game wasn’t loading properly, and there was basically no chance of getting it to load on mobile.

UE5 has a plugin for generating impostors, basically very cheap representations of meshes designed for distant objects, which is perfect for trees.

It was a bit of a hassle to export the results and make them work properly in UEFN, but after some tinkering I managed to get the billboard version of the impostors working, and they work really well, especially on mobile.

The trees themselves are also generated using PCG, but they’re partitioned into around 400 actors so they can take advantage of the engine’s World Partition system.

Conclusion

Overall, I’d say making really big worlds in UEFN is definitely possible.

That said, I’d probably recommend waiting for Mesh Terrain and PCG to eventually make their way into UEFN. Otherwise, you have to go a pretty long way around: creating everything in UE5, exporting/migrating it into UEFN, and then making custom Python tools to adjust settings and fix things that don’t survive the migration properly.

But it works — 100+ cities, 1 million+ trees, 81 km², and running on mobile. :slight_smile:

1 Like

Nice! I am wondering if the roads are a problem because there is no instancing on the merged road mesh as far as I know. Also it would be interesting to see a closeup of the trees you are using.