Sublevel not loading

We’ve created a randomized world with multiple levels(chunks). We have a root level that we stream levels in and position them accordingly(making a path). We do this when loading into a new level from our Hub. The issue we are having is those streamed levels don’t load the sublevel’s. I’m sure I’m just missing something easy here, but I would of sworn this was working a few versions ago.

Debugging -
so far I’ve watched the LoadComplete under the Game Instance, and none of the sub levels load. I even went through all the levels - still doesn’t show it loaded levels.
I placed a break point inside UWorld::AddToWorld, and I’m still not seeing any sub levels come across.

If I play from inside the editor with a level that has sublevels it all loads fine. So I’m leaning towards it has something to do with the LevelStreaming object we are creating dynamically in code.

Curious if you might have an idea where I should be look to figure out why the sub-levels aren’t loading. I’m sure there is just a list that it’s loading and if I could figure out where that is - awesome.

Thanks!
Marsh

Hello,

If you want to load in a stream level in 4.22 you should be using UGameplayStatics::LoadStreamLevel(). You can read more about the function here.

void AMyActor::OnOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* otherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult &SweepResult)
{
	UE_LOG(LogTemp, Warning, TEXT("Root Component has been overlapped."));
	FLatentActionInfo latentAction;
	UGameplayStatics::LoadStreamLevel(GetWorld(), TEXT("TestLevel"), true, false, latentAction);
}

From,

Thanks for replying . So we are doing that to stream levels in. I found some documentation that stated sublevels of a level don’t load using ULevelStream. Had something to do with sublevels were stored in the world, and not the level. I did get it to working by saving the sublevels in an object that we place in all our chunks and then manually stream them in.

I think we can close this. It’s not really a bug, it’s just how the engine works. Maybe I’m wrong and if I am please let me know.

Hello,

Glad to hear that you have a solution. From what I have found this appears to be by design.

From,

Are you talking about loading a sublevel of another, parent sublevel? How did you get that to work exactly? I can stream load a sublevel of my main persistent level, but that sublevel’s own sublevels don’t load with it.

yeah they won’t. It’s just how the engine works. I ended up making a simple object that kept all the paths to sub levels and then in game loaded them. Let me know if you want examples or not, glad to post them.

Yeah that would be great, if you have an example please post it. So do you have to manually type in all the names of those sublevels to load? Or can you retrieve the names of the sub-sub-levels automatically and load them all? That seems like a pain if you have to by-hand manage all the sublevel names, especially if you have a bunch of levels.