World Settings object changing while travelling through partitioned world

I’ve noticed one strange behavior. Tried to look after it here and google it, but found nothing. So, what’s up?

I have custom World Settings class with some UPROPERTY(EditDefaultsOnly) stuff that needs to be set in the editor and whose I use later. They are world dependent so that’s why I thought the World Settings will be the right place for those.

Also, I’m using World Partition, which is working well.

But, while travelling through my world, when the sublevels are loaded by world partition, I’ve noticed that World Settings object is exchanged with the new one.

This, what I’ve added to the World Settings BeginPlay()

UE_LOG(LogWorldSettings, Display, TEXT("%hs - %s - %p - %d - Our World is %s - Our Outer is %s"), __FUNCTION__, *GetName(), this, GetUniqueID(), *GetNameSafe(GetWorld()), *GetNameSafe(GetOuter()))

And this what I’ve found in the log while travelling through the world

LogWorldSettings: Display: ASFWorldSettings::BeginPlay - SFWorldSettings - 000001F609B22800 - 60175 - Our World is OpenWorldTest - Our Outer is PersistentLevel
LogWorldSettings: Display: ASFWorldSettings::BeginPlay - SFWorldSettings - 000001F63AAE1E00 - 59514 - Our World is OpenWorldTest - Our Outer is PersistentLevel
LogWorldSettings: Display: ASFWorldSettings::BeginPlay - SFWorldSettings - 000001F664A1C800 - 60522 - Our World is OpenWorldTest - Our Outer is PersistentLevel

So, it is clear that these are different objects. And I have no problem with that, that’s OK, but all the new World Settings instances have all my custom UPROPERTYies not set! And that’s a huge issue.

I’m on UE 5.7.4.

Any advice?

OK, what I’ve found out is, that World Settings object is bound with ULevel, not with UWorld. So that’s why there are created new World Settings objects when world partition loads new sublevels.
I have no idea, why those new World Settings objects have all UPROPERTYies not set, but it seems to have no matter at all.

Because I’ve tested it and GetWorld()->GetWorldSettings(false, false) always return the first World Settings object with all UPROPERTYies set as I set them in the editor, even if there are new World Settings created and even if the starting area is unloaded while travelling through the world.

That solves my fears about getting no configuration when being far from the starting point in my game, but creates new questions:

  1. Why later loaded sublevels have it’s own copy of World Settings without data set for the first World Settings created?
  2. What is the purpose of having multiple World Settings objects while using World Partition?
  3. Can we set the properties of those world settings in sublevels somehow?
  4. And finally, how it is possible to have many UObjects with the same name? Because all of those copies of World Settings while calling GetName() returned the same name.

Maybe some day someone will answer. For now, my doubts are dispelled.