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?
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
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”.
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
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.
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…
Without digging into the source yourself that isn’t likely to happen soon.
You can probably make a custom plugin to expose this functionality after examining how the stuff is loaded/unloaded - assuming it is at all accessible/kept track of.
If it isn’t, the issue is far more complex as youd need to add a system to keep track of it.
The gameplay tags ideally cut to the second situation ignoring the digging and just flat out assume that nothing is kept track of.
I’d probably add an oncreate event to flag the gameplay tag in some creative way whenever the actor is loaded.
Sruff loads over async (i hope ffs?) however, so its not like a “race condition” is going to be able to tell you what data layer loaded what.
Youd have to query the data layer name from the actor loading on creation, or something around those lines…
Naming data layers the same as landscape tiles and or whatever the actor “stands” on which loads along with the data layer could be a quick way to figure out where the actor was first instantiated for instance.
It would basically require just 1 additional invisible mesh that you can do a single line trace down to every so often until it actually exists - get a name back, and disable the trace system.
Clunky af. But its a start towards something…
You guys should check out the Valley of the ancient, I’ve been looking for answers about making a call back when unloading and activating data layers and stumbled upon how they made the loading screen on the transitioning to the dark world.
I’m still wrapping my head around it, So I can’t say for sure this is the answer but It’s a good start.
Now that I’ve been working on data layers, I’ve also created an Actor that tracks other actors of interest within that data layer. I used that to handle every query that I needed. It’s a matter of passing and receiving data from that actor.
I’ve only started using data layers, I’m still trying to learn it. So this might not be the answer but I hope this helps.
Data Layers have been incomplete for a long time, with many necessary functions only available in the Editor Subsystem and many more not available anywhere. For example, there is no way to load data layers asynchronously in the background. That means that if you want for assets to load gradually in the background, it won’t happen. Instead the game will stall and block the whole main thread if your machine can’t keep up.
We also looked up how Valley of the Ancient handled loading/activating Data Layers and how it signaled when the process was finished. Basically, the demo puts everything on pause (with a fade to white screen) while the loading happens. When it’s done, it fades out of white. Not a very robust feature.
This Data Layer solution was advertised nearly 3 years ago as a mature replacement for Level Streaming in an Open World concept, yet all these years later it is still technically less capable than Unreal Engine 4’s Level Streaming functions.