What is the best way to dynamically render my world?

So I’ve got a bit of a dilemma here with my game that I’m making. Essentially, I’m looking for a system that can keep the integrity of my world intact while giving me better optimization. Let me explain…

I’m looking for a way to dynamically manage the visibility of certain areas or parts of the main map while keeping the Actors and Static Meshes which inhabits the map’s collision and geometry intact.

Additionally, I need a solution that ensures any modifications made to these areas, such as moving objects or destroying items, remain there when revisiting these areas. It is also important that AI characters do not fall through the floor when areas are being unloaded, even when an area is toggled off or becomes invisible. The goal is to reduce performance costs for areas far from the player without losing collision, AI logic, or persistent gameplay changes.

Now, my current dilemma arises because level streaming does not meet these requirements. When a streamed level is unloaded, any changes made to it are erased and replaced with a fresh state upon reload. Furthermore, AI in unloaded levels falls through the world or stops functioning entirely, which lets just say is not good for my game lol. The “Make Visible After Load” option in level streaming also does not provide the control I’m looking for, as it disables both visibility and collision simultaneously, leaving no way to toggle Actor visibility alone (while keeping static mesh and Actor’s collision intact). These limitations prevent level streaming from offering the fine-grained control that I require for toggling specific parts of the map while maintaining collision and functionality.

This map that I am making has the following characteristics:

  • All indoors, Immersive Sim style map and map design
  • Single Player (with AI being only other Pawn on map)
  • many interactable physics objects (that should remain in their place and not be reset ever)

I have done a bit of research on World Partitioning, but since my map will not be very massive and It seems that I will have less control when compared to level streaming, I’m apprehensive if this would be the right fit for me.

If anyone knows if there are any better options or have any opinions about the systems I talked about here, please let me know. I want to make sure that I have a good feeling about whatever system that I choose before building much of my game off it.

Thank you in advance everyone :slight_smile:

1 Like

There is no easy solution, I’m afraid.

The reason why streaming methods increase efficiency, is precisely because things are unloaded, and the engine doesn’t have to manage their state / collision etc. If you come up with something where things are still working, but just not visible, you might well find that you don’t really gain much from hiding objects.

It’s also true, however, that the ‘worst’ thing the engine has to do is actually draw everything. So it might be worth trying an experiment with not unloading everything, but just using something like dispatchers ( or large overlap volumes ) to toggle visibility for whole areas of the game. It’s worth a shot.

The usual way to ‘remember’ where everything is, is using a save game. All objects understand that they should save any changes for themselves, and when the level reloads, they start off from where they last were, giving the illusion of consistency.

I do think you’re looking at World Partition, Streaming or Level Instances though, unless you come up with a home cooked solution ( probably involving CPP ).

1 Like

Hello @ClockworkOcean,

While it’s not the answer I want to hear, it is exactly what I need to hear! A lot of my questions comes from ignorance of how exactly UE5 renders objects in the game world, and you so happened to answer quite a few of these in your response.

After doing some research, I feel like I may now have a better idea of the direction that I may want to take when rendering and optimizing my game. Here’s some ideas:

  • I’m thinking of using World Partition in order to unload unnecessary objects when my character is a certain distance away from them. This could be things such as lights, furniture, some walls, etc.
  • For the remaining items that I would like to properly save for when the player comes back into this area (physics objects that may have been moved, destructible environments, doors that are now unlocked, etc.) I can either use LOD’s or HLOD’s but I’m still not sure which of these 2 would be a good fit. I feel that HLOD’s will yield the biggest performance gain, but what happens when the player comes back into this area, will the environment that was once a static mesh correctly turn back into a bunch of static meshes?

With your experience, does this sound like a smart and more importantly feasible of getting the outcome that I’m looking for @ClockworkOcean?

Thank you again for such a thorough answer!

1 Like

WP is great because it’s automatic, and tune-able. But it’s not subtle. It really depends on your exact requirements. With things like streaming and level instances, you have more control, but you have to do more.

Like you say, great for loading and unloading things. Lights you don’t need to worry about. Even though they do get unloaded, you can always just set the maximum visibility distance, and done.

LODs again, useful. HLOD is for grouping lots of assets, so it’s a sort of super-LOD. So at great distance the player see the HLOD, then separate objects, but low quality LOD, then higher quality etc.

The thing is with HLOD is, if you’ve destroyed a building, for instance, you also need an HLOD of the destroyed area, for when you come back. Again, it really depends on what exactly you’re doing. From what you’ve described, mostly indoors, I wouldn’t bother. LODs are also automatic.

The best thing is to have a hack at several of these methods. Just make a bit level and stick a load of rubbish in it. Does it work the way you want? Tune it a bit, try another method. Etc. Before committing to early to a particular path.

Just to add… This thread may be of interest… There are many gotchas to using WP / Streaming. Doing a title search on World-Partition / Level-Streaming should bring up some of these (got 100’s bookmarked). Some only apply to Multiplayer, others are more quirks. But its worth building test levels before assuming too much. Basically try to avoid WP / WC / Streaming / Landscapes if you can find other ways. :stuck_out_tongue_winking_eye:

2 Likes

CDPR is also looking into streaming larger open worlds. Their methods might be worth a look.

@game-maker, @3dRaven and @ClockworkOcean

Guys… this is some brilliant stuff and is exactly what I was looking for! I’ve already begun making some test maps to experiment with various ways of optimizing my map whilst keeping its integrity (object persistance where needed).

Thank you guys again for all these resources. I’ve got a lot of work to do, but I’m excited about trying these methods that you’ve all suggested so my game can have buttery smooth performance :slightly_smiling_face:

Many thanks everyone!!!

1 Like

You want the old system and meshes. World composition.
Not the new trash system wolrd partition that doesnt work.

In short.
Pick a size you think works on the device you want to use as minimum spec.

Create 4 landscapes tiles.

Test performance.

Adjust by deleting and re-creating the tiles in different sizes until you have at least 90fps.

If thats not achievable, then you can’t use lansacape.
So repeat the same benchmarking after converting your landscape tiles to meshes from the Levels tab.

Some AAA games were able to get away with 1024 sized tiles (witcher 3), so you know, its not the end of fhe world if you need to make a lot of tiles.

Just keep in mind that in order for the tiles to be displayed when you look at the thing as a whole your drawcall count is up the roof.
You need to aggregate them by hand or via some re-implementation of an HLOD sysfem so that they are batch processed by the GPu instead of requiring a single call each.

In other “worlds” a world of 144km^2 made up of tiles of 1024m squared will require 144x144 drawcalls to render fully and probably crash and burn your gfx.

You need a way to combine those into… well preferibly a single call if seen from that far away… but you know the system has to be based on user/player position and object visibility.

Merge actor can help defining manual impostors.
Procedurally this can be done with runtime mesh merge somewhat (cpu intensive).

To create large things, you need to invest time into unf*k!ng the mess that is Epics’s rendering system.

Lots of ways its foobar. Lots of ways you need to patch it or work around it.

To the point you should just consider different engines for the purpose.
Unlreal is just not exactly capable of huge worlds out of the box.

Now, as far as indoor world, AI persisting, etc.
Its very much the same but you can levarage Data Layers to achieve the manual loading/unloading you need.

Still, your best bet is to create custom manager things that keep track of stuff even when said stuff is not displayed.

For instance, the AI character 4 doors down which doesnt need to actually exist for his position and actions to be kept track of can just be managed by this special manager class, along with another 20 or so units, all updated on the same tick event.

Like I said before your own system will always be superior to whatever Epic (or anyone) gives you for free. You should probably just invest time into this over anything else.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.