Loading and Saving a savegame with World Partition?

So, going through the World Partition stream brought up more questions than it solved.

With Cells constantly being loaded/unloaded, how do we now save the state of the game, especially with multiple layers etc?

It would be quite annoying to have to track all actors and their state whenever a cell is loaded/unloaded, especially given that an actor might move from one cell to another.

Hi!
Thank you Yaeko
I would also like to know the answer to this question. Is there some special setup we need to do to Save and Load stuff in the World Partition and Data Layers?
For example, what if I move an actor from one data layer to another during gameplay, and I want to save which data layer he is currently in, as well as its position in the world?

I have code in my save plugin now to save/load the state of data layers themselves.

But cannot access proxy actors that later load/unload the actual actors, outside the Editor I think all the API they built is private.

This still is a big issue to me, since there is zero documentation regarding this.

Without some event that fires when a cell will become unloaded, I have no way of figuring out the stuff that needs to be collected for a future save-file.

EDIT: I mean, yes… i can just figure something out in terms of workaround, but tis dumb that no one thought about loading/saving with World Partition.

EDIT: DataLayer documentation is wrong too, the nodes dont exist in the engine. ( Get Actors from Data Layer)

Guess I wont be using world partition then, or Data Layers, in its current state its unusable, due to the lack of tools to “deal with it”.

PS: Thanks bruno, but I dont use plugins at all - nothing against them, but I like to know whats going on because I built it myself :stuck_out_tongue:

1 Like

Did anything change in that regard?
Are there events now to bind to on cell load / unload?

No idea, didnt check again, just went with the old level-system instead.

While it’s not optimal for large amounts of items, the simple solution I found for items I want to save is to uncheck “Spatially Loaded” under World Partition category in the details panel. This seems to make the items persistent so that they can be referenced when re-loading the level. Hope this helps!

technically, there would be a way to control Data Layers like levels, but many of the relevant nodes are only in the documentation, they dont exist in the engine.

only some of them can be found, and only after turning off context sensitivity - its a complete mess.

I have zero clue on how any of this is supposed to work, when the nodes cant be accessed.

EDIT: I mean, I am aware that some things dont work in a Function for example, but where are these nodes supposed to be used - especially the missing ones, like “get actors from data layer”… which is what could be easily used to save stuff.

I also checked YouTube already, couldnt find a single video explaining this, they all just go over “how to add data layer to the list”.

1 Like

I was digging into this recently, all the functions you would need to set this up are still not part of a publicly exposed API. I’m hoping someone adds this soon as it wouldn’t be much work, i’d rather not have to resort to creating a source build just to add some API macros and mark things public.

Also having a way to correctly move items either between different cell sublevels or into the persistent level would be useful

1 Like

that explains my findings (or the lack thereof), I guess.

Meh, maybe 5.1 will have them public.

Let me know if you find any useful resources on this as it’s becoming a bottleneck in my project for various different features. I’ve been looking for good solutions for a while now.

On EndPlay there is a parameter with an enum passed through as to the reason why the actor has been ended, EEndPlayReason::RemovedFromWorld is one of those reasons. I haven’t gone down the train of thought to apply this to solving this problem so maybe there is a solution here.

Though I would still prefer to just be able to get a OnCellUnloaded/Loaded callback from the world partition subsystem or something similar and be able to get a list of all actors within that cell.

1 Like

It´s Editor only, not runtime.

For “GetActorsFromDataLayer” you are using the “DataLayerEditorSubsystem”…
While for the BP-Nodes which are available, you are just using the “DataLayerSubsystem” (without Editor) ^^

Check those links for the difference:

I don´t know why they are editor-only, because it would be a high performance-boost, if you could add actors to data layers at runtime…

1 Like