What's the relationship between Packages and Levels?

When reading through code and documentation, there some parts that talk about “Package” (mainly, when serializing objects into separately loadable chunks) and other parts talk about a “Level” (mainly, where actors are spawned/attached) and yet other parts talk about a “World.”

Yet, the menu item in the editor is called “New Map”

I’ve managed to make it this far without having a really crisp separation of what these things are, but I think I need to understand how Package and Level differ now, because I’m diving pretty deep into world composition and editor scripting.

So, my guess is that there is only one World – is this correct?

And then Levels load into the World. Many Levels can be loaded/unloaded into the same world. When using World Composition, the Persistent Level is the one that “makes” the root of the World. – is that OK so far?

During gameplay, there is also the Transient level, so even if I only use a single Level, there will be two of them when playing, if you count the transient – is this true?

I think that “Map” is simply an old word for “Level” that comes from the original Unreal game? Is a “Map” ever anything other than a Level?

Finally, Packages are the things that contain the data that Levels are loaded from. Every Level cooks to one Package. Is this true?

OK, now for the bits where I don’t have a good theory:

There are some parts of the editor API and world composition API that talk about Package names/paths instead of Level names/paths. Are these always one-to-one? Or can there be multiple packages for a single level? Can multiple levels live in a single package? Can there exist a package for something other than a level (a downloadable character skin, for example?)

When trying to figure out which world composition sub-level something belongs to, and/or placing new actors into specific sub-levels using editor scripting, it seems I need the Package identifier, not the Level name. What’s the general way of getting the Package identifier for some arbitrary actor in the editor?
How about for classes/objects that live in the file system but aren’t actors? How do I assign these to Packages, or do they get clones into every Package that contains some Actor that references them?
Can I “make” a new “package” any other way than through “New Map”?

1 Like