In my current setup, players can either be on the “surface” or “underground”. These areas do not need to be physically connected - the transition between the two areas does not need to be seamless (although I suppose it would be cool if it was).
Imagine a single level with both of these areas existing.
The player is on the surface. The camera is an overhead “top-down” camera, pointing toward the ground and following the player. While on the surface, the player cannot see anything in the “underground” area and they will not be able to unless they transition there. But let’s say this underground area was flooded with actors… tons of actors with tons of materials and components. Does the game “know” the player can’t see this? Would the player lag? I believe they would. (Note: this relates to another topic I posted that remained un-answered, so I was never able to get more information about how this works).
To help with this, I wanted to implement a system where the Underground area would not be rendered by players on the Surface and vice versa. My first thought was that everything underground would be flagged as “Hidden in game” for players on the surface. Then, when they transition to the underground, remove this flag and apply the flag to the surface actors instead. This seems pretty messy as I now need to find a way to effectively flag every object as either underground or surface and loop through all of them when the player transitions. It may be that this is needed but I wanted to explore other options.
I recently discovered Level Streaming. I don’t fully understand it yet but I was able to implement a basic test to see it in action. It did bring up some concerns though since when one player transitioned to the underground, the surface unloaded for all players. Also, I noticed that changes made to actors on the surface were not retained when the surface was re-loaded. This tells me that unloading a level does more than just “hide” it from view, it actually removes the actors involved.. I need the server to never truly “unload” either level. The server needs to keep track of both the surface and underground at all times. The system I am trying to implement is simply a clientside measure to improve performance. I suppose I could run a “is locally controlled” check to only execute the unload/load on the client performing the transition… but then what about the listen server? The listen server needs to keep track of both areas, so are they just screwed in terms of performance?
So for my questions:
- Is this even necessary? Is there a better way to tell UE4 not to render things that are out of the player’s camera?
- Does a loop to flag actors for rendering sound like a typical and viable option?
- Can level streaming be implemented effectively here?