Why does this engine loads levels AFTER loading the player? (World composition)

Hi,
I’ve tryied to make a game using world composition for more than one year and I still don’t know how to start a game in a loaded level.
While it works in “play in editor”, once loading the game from “standalone game” or built, the game starts with my player falling in an empty world while the engine is starting to stream the levels.
I’ve read a LOT of forum discussions for one year and all I was able to find are really dirty tricks which leads to really dirty results.
I don’t understand why UE4 loads the player first, THEN load levels when all engine do the exact opposite (which is more logic).
The screen should remain black (or your loading screen), THEN, when loading is finished, start the game.

There a node called “Flush level streaming” described by “Flushes level streaming in blocking fashion and returns when all sub-levels are loaded / visible / hidden” but it does absolutly nothing. I put it in the begin play event of every blueprint (character, controller, game mode, level blueprint, etc) and it doesn’t have any effect.
Why is so hard to use this “open world tool” ?

Would you not just start everything with disabled gravity, stream, and then upon the load finished re-enable gravity?

The problem with world composition is it’s an automatic level streaming system and you have zero control over it.

  • You can’t get the name of the sub level where your character is
  • You can’t know when one or all sub levels are loaded

Preventing the character from falling is only one small part of the problem. The whole game starts even there’s 1 minute of loading before the sub level you’re in is loaded which mean looking at a flying character for one minute until this sub level is loading (and you can tell to your code that it’s loaded).
Like I said, I’ve read a lot of tricks (freezing the character, spawn a black widget on whole screen to hide the streaming, doing line trace on tick to check if there’s a landscape under your character, etc.) but this is really dirty stuff, no engine works like this and it break to many things.

To make the world composition usable, the game shouldn’t start before the world is loaded.
Oblivion, Skyrim, The Wicher 3, etc. All those games use world split into cells and streamed in/out like world composition does but none of them start streaming the cells AFTER the game starts.

1 Like

I assume you already went over these with a fine tooth-comb?Getting Started with Level Streaming | Live Training | Unreal Engine - YouTube
I have only done very basic level streaming so far, so I haven’t run into any issue that wasn’t surmountable by loading everything while still in the menu…

While world composition is a system which streams your world divided into sublevels, it’s not the “level streaming” thing.
You don’t have access to those nodes/events/functions related to the “level streaming” logic. They’re both different systems.

You import a heightmap divided into tiles and the “world composition” create a sublevel for each tile and each tile has it’s own streaming distance/proxy/level bounds/etc.
Based on the streaming distance, each tile is automaticaly loaded/unloaded without a single line of code, adding streaming volume, etc.

@Haoris You can still use the World Composition tiling feature and do the level streaming manually. You need to disable the automatic streaming tile by tile. With this in mind you build a system under the GameInstance blueprint to take care of the level loading and bringing the tiles based on where your character is going to be spawned into the level.

I don’t see how it would resolve the problem of the game starting (I mean tick, begin play events, etc.) before the level loading/streaming.
I’ve found this C++ solution but trying to make it work with my basic C++ knowledge : https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/93543-preventing-player-from-falling-through-newly-streamed-levels

I wonder how exactly you do that? Is that the “Client side level streaming” flag?

Typically you’d have the “Game Mode” check if the level is loaded, then spawn the “character/pawn” and attach the “controller” to it.

Is Level Loaded … Is Level Loaded | Unreal Engine Documentation

@Rev0verDrive - The Game Mode node doesn’t interact with the Is Level Loaded node. Is there an alternative?

I’m having the same issue as @Haoris - very briefly, before my loading screen map comes on there is a flicker of the character falling down the screen. If I can solve this using your method that would be fantastic :smiley:

FWIW, the best solution I’ve seen to this problem is in post #8 in this thread:

https://forums.unrealengine.com/development-discussion/blueprint-visual-scripting/93543-preventing-player-from-falling-through-newly-streamed-levels?p=1484557#post1484557

That’s what I did too but now after my loading screen, I see a partially loaded level with frozen camera and the three dots of loading until my level is fully loaded. I can’t find how to hide this.

Huh! For me, the level is fully loaded by the time the loading screen goes away.
(Separately, I can’t find a way to make my UI widget draw on top of the loading screen, it’s just all black …).